src/share/classes/com/sun/tools/javac/comp/Resolve.java

changeset 2047
5f915a0c9615
parent 2026
03c26c60499c
child 2117
70a301b35e71
equal deleted inserted replaced
2046:1fe358ea75ff 2047:5f915a0c9615
211 return; 211 return;
212 } 212 }
213 213
214 int pos = 0; 214 int pos = 0;
215 int mostSpecificPos = -1; 215 int mostSpecificPos = -1;
216 ListBuffer<JCDiagnostic> subDiags = ListBuffer.lb(); 216 ListBuffer<JCDiagnostic> subDiags = new ListBuffer<>();
217 for (Candidate c : currentResolutionContext.candidates) { 217 for (Candidate c : currentResolutionContext.candidates) {
218 if (currentResolutionContext.step != c.step || 218 if (currentResolutionContext.step != c.step ||
219 (c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.APPLICABLE)) || 219 (c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.APPLICABLE)) ||
220 (!c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.INAPPLICABLE))) { 220 (!c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.INAPPLICABLE))) {
221 continue; 221 continue;
781 //do nothing - actual always compatible to formals 781 //do nothing - actual always compatible to formals
782 } 782 }
783 }; 783 };
784 784
785 List<Type> dummyArgs(int length) { 785 List<Type> dummyArgs(int length) {
786 ListBuffer<Type> buf = ListBuffer.lb(); 786 ListBuffer<Type> buf = new ListBuffer<>();
787 for (int i = 0 ; i < length ; i++) { 787 for (int i = 0 ; i < length ; i++) {
788 buf.append(Type.noType); 788 buf.append(Type.noType);
789 } 789 }
790 return buf.toList(); 790 return buf.toList();
791 } 791 }
3171 log.error(pos, "not.encl.class", c); 3171 log.error(pos, "not.encl.class", c);
3172 return syms.errSymbol; 3172 return syms.errSymbol;
3173 } 3173 }
3174 //where 3174 //where
3175 private List<Type> pruneInterfaces(Type t) { 3175 private List<Type> pruneInterfaces(Type t) {
3176 ListBuffer<Type> result = ListBuffer.lb(); 3176 ListBuffer<Type> result = new ListBuffer<>();
3177 for (Type t1 : types.interfaces(t)) { 3177 for (Type t1 : types.interfaces(t)) {
3178 boolean shouldAdd = true; 3178 boolean shouldAdd = true;
3179 for (Type t2 : types.interfaces(t)) { 3179 for (Type t2 : types.interfaces(t)) {
3180 if (t1 != t2 && types.isSubtypeNoCapture(t2, t1)) { 3180 if (t1 != t2 && types.isSubtypeNoCapture(t2, t1)) {
3181 shouldAdd = false; 3181 shouldAdd = false;
3284 3284
3285 public Object methodArguments(List<Type> argtypes) { 3285 public Object methodArguments(List<Type> argtypes) {
3286 if (argtypes == null || argtypes.isEmpty()) { 3286 if (argtypes == null || argtypes.isEmpty()) {
3287 return noArgs; 3287 return noArgs;
3288 } else { 3288 } else {
3289 ListBuffer<Object> diagArgs = ListBuffer.lb(); 3289 ListBuffer<Object> diagArgs = new ListBuffer<>();
3290 for (Type t : argtypes) { 3290 for (Type t : argtypes) {
3291 if (t.hasTag(DEFERRED)) { 3291 if (t.hasTag(DEFERRED)) {
3292 diagArgs.append(((DeferredAttr.DeferredType)t).tree); 3292 diagArgs.append(((DeferredAttr.DeferredType)t).tree);
3293 } else { 3293 } else {
3294 diagArgs.append(t); 3294 diagArgs.append(t);

mercurial