@@ -1068,10 +1068,11 @@ class ForFolder implements ClassFileLocator {
10681068 private final File folder ;
10691069
10701070 /**
1071- * Indicates the existing multi-release jar folders that are available for the current JVM.
1071+ * Contains the existing multi-release jar folders that are available for the
1072+ * current JVM version in decreasing order.
10721073 */
10731074 @ HashCodeAndEqualsPlugin .ValueHandling (HashCodeAndEqualsPlugin .ValueHandling .Sort .IGNORE )
1074- private final int [] multiRelease ;
1075+ private final int [] version ;
10751076
10761077 /**
10771078 * Creates a new class file locator for a folder structure of class files.
@@ -1083,21 +1084,21 @@ public ForFolder(File folder) throws IOException {
10831084 this .folder = folder ;
10841085 int current = ClassFileVersion .ofThisVm ().getJavaVersion ();
10851086 if (current < 9 ) {
1086- multiRelease = new int [0 ];
1087+ version = new int [0 ];
10871088 } else {
10881089 File manifest = new File (folder , "META-INF" + File .separatorChar + "MANIFEST.MF" );
1089- boolean mr ;
1090+ boolean multiRelease ;
10901091 if (manifest .exists ()) {
10911092 InputStream inputStream = new FileInputStream (manifest );
10921093 try {
1093- mr = Boolean .parseBoolean (new Manifest (inputStream ).getMainAttributes ().getValue ("Multi-Release" ));
1094+ multiRelease = Boolean .parseBoolean (new Manifest (inputStream ).getMainAttributes ().getValue ("Multi-Release" ));
10941095 } finally {
10951096 inputStream .close ();
10961097 }
10971098 } else {
1098- mr = false ;
1099+ multiRelease = false ;
10991100 }
1100- if (mr ) {
1101+ if (multiRelease ) {
11011102 File [] file = new File (folder , "META-INF" + File .separatorChar + "versions" ).listFiles ();
11021103 if (file != null ) {
11031104 SortedSet <Integer > versions = new TreeSet <Integer >();
@@ -1111,16 +1112,16 @@ public ForFolder(File folder) throws IOException {
11111112 /* do nothing */
11121113 }
11131114 }
1114- multiRelease = new int [versions .size ()];
1115+ version = new int [versions .size ()];
11151116 Iterator <Integer > iterator = versions .iterator ();
11161117 for (int index = 0 ; index < versions .size (); index ++) {
1117- multiRelease [versions .size () - index - 1 ] = iterator .next ();
1118+ version [versions .size () - index - 1 ] = iterator .next ();
11181119 }
11191120 } else {
1120- multiRelease = new int [0 ];
1121+ version = new int [0 ];
11211122 }
11221123 } else {
1123- multiRelease = new int [0 ];
1124+ version = new int [0 ];
11241125 }
11251126 }
11261127 }
@@ -1130,10 +1131,10 @@ public ForFolder(File folder) throws IOException {
11301131 */
11311132 public Resolution locate (String name ) throws IOException {
11321133 String path = name .replace ('.' , File .separatorChar ) + CLASS_FILE_EXTENSION ;
1133- for (int index = 0 ; index < multiRelease .length + 1 ; index ++) {
1134- File file = new File (folder , index == multiRelease .length ? path : "META-INF"
1134+ for (int index = 0 ; index < version .length + 1 ; index ++) {
1135+ File file = new File (folder , index == version .length ? path : "META-INF"
11351136 + File .separatorChar + "versions"
1136- + File .separatorChar + multiRelease [index ]
1137+ + File .separatorChar + version [index ]
11371138 + File .separatorChar + path );
11381139 if (file .exists ()) {
11391140 InputStream inputStream = new FileInputStream (file );
0 commit comments