basic compatibility with Java 7 (i.e., don't crash immediately)
This commit is contained in:
parent
f091bb3aca
commit
3317c1ccf6
|
@ -36,7 +36,7 @@ public class LibraryVersionTest extends WalaTestCase {
|
|||
@Test public void testLibraryVersion() throws IOException {
|
||||
AnalysisScope scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA, (new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), MY_CLASSLOADER);
|
||||
System.err.println("java library version is " + scope.getJavaLibraryVersion());
|
||||
Assert.assertTrue(scope.isJava16Libraries() || scope.isJava15Libraries()||scope.isJava14Libraries());
|
||||
Assert.assertTrue(scope.isJava17Libraries() || scope.isJava16Libraries() || scope.isJava15Libraries()||scope.isJava14Libraries());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ public class DataflowTest extends WalaTestCase {
|
|||
public static void beforeClass() throws Exception {
|
||||
|
||||
scope = AnalysisScopeReader.readJavaScope(TestConstants.WALA_TESTDATA,
|
||||
(new FileProvider()).getFile("J2SEClassHierarchyExclusions.txt"), DataflowTest.class.getClassLoader());
|
||||
(new FileProvider()).getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS), DataflowTest.class.getClassLoader());
|
||||
|
||||
try {
|
||||
cha = ClassHierarchy.make(scope);
|
||||
|
|
|
@ -411,6 +411,10 @@ public class AnalysisScope {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isJava17Libraries() throws IllegalStateException {
|
||||
return getJavaLibraryVersion().startsWith("1.7");
|
||||
}
|
||||
|
||||
public boolean isJava16Libraries() throws IllegalStateException {
|
||||
return getJavaLibraryVersion().startsWith("1.6");
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public final class ClassReader implements ClassConstants {
|
|||
if (magic != MAGIC) {
|
||||
throw new InvalidClassFileException(offset, "bad magic number: " + magic);
|
||||
}
|
||||
if (majorVersion < 45 || majorVersion > 50) {
|
||||
if (majorVersion < 45 || majorVersion > 51) {
|
||||
throw new InvalidClassFileException(offset, "unknown class file version: " + majorVersion + "." + minorVersion);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue