-
Bug
-
Resolution: Unresolved
-
P4
-
8, 10, 11
-
x86_64
-
linux
ADDITIONAL SYSTEM INFORMATION :
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Accordingly to Javadoc (https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getResource-java.lang.String-) Class.getResource method returns "A URL object or null if no resource with this name is found". However, a different result is returned when executing the following program.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile the program
2. Run it using Oracle HotSpot java
ACTUAL -
file:.../target/classes/
---------- BEGIN SOURCE ----------
public enum A {
X, Y
}
public class B {
public static void main(String[] args) {
System.out.println(A[].class.getResource(""));
}
}
---------- END SOURCE ----------
FREQUENCY : always
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Accordingly to Javadoc (https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getResource-java.lang.String-) Class.getResource method returns "A URL object or null if no resource with this name is found". However, a different result is returned when executing the following program.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile the program
2. Run it using Oracle HotSpot java
ACTUAL -
file:.../target/classes/
---------- BEGIN SOURCE ----------
public enum A {
X, Y
}
public class B {
public static void main(String[] args) {
System.out.println(A[].class.getResource(""));
}
}
---------- END SOURCE ----------
FREQUENCY : always
- relates to
-
JDK-8298944 Classloader.getResource("") find resource when MR JAR on class path
-
- Open
-