Skip to content

Commit 9f37ba4

Browse files
author
Lance Andersen
committed
8288706: Unused parameter 'boolean newln' in method java.lang.VersionProps#print(boolean, boolean)
Reviewed-by: iris, alanb, rriggs
1 parent dfb24ae commit 9f37ba4

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

src/java.base/share/classes/java/lang/VersionProps.java.template

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -186,25 +186,13 @@ class VersionProps {
186186
}
187187
}
188188

189-
/**
190-
* In case you were wondering this method is called by java -version.
191-
*/
192-
public static void print(boolean err) {
193-
print(err, false);
194-
}
195189

196-
/**
197-
* This is the same as print except that it adds an extra line-feed
198-
* at the end, typically used by the -showversion in the launcher
199-
*/
200-
public static void println(boolean err) {
201-
print(err, true);
202-
}
203190

204191
/**
205192
* Print version info.
193+
* In case you were wondering this method is called by java -version.
206194
*/
207-
private static void print(boolean err, boolean newln) {
195+
private static void print(boolean err) {
208196
PrintStream ps = err ? System.err : System.out;
209197

210198
/* First line: platform version. */

src/java.base/share/native/libjli/java.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static void TranslateApplicationArgs(int jargc, const char **jargv, int *pargc,
123123
static jboolean AddApplicationOptions(int cpathc, const char **cpathv);
124124
static void SetApplicationClassPath(const char**);
125125

126-
static void PrintJavaVersion(JNIEnv *env, jboolean extraLF);
126+
static void PrintJavaVersion(JNIEnv *env);
127127
static void PrintUsage(JNIEnv* env, jboolean doXUsage);
128128
static void ShowSettings(JNIEnv* env, char *optString);
129129
static void ShowResolvedModules(JNIEnv* env);
@@ -441,7 +441,7 @@ JavaMain(void* _args)
441441
}
442442

443443
if (printVersion || showVersion) {
444-
PrintJavaVersion(env, showVersion);
444+
PrintJavaVersion(env);
445445
CHECK_EXCEPTION_LEAVE(0);
446446
if (printVersion) {
447447
LEAVE();
@@ -1804,15 +1804,15 @@ static void SetJavaLauncherProp() {
18041804
* Prints the version information from the java.version and other properties.
18051805
*/
18061806
static void
1807-
PrintJavaVersion(JNIEnv *env, jboolean extraLF)
1807+
PrintJavaVersion(JNIEnv *env)
18081808
{
18091809
jclass ver;
18101810
jmethodID print;
18111811

18121812
NULL_CHECK(ver = FindBootStrapClass(env, "java/lang/VersionProps"));
18131813
NULL_CHECK(print = (*env)->GetStaticMethodID(env,
18141814
ver,
1815-
(extraLF == JNI_TRUE) ? "println" : "print",
1815+
"print",
18161816
"(Z)V"
18171817
)
18181818
);

0 commit comments

Comments
 (0)