com.sun.tools.javac.comp.DeferredAttr.AttrMode Java Examples

The following examples show how to use com.sun.tools.javac.comp.DeferredAttr.AttrMode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Resolve.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
Type checkMethod(Env<AttrContext> env,
                 Type site,
                 Symbol m,
                 ResultInfo resultInfo,
                 List<Type> argtypes,
                 List<Type> typeargtypes,
                 Warner warn) {
    MethodResolutionContext prevContext = currentResolutionContext;
    try {
        currentResolutionContext = new MethodResolutionContext();
        currentResolutionContext.attrMode = DeferredAttr.AttrMode.CHECK;
        if (env.tree.hasTag(JCTree.Tag.REFERENCE)) {
            //method/constructor references need special check class
            //to handle inference variables in 'argtypes' (might happen
            //during an unsticking round)
            currentResolutionContext.methodCheck =
                    new MethodReferenceCheck(resultInfo.checkContext.inferenceContext());
        }
        MethodResolutionPhase step = currentResolutionContext.step = env.info.pendingResolutionPhase;
        return rawInstantiate(env, site, m, resultInfo, argtypes, typeargtypes,
                step.isBoxingRequired(), step.isVarargsRequired(), warn);
    }
    finally {
        currentResolutionContext = prevContext;
    }
}
 
Example #2
Source File: ArgumentAttr.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
final public Type complete(DeferredType dt, ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
    Assert.check(dt == this);
    if (deferredAttrContext.mode == AttrMode.SPECULATIVE) {
        Type t = (resultInfo.pt == Type.recoveryType) ?
                deferredAttr.basicCompleter.complete(dt, resultInfo, deferredAttrContext) :
                overloadCheck(resultInfo, deferredAttrContext);
        speculativeTypes.put(resultInfo, t);
        return t;
    } else {
        if (!env.info.isSpeculative) {
            argumentTypeCache.remove(new UniquePos(dt.tree));
        }
        return deferredAttr.basicCompleter.complete(dt, resultInfo, deferredAttrContext);
    }
}
 
Example #3
Source File: Resolve.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
Type checkMethod(Env<AttrContext> env,
                 Type site,
                 Symbol m,
                 ResultInfo resultInfo,
                 List<Type> argtypes,
                 List<Type> typeargtypes,
                 Warner warn) {
    MethodResolutionContext prevContext = currentResolutionContext;
    try {
        currentResolutionContext = new MethodResolutionContext();
        currentResolutionContext.attrMode = DeferredAttr.AttrMode.CHECK;
        if (env.tree.hasTag(JCTree.Tag.REFERENCE)) {
            //method/constructor references need special check class
            //to handle inference variables in 'argtypes' (might happen
            //during an unsticking round)
            currentResolutionContext.methodCheck =
                    new MethodReferenceCheck(resultInfo.checkContext.inferenceContext());
        }
        MethodResolutionPhase step = currentResolutionContext.step = env.info.pendingResolutionPhase;
        return rawInstantiate(env, site, m, resultInfo, argtypes, typeargtypes,
                step.isBoxingRequired(), step.isVarargsRequired(), warn);
    }
    finally {
        currentResolutionContext = prevContext;
    }
}
 
Example #4
Source File: Resolve.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
Type checkMethod(Env<AttrContext> env,
                 Type site,
                 Symbol m,
                 ResultInfo resultInfo,
                 List<Type> argtypes,
                 List<Type> typeargtypes,
                 Warner warn) {
    MethodResolutionContext prevContext = currentResolutionContext;
    try {
        currentResolutionContext = new MethodResolutionContext();
        currentResolutionContext.attrMode = DeferredAttr.AttrMode.CHECK;
        if (env.tree.hasTag(JCTree.Tag.REFERENCE)) {
            //method/constructor references need special check class
            //to handle inference variables in 'argtypes' (might happen
            //during an unsticking round)
            currentResolutionContext.methodCheck =
                    new MethodReferenceCheck(resultInfo.checkContext.inferenceContext());
        }
        MethodResolutionPhase step = currentResolutionContext.step = env.info.pendingResolutionPhase;
        return rawInstantiate(env, site, m, resultInfo, argtypes, typeargtypes,
                step.isBoxingRequired(), step.isVarargsRequired(), warn);
    }
    finally {
        currentResolutionContext = prevContext;
    }
}
 
