com.sun.tools.javac.comp.Resolve.MethodResolutionContext.Candidate Java Examples

The following examples show how to use com.sun.tools.javac.comp.Resolve.MethodResolutionContext.Candidate. 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 openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected Pair<Symbol, JCDiagnostic> errCandidate() {
    Candidate bestSoFar = null;
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        bestSoFar = c;
    }
    Assert.checkNonNull(bestSoFar);
    return new Pair<>(bestSoFar.sym, bestSoFar.details);
}
 
Example #2
Source File: Resolve.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private Map<Symbol, JCDiagnostic> mapCandidates() {
    Map<Symbol, JCDiagnostic> candidates = new LinkedHashMap<Symbol, JCDiagnostic>();
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        candidates.put(c.sym, c.details);
    }
    return candidates;
}
 
Example #3
Source File: Resolve.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected Pair<Symbol, JCDiagnostic> errCandidate() {
    Candidate bestSoFar = null;
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        bestSoFar = c;
    }
    Assert.checkNonNull(bestSoFar);
    return new Pair<Symbol, JCDiagnostic>(bestSoFar.sym, bestSoFar.details);
}
 
Example #4
Source File: Resolve.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (o instanceof Candidate) {
        Symbol s1 = this.sym;
        Symbol s2 = ((Candidate)o).sym;
        if  ((s1 != s2 &&
                (s1.overrides(s2, s1.owner.type.tsym, types, false) ||
                (s2.overrides(s1, s2.owner.type.tsym, types, false)))) ||
                ((s1.isConstructor() || s2.isConstructor()) && s1.owner != s2.owner))
            return true;
    }
    return false;
}
 
Example #5
Source File: Resolve.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected Pair<Symbol, JCDiagnostic> errCandidate() {
    Candidate bestSoFar = null;
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        bestSoFar = c;
    }
    Assert.checkNonNull(bestSoFar);
    return new Pair<Symbol, JCDiagnostic>(bestSoFar.sym, bestSoFar.details);
}
 
Example #6
Source File: Resolve.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
boolean hasAnotherApplicableMethod(MethodResolutionContext resolutionContext,
        Symbol bestSoFar, boolean staticMth) {
    for (Candidate c : resolutionContext.candidates) {
        if (resolutionContext.step != c.step ||
            !c.isApplicable() ||
            c.sym == bestSoFar) {
            continue;
        } else {
            if (c.sym.isStatic() == staticMth) {
                return true;
            }
        }
    }
    return false;
}
 
Example #7
Source File: Resolve.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (o instanceof Candidate) {
        Symbol s1 = this.sym;
        Symbol s2 = ((Candidate)o).sym;
        if  ((s1 != s2 &&
                (s1.overrides(s2, s1.owner.type.tsym, types, false) ||
                (s2.overrides(s1, s2.owner.type.tsym, types, false)))) ||
                ((s1.isConstructor() || s2.isConstructor()) && s1.owner != s2.owner))
            return true;
    }
    return false;
}
 
Example #8
Source File: Resolve.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private Map<Symbol, JCDiagnostic> mapCandidates() {
    Map<Symbol, JCDiagnostic> candidates = new LinkedHashMap<Symbol, JCDiagnostic>();
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        candidates.put(c.sym, c.details);
    }
    return candidates;
}
 
Example #9
Source File: Resolve.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected Pair<Symbol, JCDiagnostic> errCandidate() {
    Candidate bestSoFar = null;
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        bestSoFar = c;
    }
    Assert.checkNonNull(bestSoFar);
    return new Pair<Symbol, JCDiagnostic>(bestSoFar.sym, bestSoFar.details);
}
 
Example #10
Source File: Resolve.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
boolean hasAnotherApplicableMethod(MethodResolutionContext resolutionContext,
        Symbol bestSoFar, boolean staticMth) {
    for (Candidate c : resolutionContext.candidates) {
        if (resolutionContext.step != c.step ||
            !c.isApplicable() ||
            c.sym == bestSoFar) {
            continue;
        } else {
            if (c.sym.isStatic() == staticMth) {
                return true;
            }
        }
    }
    return false;
}
 
Example #11
Source File: Resolve.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private Map<Symbol, JCDiagnostic> mapCandidates() {
    Map<Symbol, JCDiagnostic> candidates = new LinkedHashMap<Symbol, JCDiagnostic>();
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        candidates.put(c.sym, c.details);
    }
    return candidates;
}
 
Example #12
Source File: Resolve.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (o instanceof Candidate) {
        Symbol s1 = this.sym;
        Symbol s2 = ((Candidate)o).sym;
        if  ((s1 != s2 &&
                (s1.overrides(s2, s1.owner.type.tsym, types, false) ||
                (s2.overrides(s1, s2.owner.type.tsym, types, false)))) ||
                ((s1.isConstructor() || s2.isConstructor()) && s1.owner != s2.owner))
            return true;
    }
    return false;
}
 
Example #13
Source File: Resolve.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
boolean hasAnotherApplicableMethod(MethodResolutionContext resolutionContext,
        Symbol bestSoFar, boolean staticMth) {
    for (Candidate c : resolutionContext.candidates) {
        if (resolutionContext.step != c.step ||
            !c.isApplicable() ||
            c.sym == bestSoFar) {
            continue;
        } else {
            if (c.sym.isStatic() == staticMth) {
                return true;
            }
        }
    }
    return false;
}
 
Example #14
Source File: Resolve.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected Pair<Symbol, JCDiagnostic> errCandidate() {
    Candidate bestSoFar = null;
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        bestSoFar = c;
    }
    Assert.checkNonNull(bestSoFar);
    return new Pair<Symbol, JCDiagnostic>(bestSoFar.sym, bestSoFar.details);
}
 
Example #15
Source File: Resolve.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private Map<Symbol, JCDiagnostic> mapCandidates() {
    Map<Symbol, JCDiagnostic> candidates = new LinkedHashMap<Symbol, JCDiagnostic>();
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        candidates.put(c.sym, c.details);
    }
    return candidates;
}
 
Example #16
Source File: Resolve.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (o instanceof Candidate) {
        Symbol s1 = this.sym;
        Symbol s2 = ((Candidate)o).sym;
        if  ((s1 != s2 &&
                (s1.overrides(s2, s1.owner.type.tsym, types, false) ||
                (s2.overrides(s1, s2.owner.type.tsym, types, false)))) ||
                ((s1.isConstructor() || s2.isConstructor()) && s1.owner != s2.owner))
            return true;
    }
    return false;
}
 
Example #17
Source File: Resolve.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private Map<Symbol, JCDiagnostic> mapCandidates() {
    Map<Symbol, JCDiagnostic> candidates = new LinkedHashMap<>();
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        candidates.put(c.sym, c.details);
    }
    return candidates;
}
 
Example #18
Source File: Resolve.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (o instanceof Candidate) {
        Symbol s1 = this.sym;
        Symbol s2 = ((Candidate)o).sym;
        if  ((s1 != s2 &&
                (s1.overrides(s2, s1.owner.type.tsym, types, false) ||
                (s2.overrides(s1, s2.owner.type.tsym, types, false)))) ||
                ((s1.isConstructor() || s2.isConstructor()) && s1.owner != s2.owner))
            return true;
    }
    return false;
}
 
Example #19
Source File: Resolve.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
boolean hasAnotherApplicableMethod(MethodResolutionContext resolutionContext,
        Symbol bestSoFar, boolean staticMth) {
    for (Candidate c : resolutionContext.candidates) {
        if (resolutionContext.step != c.step ||
            !c.isApplicable() ||
            c.sym == bestSoFar) {
            continue;
        } else {
            if (c.sym.isStatic() == staticMth) {
                return true;
            }
        }
    }
    return false;
}
 
Example #20
Source File: Resolve.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected Pair<Symbol, JCDiagnostic> errCandidate() {
    Candidate bestSoFar = null;
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        bestSoFar = c;
    }
    Assert.checkNonNull(bestSoFar);
    return new Pair<Symbol, JCDiagnostic>(bestSoFar.sym, bestSoFar.details);
}
 
