src/share/classes/com/sun/tools/javac/code/Type.java

changeset 1452
de1ec6fc93fe
parent 1436
f6f1fd261f57
child 1521
71f35e4b93a5
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Type.java	Fri Dec 14 11:16:46 2012 +0000
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Type.java	Sat Dec 15 13:54:51 2012 +0000
     1.3 @@ -302,10 +302,12 @@
     1.4       * never complete classes. Where isSameType would complete a
     1.5       * class, equals assumes that the two types are different.
     1.6       */
     1.7 +    @Override
     1.8      public boolean equals(Object t) {
     1.9          return super.equals(t);
    1.10      }
    1.11  
    1.12 +    @Override
    1.13      public int hashCode() {
    1.14          return super.hashCode();
    1.15      }
    1.16 @@ -996,34 +998,6 @@
    1.17              return "(" + argtypes + ")" + restype;
    1.18          }
    1.19  
    1.20 -        public boolean equals(Object obj) {
    1.21 -            if (this == obj)
    1.22 -                return true;
    1.23 -            if (!(obj instanceof MethodType))
    1.24 -                return false;
    1.25 -            MethodType m = (MethodType)obj;
    1.26 -            List<Type> args1 = argtypes;
    1.27 -            List<Type> args2 = m.argtypes;
    1.28 -            while (!args1.isEmpty() && !args2.isEmpty()) {
    1.29 -                if (!args1.head.equals(args2.head))
    1.30 -                    return false;
    1.31 -                args1 = args1.tail;
    1.32 -                args2 = args2.tail;
    1.33 -            }
    1.34 -            if (!args1.isEmpty() || !args2.isEmpty())
    1.35 -                return false;
    1.36 -            return restype.equals(m.restype);
    1.37 -        }
    1.38 -
    1.39 -        public int hashCode() {
    1.40 -            int h = METHOD.ordinal();
    1.41 -            for (List<Type> thisargs = this.argtypes;
    1.42 -                 thisargs.tail != null; /*inlined: thisargs.nonEmpty()*/
    1.43 -                 thisargs = thisargs.tail)
    1.44 -                h = (h << 5) + thisargs.head.hashCode();
    1.45 -            return (h << 5) + this.restype.hashCode();
    1.46 -        }
    1.47 -
    1.48          public List<Type>        getParameterTypes() { return argtypes; }
    1.49          public Type              getReturnType()     { return restype; }
    1.50          public List<Type>        getThrownTypes()    { return thrown; }

mercurial