Permalink
Browse files

Support class file version number for JDK 12 and 13

  • Loading branch information...
ingokegel committed Jan 20, 2019
1 parent 6cdf3dd commit 7d6d4bbec51cd746a82fdf2c6734f48ed11df2ed
@@ -152,7 +152,7 @@ class BrowserTab(val fileName: String, val moduleName: String, frame: BrowserFra
"An unexpected end-of-file occurred while reading $fileName. Should the file be read anyway?",
GUIHelper.YES_NO_OPTIONS,
JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
return readClassFile(frame, suppressEOF = true);
return readClassFile(frame, suppressEOF = true)
} else {
throw IOException("An (expected) EOF occurred while reading $fileName")
}
@@ -89,6 +89,8 @@ class ClassFile : Structure(), AttributeContainer {
53 -> "9"
54 -> "10"
55 -> "11"
56 -> "12"
57 -> "13"
else -> "unknown value $majorVersion"
}

@@ -454,8 +456,8 @@ class ClassFile : Structure(), AttributeContainer {
}

private fun checkMajorVersion(majorVersion: Int) {
if (majorVersion < 45 || majorVersion > 55) {
warning("major version should be between 45 and 55 for JDK <= 11, was $majorVersion")
if (majorVersion < 45 || majorVersion > 57) {
warning("major version should be between 45 and 57 for JDK <= 13, was $majorVersion")
}
}

0 comments on commit 7d6d4bb

Please sign in to comment.