use of org.apache.xbean.asm6.ClassReader.SKIP_DEBUG in project component-runtime by Talend.
the class ProxyGenerator method findJavaVersion.
private int findJavaVersion(final Class<?> from) {
final String resource = from.getName().replace('.', '/') + ".class";
try (final InputStream stream = from.getClassLoader().getResourceAsStream(resource)) {
if (stream == null) {
return javaVersion;
}
final ClassReader reader = new ClassReader(stream);
final VersionVisitor visitor = new VersionVisitor();
reader.accept(visitor, SKIP_DEBUG);
if (visitor.version != 0) {
return visitor.version;
}
} catch (final Exception e) {
// no-op
}
// version
return javaVersion;
}
Aggregations