langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java
changeset 22163 3651128c74eb
parent 20252 fae5c47ba7a4
child 23810 b92eb80925f0
equal deleted inserted replaced
22162:3b3e23e67329 22163:3651128c74eb
   244                                               TypeMirror... typeArgs) {
   244                                               TypeMirror... typeArgs) {
   245             if (typeArgs.length != sym.type.getTypeArguments().length())
   245             if (typeArgs.length != sym.type.getTypeArguments().length())
   246                 throw new IllegalArgumentException(
   246                 throw new IllegalArgumentException(
   247                 "Incorrect number of type arguments");
   247                 "Incorrect number of type arguments");
   248 
   248 
   249             ListBuffer<Type> targs = new ListBuffer<Type>();
   249             ListBuffer<Type> targs = new ListBuffer<>();
   250             for (TypeMirror t : typeArgs) {
   250             for (TypeMirror t : typeArgs) {
   251                 if (!(t instanceof ReferenceType || t instanceof WildcardType))
   251                 if (!(t instanceof ReferenceType || t instanceof WildcardType))
   252                     throw new IllegalArgumentException(t.toString());
   252                     throw new IllegalArgumentException(t.toString());
   253                 targs.append((Type) t);
   253                 targs.append((Type) t);
   254             }
   254             }
   312             throw new IllegalArgumentException();
   312             throw new IllegalArgumentException();
   313 
   313 
   314         MethodSymbol m = (MethodSymbol) elem;
   314         MethodSymbol m = (MethodSymbol) elem;
   315         ClassSymbol origin = (ClassSymbol) m.owner;
   315         ClassSymbol origin = (ClassSymbol) m.owner;
   316 
   316 
   317         Set<MethodSymbol> results = new LinkedHashSet<MethodSymbol>();
   317         Set<MethodSymbol> results = new LinkedHashSet<>();
   318         for (Type t : types.closure(origin.type)) {
   318         for (Type t : types.closure(origin.type)) {
   319             if (t != origin.type) {
   319             if (t != origin.type) {
   320                 ClassSymbol c = (ClassSymbol) t.tsym;
   320                 ClassSymbol c = (ClassSymbol) t.tsym;
   321                 for (Scope.Entry e = c.members().lookup(m.name); e.scope != null; e = e.next()) {
   321                 for (Scope.Entry e = c.members().lookup(m.name); e.scope != null; e = e.next()) {
   322                     if (e.sym.kind == Kinds.MTH && m.overrides(e.sym, origin, types, true)) {
   322                     if (e.sym.kind == Kinds.MTH && m.overrides(e.sym, origin, types, true)) {