langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java
changeset 19917 ebb957ba7b07
parent 19914 d86271bd430a
child 19940 d6d6e623f0b4
equal deleted inserted replaced
19916:5b5f188dbdd4 19917:ebb957ba7b07
  2544                                 phase.isVarargsRequired());
  2544                                 phase.isVarargsRequired());
  2545                     }
  2545                     }
  2546                     @Override
  2546                     @Override
  2547                     Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
  2547                     Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
  2548                         if (sym.kind >= AMBIGUOUS) {
  2548                         if (sym.kind >= AMBIGUOUS) {
  2549                             final JCDiagnostic details = sym.kind == WRONG_MTH ?
  2549                             if (sym.kind == HIDDEN) {
  2550                                             ((InapplicableSymbolError)sym).errCandidate().snd :
  2550                                 sym = super.access(env, pos, location, sym);
  2551                                             null;
  2551                             } else {
  2552                             sym = new InapplicableSymbolError(sym.kind, "diamondError", currentResolutionContext) {
  2552                                 final JCDiagnostic details = sym.kind == WRONG_MTH ?
  2553                                 @Override
  2553                                                 ((InapplicableSymbolError)sym).errCandidate().snd :
  2554                                 JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos,
  2554                                                 null;
  2555                                         Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) {
  2555                                 sym = new InapplicableSymbolError(sym.kind, "diamondError", currentResolutionContext) {
  2556                                     String key = details == null ?
  2556                                     @Override
  2557                                         "cant.apply.diamond" :
  2557                                     JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos,
  2558                                         "cant.apply.diamond.1";
  2558                                             Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) {
  2559                                     return diags.create(dkind, log.currentSource(), pos, key,
  2559                                         String key = details == null ?
  2560                                             diags.fragment("diamond", site.tsym), details);
  2560                                             "cant.apply.diamond" :
  2561                                 }
  2561                                             "cant.apply.diamond.1";
  2562                             };
  2562                                         return diags.create(dkind, log.currentSource(), pos, key,
  2563                             sym = accessMethod(sym, pos, site, names.init, true, argtypes, typeargtypes);
  2563                                                 diags.fragment("diamond", site.tsym), details);
  2564                             env.info.pendingResolutionPhase = currentResolutionContext.step;
  2564                                     }
       
  2565                                 };
       
  2566                                 sym = accessMethod(sym, pos, site, names.init, true, argtypes, typeargtypes);
       
  2567                                 env.info.pendingResolutionPhase = currentResolutionContext.step;
       
  2568                             }
  2565                         }
  2569                         }
  2566                         return sym;
  2570                         return sym;
  2567                     }});
  2571                     }});
  2568     }
  2572     }
  2569 
  2573