Skip to content

Commit 102440f

Browse files
committedMar 13, 2024
Address internal review comments from rasbold@:
- Rename HERMETIC_IMAGE to HERMETIC_IMAGE_NAME. - Change 'Executable' to 'Hermetic image' in exception message for consistency.
1 parent e01242a commit 102440f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎src/java.base/share/classes/jdk/internal/misc/JavaHome.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class JavaHome {
6363

6464
private static final String JAVA_HOME;
6565

66-
private static final String HERMETIC_IMAGE;
66+
private static final String HERMETIC_IMAGE_NAME;
6767

6868
private static final String HERMETIC_JAR_JDK_RESOURCES_HOME;
6969

@@ -84,10 +84,10 @@ public class JavaHome {
8484
isHermetic = true;
8585

8686
// JAVA_HOME is the hermetic executable JAR.
87-
HERMETIC_IMAGE = props.getProperty(
87+
HERMETIC_IMAGE_NAME = props.getProperty(
8888
"jdk.internal.misc.hermetic.executable", JAVA_HOME);
89-
if (HERMETIC_IMAGE.equals("")) {
90-
throw new IllegalStateException("Executable is not set");
89+
if (HERMETIC_IMAGE_NAME.equals("")) {
90+
throw new IllegalStateException("Hermetic image is not set");
9191
}
9292

9393
String javaHome =
@@ -104,12 +104,12 @@ public class JavaHome {
104104
// Initialize JavaHome explicitly.
105105
HermeticImageHelper.init(JAVA_HOME);
106106

107-
HERMETIC_IMAGE_FILE = new File(HERMETIC_IMAGE);
107+
HERMETIC_IMAGE_FILE = new File(HERMETIC_IMAGE_NAME);
108108
} else {
109109
isHermetic = false;
110110
jarFileSystem = null;
111111
HERMETIC_JAR_JDK_RESOURCES_HOME = "";
112-
HERMETIC_IMAGE = "";
112+
HERMETIC_IMAGE_NAME = "";
113113
HERMETIC_IMAGE_FILE = null;
114114
}
115115
}
@@ -122,7 +122,7 @@ public static String hermeticExecutable() {
122122
if (!isHermetic()) {
123123
throw new IllegalStateException("Not hermetic Java");
124124
}
125-
return HERMETIC_IMAGE;
125+
return HERMETIC_IMAGE_NAME;
126126
}
127127

128128
public static File hermeticExecutableFile() {

0 commit comments

Comments
 (0)
Please sign in to comment.