Example #5
Source File: ArgumentAttr.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
final public Type complete(DeferredType dt, ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
    Assert.check(dt == this);
    if (deferredAttrContext.mode == AttrMode.SPECULATIVE) {
        Type t = (resultInfo.pt == Type.recoveryType) ?
                deferredAttr.basicCompleter.complete(dt, resultInfo, deferredAttrContext) :
                overloadCheck(resultInfo, deferredAttrContext);
        speculativeTypes.put(resultInfo, t);
        return t;
    } else {
        if (!env.info.isSpeculative) {
            argumentTypeCache.remove(new UniquePos(dt.tree));
        }
        return deferredAttr.basicCompleter.complete(dt, resultInfo, deferredAttrContext);
    }
}
 
Example #6
Source File: Resolve.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
Type checkMethod(Env<AttrContext> env,
                 Type site,
                 Symbol m,
                 ResultInfo resultInfo,
                 List<Type> argtypes,
                 List<Type> typeargtypes,
                 Warner warn) {
    MethodResolutionContext prevContext = currentResolutionContext;
    try {
        currentResolutionContext = new MethodResolutionContext();
        currentResolutionContext.attrMode = DeferredAttr.AttrMode.CHECK;
        if (env.tree.hasTag(JCTree.Tag.REFERENCE)) {
            //method/constructor references need special check class
            //to handle inference variables in 'argtypes' (might happen
            //during an unsticking round)
            currentResolutionContext.methodCheck =
                    new MethodReferenceCheck(resultInfo.checkContext.inferenceContext());
        }
        MethodResolutionPhase step = currentResolutionContext.step = env.info.pendingResolutionPhase;
        return rawInstantiate(env, site, m, resultInfo, argtypes, typeargtypes,
                step.isBoxingRequired(), step.isVarargsRequired(), warn);
    }
    finally {
        currentResolutionContext = prevContext;
    }
}
 
Example #7
Source File: Resolve.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
Type checkMethod(Env<AttrContext> env,
                 Type site,
                 Symbol m,
                 ResultInfo resultInfo,
                 List<Type> argtypes,
                 List<Type> typeargtypes,
                 Warner warn) {
    MethodResolutionContext prevContext = currentResolutionContext;
    try {
        currentResolutionContext = new MethodResolutionContext();
        currentResolutionContext.attrMode = DeferredAttr.AttrMode.CHECK;
        if (env.tree.hasTag(JCTree.Tag.REFERENCE)) {
            //method/constructor references need special check class
            //to handle inference variables in 'argtypes' (might happen
            //during an unsticking round)
            currentResolutionContext.methodCheck =
                    new MethodReferenceCheck(resultInfo.checkContext.inferenceContext());
        }
        MethodResolutionPhase step = currentResolutionContext.step = env.info.pendingResolutionPhase;
        return rawInstantiate(env, site, m, resultInfo, argtypes, typeargtypes,
                step.isBoxingRequired(), step.isVarargsRequired(), warn);
    }
    finally {
        currentResolutionContext = prevContext;
    }
}
 
Example #8
Source File: Resolve.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
Type checkMethod(Env<AttrContext> env,
                 Type site,
                 Symbol m,
                 ResultInfo resultInfo,
                 List<Type> argtypes,
                 List<Type> typeargtypes,
                 Warner warn) {
    MethodResolutionContext prevContext = currentResolutionContext;
    try {
        currentResolutionContext = new MethodResolutionContext();
        currentResolutionContext.attrMode = DeferredAttr.AttrMode.CHECK;
        if (env.tree.hasTag(JCTree.Tag.REFERENCE)) {
            //method/constructor references need special check class
            //to handle inference variables in 'argtypes' (might happen
            //during an unsticking round)
            currentResolutionContext.methodCheck =
                    new MethodReferenceCheck(resultInfo.checkContext.inferenceContext());
        }
        MethodResolutionPhase step = currentResolutionContext.step = env.info.pendingResolutionPhase;
        return rawInstantiate(env, site, m, resultInfo, argtypes, typeargtypes,
                step.isBoxingRequired(), step.isVarargsRequired(), warn);
    }
    finally {
        currentResolutionContext = prevContext;
    }
}
 
