United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8013900 More warnings compiling jaxp
JDK-8013900 : More warnings compiling jaxp

Details
Type:
Bug
Submit Date:
2013-05-04
Status:
Resolved
Updated Date:
2013-12-16
Project Name:
JDK
Resolved Date:
2013-05-17
Component:
xml
OS:
Sub-Component:
jaxp
CPU:
Priority:
P4
Resolution:
Fixed
Affected Versions:
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
With an up to date jdk8/tl we are seeing more warnings in jaxp:

## Starting jaxp
Compiling 1881 files for BUILD_JAXP
Updating jaxp/dist/lib/src.zip
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java:60: warning: [overrides] Class URI overrides equals, but neither it nor any superclass overrides hashCode method
 public class URI implements Serializable {
        ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xpath/internal/Arg.java:34: warning: [overrides] Class Arg overrides equals, but neither it nor any superclass overrides hashCode method
public class Arg
       ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/bcel/internal/generic/BasicType.java:67: warning: [overrides] Class BasicType overrides equals, but neither it nor any superclass overrides hashCode method
public final class BasicType extends Type {
             ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/bcel/internal/generic/LocalVariableGen.java:74: warning: [overrides] Class LocalVariableGen overrides equals, but neither it nor any superclass overrides hashCode method
public class LocalVariableGen
       ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/bcel/internal/generic/ReturnaddressType.java:69: warning: [overrides] Class ReturnaddressType overrides equals, but neither it nor any superclass overrides hashCode method
public class ReturnaddressType extends Type {
       ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xml/internal/utils/URI.java:62: warning: [overrides] Class URI overrides equals, but neither it nor any superclass overrides hashCode method
public class URI implements Serializable
       ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java:64: warning: [overrides] Class DTMNodeProxy overrides equals, but neither it nor any superclass overrides hashCode method
public class DTMNodeProxy
       ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/URI.java:67: warning: [overrides] Class URI overrides equals, but neither it nor any superclass overrides hashCode method
final class URI
      ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java:2617: warning: [overrides] Class Notation overrides equals, but neither it nor any superclass overrides hashCode method
    protected static class Notation {
                     ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java:2662: warning: [overrides] Class UnparsedEntity overrides equals, but neither it nor any superclass overrides hashCode method
    protected static class UnparsedEntity {
                     ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java:915: warning: [overrides] Class DateTimeData overrides equals, but neither it nor any superclass overrides hashCode method
        static final class DateTimeData implements XSDateTime {
                     ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/PrecisionDecimalDV.java:35: warning: [overrides] Class XPrecisionDecimal overrides equals, but neither it nor any superclass overrides hashCode method
    static class XPrecisionDecimal {
           ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DecimalDV.java:66: warning: [overrides] Class XDecimal overrides equals, but neither it nor any superclass overrides hashCode method
    static class XDecimal implements XSDecimal {
           ^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/VariableRefBase.java:33: warning: [overrides] Class VariableRefBase overrides equals, but neither it nor any superclass overrides hashCode method
class VariableRefBase extends Expression {
^
/u/alanb/ws/tl/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java:151: warning: [overrides] Class JavaType overrides equals, but neither it nor any superclass overrides hashCode method
    static class JavaType {
           ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
15 warnings
Creating jaxp/dist/lib/classes.jar
## Finished jaxp (build time 00:00:23)

                                    

Comments
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/68209420aac2
User:  dfuchs
Date:  2013-05-17 10:22:28 +0000

                                     
2013-05-17
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jaxp/rev/6443f5627744
User:  lana
Date:  2013-05-21 17:57:38 +0000

                                     
2013-05-21
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/68209420aac2
User:  lana
Date:  2013-05-21 18:20:30 +0000

                                     
2013-05-21
Some internal implementation classes in Jaxp were redefining equals() without redefining hashCode(). 
This patch adds hashCode() methods that are consistent with equals - that is: 
      if (o1.equals(o2) == true) then o1.hashCode() == o2.hashCode().
It also fixes an issue in LocalVariableGen (uncovered by the changes in hashCode) where equals/hashCode are based on mutable fields - which requires to take special precaution when mutating these fields.

http://cr.openjdk.java.net/~dfuchs/JDK-8013900/webrev.01/
                                     
2013-05-16
URL:   http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/6443f5627744
User:  dfuchs
Date:  2013-05-17 10:21:59 +0000

                                     
2013-05-17



Hardware and Software, Engineered to Work Together