Example #21
Source File: Resolve.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private Map<Symbol, JCDiagnostic> mapCandidates() {
    Map<Symbol, JCDiagnostic> candidates = new LinkedHashMap<Symbol, JCDiagnostic>();
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        candidates.put(c.sym, c.details);
    }
    return candidates;
}
 
Example #22
Source File: Resolve.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (o instanceof Candidate) {
        Symbol s1 = this.sym;
        Symbol s2 = ((Candidate)o).sym;
        if  ((s1 != s2 &&
                (s1.overrides(s2, s1.owner.type.tsym, types, false) ||
                (s2.overrides(s1, s2.owner.type.tsym, types, false)))) ||
                ((s1.isConstructor() || s2.isConstructor()) && s1.owner != s2.owner))
            return true;
    }
    return false;
}
 
Example #23
Source File: Resolve.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
boolean hasAnotherApplicableMethod(MethodResolutionContext resolutionContext,
        Symbol bestSoFar, boolean staticMth) {
    for (Candidate c : resolutionContext.candidates) {
        if (resolutionContext.step != c.step ||
            !c.isApplicable() ||
            c.sym == bestSoFar) {
            continue;
        } else {
            if (c.sym.isStatic() == staticMth) {
                return true;
            }
        }
    }
    return false;
}
 
Example #24
Source File: Resolve.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected Pair<Symbol, JCDiagnostic> errCandidate() {
    Candidate bestSoFar = null;
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        bestSoFar = c;
    }
    Assert.checkNonNull(bestSoFar);
    return new Pair<Symbol, JCDiagnostic>(bestSoFar.sym, bestSoFar.details);
}
 
Example #25
Source File: Resolve.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private Map<Symbol, JCDiagnostic> mapCandidates() {
    Map<Symbol, JCDiagnostic> candidates = new LinkedHashMap<Symbol, JCDiagnostic>();
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        candidates.put(c.sym, c.details);
    }
    return candidates;
}
 
Example #26
Source File: Resolve.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (o instanceof Candidate) {
        Symbol s1 = this.sym;
        Symbol s2 = ((Candidate)o).sym;
        if  ((s1 != s2 &&
                (s1.overrides(s2, s1.owner.type.tsym, types, false) ||
                (s2.overrides(s1, s2.owner.type.tsym, types, false)))) ||
                ((s1.isConstructor() || s2.isConstructor()) && s1.owner != s2.owner))
            return true;
    }
    return false;
}
 
Example #27
Source File: Resolve.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
boolean hasAnotherApplicableMethod(MethodResolutionContext resolutionContext,
        Symbol bestSoFar, boolean staticMth) {
    for (Candidate c : resolutionContext.candidates) {
        if (resolutionContext.step != c.step ||
            !c.isApplicable() ||
            c.sym == bestSoFar) {
            continue;
        } else {
            if (c.sym.isStatic() == staticMth) {
                return true;
            }
        }
    }
    return false;
}
 
Example #28
Source File: Resolve.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected Pair<Symbol, JCDiagnostic> errCandidate() {
    Candidate bestSoFar = null;
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        bestSoFar = c;
    }
    Assert.checkNonNull(bestSoFar);
    return new Pair<Symbol, JCDiagnostic>(bestSoFar.sym, bestSoFar.details);
}
 
Example #29
Source File: Resolve.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private Map<Symbol, JCDiagnostic> mapCandidates() {
    Map<Symbol, JCDiagnostic> candidates = new LinkedHashMap<Symbol, JCDiagnostic>();
    for (Candidate c : resolveContext.candidates) {
        if (c.isApplicable()) continue;
        candidates.put(c.sym, c.details);
    }
    return candidates;
}
 
Example #30
Source File: Resolve.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (o instanceof Candidate) {
        Symbol s1 = this.sym;
        Symbol s2 = ((Candidate)o).sym;
        if  ((s1 != s2 &&
                (s1.overrides(s2, s1.owner.type.tsym, types, false) ||
                (s2.overrides(s1, s2.owner.type.tsym, types, false)))) ||
                ((s1.isConstructor() || s2.isConstructor()) && s1.owner != s2.owner))
            return true;
    }
    return false;
}