Example #9
Source File: Resolve.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
Type checkMethod(Env<AttrContext> env,
                 Type site,
                 Symbol m,
                 ResultInfo resultInfo,
                 List<Type> argtypes,
                 List<Type> typeargtypes,
                 Warner warn) {
    MethodResolutionContext prevContext = currentResolutionContext;
    try {
        currentResolutionContext = new MethodResolutionContext();
        currentResolutionContext.attrMode = DeferredAttr.AttrMode.CHECK;
        if (env.tree.hasTag(JCTree.Tag.REFERENCE)) {
            //method/constructor references need special check class
            //to handle inference variables in 'argtypes' (might happen
            //during an unsticking round)
            currentResolutionContext.methodCheck =
                    new MethodReferenceCheck(resultInfo.checkContext.inferenceContext());
        }
        MethodResolutionPhase step = currentResolutionContext.step = env.info.pendingResolutionPhase;
        return rawInstantiate(env, site, m, resultInfo, argtypes, typeargtypes,
                step.isBoxingRequired(), step.isVarargsRequired(), warn);
    }
    finally {
        currentResolutionContext = prevContext;
    }
}
 
Example #10
Source File: Resolve.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
Type checkMethod(Env<AttrContext> env,
                 Type site,
                 Symbol m,
                 ResultInfo resultInfo,
                 List<Type> argtypes,
                 List<Type> typeargtypes,
                 Warner warn) {
    MethodResolutionContext prevContext = currentResolutionContext;
    try {
        currentResolutionContext = new MethodResolutionContext();
        currentResolutionContext.attrMode = (resultInfo.pt == Infer.anyPoly) ?
                AttrMode.SPECULATIVE : DeferredAttr.AttrMode.CHECK;
        if (env.tree.hasTag(JCTree.Tag.REFERENCE)) {
            //method/constructor references need special check class
            //to handle inference variables in 'argtypes' (might happen
            //during an unsticking round)
            currentResolutionContext.methodCheck =
                    new MethodReferenceCheck(resultInfo.checkContext.inferenceContext());
        }
        MethodResolutionPhase step = currentResolutionContext.step = env.info.pendingResolutionPhase;
        return rawInstantiate(env, site, m, resultInfo, argtypes, typeargtypes,
                step.isBoxingRequired(), step.isVarargsRequired(), warn);
    }
    finally {
        currentResolutionContext = prevContext;
    }
}
 
Example #11
Source File: Resolve.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
DeferredAttr.AttrMode attrMode() {
    return attrMode;
}
 
Example #12
Source File: Resolve.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
DeferredAttr.AttrMode attrMode() {
    return attrMode;
}
 
Example #13
Source File: Infer.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public ImplicitArgType(Symbol msym, Resolve.MethodResolutionPhase phase) {
    rs.deferredAttr.super(AttrMode.SPECULATIVE, msym, phase);
}
 
Example #14
Source File: Infer.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public ImplicitArgType(Symbol msym, Resolve.MethodResolutionPhase phase) {
    (rs.deferredAttr).super(AttrMode.SPECULATIVE, msym, phase);
}
 
Example #15
Source File: Resolve.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
void reportVerboseResolutionDiagnostic(DiagnosticPosition dpos, Name name, Type site,
        List<Type> argtypes, List<Type> typeargtypes, Symbol bestSoFar) {
    boolean success = bestSoFar.kind < ERRONEOUS;

    if (success && !verboseResolutionMode.contains(VerboseResolutionMode.SUCCESS)) {
        return;
    } else if (!success && !verboseResolutionMode.contains(VerboseResolutionMode.FAILURE)) {
        return;
    }

    if (bestSoFar.name == names.init &&
            bestSoFar.owner == syms.objectType.tsym &&
            !verboseResolutionMode.contains(VerboseResolutionMode.OBJECT_INIT)) {
        return; //skip diags for Object constructor resolution
    } else if (site == syms.predefClass.type &&
            !verboseResolutionMode.contains(VerboseResolutionMode.PREDEF)) {
        return; //skip spurious diags for predef symbols (i.e. operators)
    } else if (currentResolutionContext.internalResolution &&
            !verboseResolutionMode.contains(VerboseResolutionMode.INTERNAL)) {
        return;
    }

    int pos = 0;
    int mostSpecificPos = -1;
    ListBuffer<JCDiagnostic> subDiags = new ListBuffer<>();
    for (Candidate c : currentResolutionContext.candidates) {
        if (currentResolutionContext.step != c.step ||
                (c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.APPLICABLE)) ||
                (!c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.INAPPLICABLE))) {
            continue;
        } else {
            subDiags.append(c.isApplicable() ?
                    getVerboseApplicableCandidateDiag(pos, c.sym, c.mtype) :
                    getVerboseInapplicableCandidateDiag(pos, c.sym, c.details));
            if (c.sym == bestSoFar)
                mostSpecificPos = pos;
            pos++;
        }
    }
    String key = success ? "verbose.resolve.multi" : "verbose.resolve.multi.1";
    List<Type> argtypes2 = Type.map(argtypes,
                deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, bestSoFar, currentResolutionContext.step));
    JCDiagnostic main = diags.note(log.currentSource(), dpos, key, name,
            site.tsym, mostSpecificPos, currentResolutionContext.step,
            methodArguments(argtypes2),
            methodArguments(typeargtypes));
    JCDiagnostic d = new JCDiagnostic.MultilineDiagnostic(main, subDiags.toList());
    log.report(d);
}
 
