-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b16
-
Not verified
FULL PRODUCT VERSION :
java version "9"
Java(TM) SE Runtime Environment (build 9+175)
Java HotSpot(TM) 64-Bit Server VM (build 9+175, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
macOS 10.12.5
but this bug isn't OS-related.
A DESCRIPTION OF THE PROBLEM :
XMLInputFactory.newFactory() has a @Deprecated(since="1.7") annotation.
This is wrong for two reasons:
- newFactory() is the non-deprecated replacement for the deprecated newInstance() method of the same class.
- newFactory() wasn't deprecated in either 1.7 or 1.8.
REGRESSION. Last worked in version 8u152
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile a piece of code containing a call to
XMLInputFactory.newFactory()
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No deprecation warning is generated.
ACTUAL -
The following warning is generated:
warning: [deprecation] newFactory() in XMLInputFactory has been deprecated
ERROR MESSAGES/STACK TRACES THAT OCCUR :
warning: [deprecation] newFactory() in XMLInputFactory has been deprecated
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Foo {
public static void main(String[] args) {
javax.xml.stream.XMLInputFactory.newFactory();
}
}
/*
$ javac -Xlint:deprecation Foo.java
Foo.java:3: warning: [deprecation] newFactory() in XMLInputFactory has been deprecated
javax.xml.stream.XMLInputFactory.newFactory();
^
1 warning
*/
---------- END SOURCE ----------
java version "9"
Java(TM) SE Runtime Environment (build 9+175)
Java HotSpot(TM) 64-Bit Server VM (build 9+175, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
macOS 10.12.5
but this bug isn't OS-related.
A DESCRIPTION OF THE PROBLEM :
XMLInputFactory.newFactory() has a @Deprecated(since="1.7") annotation.
This is wrong for two reasons:
- newFactory() is the non-deprecated replacement for the deprecated newInstance() method of the same class.
- newFactory() wasn't deprecated in either 1.7 or 1.8.
REGRESSION. Last worked in version 8u152
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile a piece of code containing a call to
XMLInputFactory.newFactory()
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No deprecation warning is generated.
ACTUAL -
The following warning is generated:
warning: [deprecation] newFactory() in XMLInputFactory has been deprecated
ERROR MESSAGES/STACK TRACES THAT OCCUR :
warning: [deprecation] newFactory() in XMLInputFactory has been deprecated
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Foo {
public static void main(String[] args) {
javax.xml.stream.XMLInputFactory.newFactory();
}
}
/*
$ javac -Xlint:deprecation Foo.java
Foo.java:3: warning: [deprecation] newFactory() in XMLInputFactory has been deprecated
javax.xml.stream.XMLInputFactory.newFactory();
^
1 warning
*/
---------- END SOURCE ----------
- csr for
-
JDK-8183894 XMLInputFactory.newFactory() is marked as deprecated
- Closed
There are no Sub-Tasks for this issue.