use of org.apache.xbean.asm9.ClassReader.SKIP_FRAMES 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 + SKIP_CODE + SKIP_FRAMES);
if (visitor.version != 0) {
return visitor.version;
}
} catch (final Exception e) {
// no-op
}
// version
return javaVersion;
}
Aggregations