Example #16
Source File: Resolve.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
void reportVerboseResolutionDiagnostic(DiagnosticPosition dpos, Name name, Type site,
        List<Type> argtypes, List<Type> typeargtypes, Symbol bestSoFar) {
    boolean success = bestSoFar.kind < ERRONEOUS;

    if (success && !verboseResolutionMode.contains(VerboseResolutionMode.SUCCESS)) {
        return;
    } else if (!success && !verboseResolutionMode.contains(VerboseResolutionMode.FAILURE)) {
        return;
    }

    if (bestSoFar.name == names.init &&
            bestSoFar.owner == syms.objectType.tsym &&
            !verboseResolutionMode.contains(VerboseResolutionMode.OBJECT_INIT)) {
        return; //skip diags for Object constructor resolution
    } else if (site == syms.predefClass.type &&
            !verboseResolutionMode.contains(VerboseResolutionMode.PREDEF)) {
        return; //skip spurious diags for predef symbols (i.e. operators)
    } else if (currentResolutionContext.internalResolution &&
            !verboseResolutionMode.contains(VerboseResolutionMode.INTERNAL)) {
        return;
    }

    int pos = 0;
    int mostSpecificPos = -1;
    ListBuffer<JCDiagnostic> subDiags = new ListBuffer<>();
    for (Candidate c : currentResolutionContext.candidates) {
        if (currentResolutionContext.step != c.step ||
                (c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.APPLICABLE)) ||
                (!c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.INAPPLICABLE))) {
            continue;
        } else {
            subDiags.append(c.isApplicable() ?
                    getVerboseApplicableCandidateDiag(pos, c.sym, c.mtype) :
                    getVerboseInapplicableCandidateDiag(pos, c.sym, c.details));
            if (c.sym == bestSoFar)
                mostSpecificPos = pos;
            pos++;
        }
    }
    String key = success ? "verbose.resolve.multi" : "verbose.resolve.multi.1";
    List<Type> argtypes2 = Type.map(argtypes,
                deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, bestSoFar, currentResolutionContext.step));
    JCDiagnostic main = diags.note(log.currentSource(), dpos, key, name,
            site.tsym, mostSpecificPos, currentResolutionContext.step,
            methodArguments(argtypes2),
            methodArguments(typeargtypes));
    JCDiagnostic d = new JCDiagnostic.MultilineDiagnostic(main, subDiags.toList());
    log.report(d);
}
 
Example #17
Source File: Resolve.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
DeferredAttr.AttrMode attrMode() {
    return attrMode;
}
 
Example #18
Source File: Resolve.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public ResolveDeferredRecoveryMap(AttrMode mode, Symbol msym, MethodResolutionPhase step) {
    deferredAttr.super(mode, msym, step);
}
 
Example #19
Source File: Resolve.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
void reportVerboseResolutionDiagnostic(DiagnosticPosition dpos, Name name, Type site,
        List<Type> argtypes, List<Type> typeargtypes, Symbol bestSoFar) {
    boolean success = bestSoFar.kind < ERRONEOUS;

    if (success && !verboseResolutionMode.contains(VerboseResolutionMode.SUCCESS)) {
        return;
    } else if (!success && !verboseResolutionMode.contains(VerboseResolutionMode.FAILURE)) {
        return;
    }

    if (bestSoFar.name == names.init &&
            bestSoFar.owner == syms.objectType.tsym &&
            !verboseResolutionMode.contains(VerboseResolutionMode.OBJECT_INIT)) {
        return; //skip diags for Object constructor resolution
    } else if (site == syms.predefClass.type &&
            !verboseResolutionMode.contains(VerboseResolutionMode.PREDEF)) {
        return; //skip spurious diags for predef symbols (i.e. operators)
    } else if (currentResolutionContext.internalResolution &&
            !verboseResolutionMode.contains(VerboseResolutionMode.INTERNAL)) {
        return;
    }

    int pos = 0;
    int mostSpecificPos = -1;
    ListBuffer<JCDiagnostic> subDiags = new ListBuffer<>();
    for (Candidate c : currentResolutionContext.candidates) {
        if (currentResolutionContext.step != c.step ||
                (c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.APPLICABLE)) ||
                (!c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.INAPPLICABLE))) {
            continue;
        } else {
            subDiags.append(c.isApplicable() ?
                    getVerboseApplicableCandidateDiag(pos, c.sym, c.mtype) :
                    getVerboseInapplicableCandidateDiag(pos, c.sym, c.details));
            if (c.sym == bestSoFar)
                mostSpecificPos = pos;
            pos++;
        }
    }
    String key = success ? "verbose.resolve.multi" : "verbose.resolve.multi.1";
    List<Type> argtypes2 = Type.map(argtypes,
                deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, bestSoFar, currentResolutionContext.step));
    JCDiagnostic main = diags.note(log.currentSource(), dpos, key, name,
            site.tsym, mostSpecificPos, currentResolutionContext.step,
            methodArguments(argtypes2),
            methodArguments(typeargtypes));
    JCDiagnostic d = new JCDiagnostic.MultilineDiagnostic(main, subDiags.toList());
    log.report(d);
}
 
Example #20
Source File: Resolve.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public ResolveDeferredRecoveryMap(AttrMode mode, Symbol msym, MethodResolutionPhase step) {
    deferredAttr.super(mode, msym, step);
}
 
Example #21
Source File: Infer.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public ImplicitArgType(Symbol msym, Resolve.MethodResolutionPhase phase) {
    (rs.deferredAttr).super(AttrMode.SPECULATIVE, msym, phase);
}
 
Example #22
Source File: Resolve.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
void reportVerboseResolutionDiagnostic(DiagnosticPosition dpos, Name name, Type site,
        List<Type> argtypes, List<Type> typeargtypes, Symbol bestSoFar) {
    boolean success = bestSoFar.kind < ERRONEOUS;

    if (success && !verboseResolutionMode.contains(VerboseResolutionMode.SUCCESS)) {
        return;
    } else if (!success && !verboseResolutionMode.contains(VerboseResolutionMode.FAILURE)) {
        return;
    }

    if (bestSoFar.name == names.init &&
            bestSoFar.owner == syms.objectType.tsym &&
            !verboseResolutionMode.contains(VerboseResolutionMode.OBJECT_INIT)) {
        return; //skip diags for Object constructor resolution
    } else if (site == syms.predefClass.type &&
            !verboseResolutionMode.contains(VerboseResolutionMode.PREDEF)) {
        return; //skip spurious diags for predef symbols (i.e. operators)
    } else if (currentResolutionContext.internalResolution &&
            !verboseResolutionMode.contains(VerboseResolutionMode.INTERNAL)) {
        return;
    }

    int pos = 0;
    int mostSpecificPos = -1;
    ListBuffer<JCDiagnostic> subDiags = new ListBuffer<>();
    for (Candidate c : currentResolutionContext.candidates) {
        if (currentResolutionContext.step != c.step ||
                (c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.APPLICABLE)) ||
                (!c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.INAPPLICABLE))) {
            continue;
        } else {
            subDiags.append(c.isApplicable() ?
                    getVerboseApplicableCandidateDiag(pos, c.sym, c.mtype) :
                    getVerboseInapplicableCandidateDiag(pos, c.sym, c.details));
            if (c.sym == bestSoFar)
                mostSpecificPos = pos;
            pos++;
        }
    }
    String key = success ? "verbose.resolve.multi" : "verbose.resolve.multi.1";
    List<Type> argtypes2 = Type.map(argtypes,
                deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, bestSoFar, currentResolutionContext.step));
    JCDiagnostic main = diags.note(log.currentSource(), dpos, key, name,
            site.tsym, mostSpecificPos, currentResolutionContext.step,
            methodArguments(argtypes2),
            methodArguments(typeargtypes));
    JCDiagnostic d = new JCDiagnostic.MultilineDiagnostic(main, subDiags.toList());
    log.report(d);
}
 
Example #23
Source File: Resolve.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public ResolveDeferredRecoveryMap(AttrMode mode, Symbol msym, MethodResolutionPhase step) {
    deferredAttr.super(mode, msym, step);
}
 
Example #24
Source File: Resolve.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
DeferredAttr.AttrMode attrMode() {
    return attrMode;
}
 
Example #25
Source File: Infer.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public ImplicitArgType(Symbol msym, Resolve.MethodResolutionPhase phase) {
    rs.deferredAttr.super(AttrMode.SPECULATIVE, msym, phase);
}
 
Example #26
Source File: Resolve.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public ResolveDeferredRecoveryMap(AttrMode mode, Symbol msym, MethodResolutionPhase step) {
    deferredAttr.super(mode, msym, step);
}
 
Example #27
Source File: Resolve.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public ResolveDeferredRecoveryMap(AttrMode mode, Symbol msym, MethodResolutionPhase step) {
    deferredAttr.super(mode, msym, step);
}
 
Example #28
Source File: Resolve.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
DeferredAttr.AttrMode attrMode() {
    return attrMode;
}
 
Example #29
Source File: Infer.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public ImplicitArgType(Symbol msym, Resolve.MethodResolutionPhase phase) {
    (rs.deferredAttr).super(AttrMode.SPECULATIVE, msym, phase);
}
 
Example #30
Source File: Resolve.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
void reportVerboseResolutionDiagnostic(DiagnosticPosition dpos, Name name, Type site,
        List<Type> argtypes, List<Type> typeargtypes, Symbol bestSoFar) {
    boolean success = bestSoFar.kind < ERRONEOUS;

    if (success && !verboseResolutionMode.contains(VerboseResolutionMode.SUCCESS)) {
        return;
    } else if (!success && !verboseResolutionMode.contains(VerboseResolutionMode.FAILURE)) {
        return;
    }

    if (bestSoFar.name == names.init &&
            bestSoFar.owner == syms.objectType.tsym &&
            !verboseResolutionMode.contains(VerboseResolutionMode.OBJECT_INIT)) {
        return; //skip diags for Object constructor resolution
    } else if (site == syms.predefClass.type &&
            !verboseResolutionMode.contains(VerboseResolutionMode.PREDEF)) {
        return; //skip spurious diags for predef symbols (i.e. operators)
    } else if (currentResolutionContext.internalResolution &&
            !verboseResolutionMode.contains(VerboseResolutionMode.INTERNAL)) {
        return;
    }

    int pos = 0;
    int mostSpecificPos = -1;
    ListBuffer<JCDiagnostic> subDiags = new ListBuffer<>();
    for (Candidate c : currentResolutionContext.candidates) {
        if (currentResolutionContext.step != c.step ||
                (c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.APPLICABLE)) ||
                (!c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.INAPPLICABLE))) {
            continue;
        } else {
            subDiags.append(c.isApplicable() ?
                    getVerboseApplicableCandidateDiag(pos, c.sym, c.mtype) :
                    getVerboseInapplicableCandidateDiag(pos, c.sym, c.details));
            if (c.sym == bestSoFar)
                mostSpecificPos = pos;
            pos++;
        }
    }
    String key = success ? "verbose.resolve.multi" : "verbose.resolve.multi.1";
    List<Type> argtypes2 = Type.map(argtypes,
                deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, bestSoFar, currentResolutionContext.step));
    JCDiagnostic main = diags.note(log.currentSource(), dpos, key, name,
            site.tsym, mostSpecificPos, currentResolutionContext.step,
            methodArguments(argtypes2),
            methodArguments(typeargtypes));
    JCDiagnostic d = new JCDiagnostic.MultilineDiagnostic(main, subDiags.toList());
    log.report(d);
}