mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-15 08:34:30 +02:00
8297158: Suspicious collection method call in Types.isSameTypeVisitor
Reviewed-by: jlahoda
This commit is contained in:
parent
e193a0b72a
commit
5744c91bf5
4 changed files with 6 additions and 9 deletions
|
@ -1407,9 +1407,6 @@ public class Types {
|
|||
|
||||
Map<Symbol,Type> tMap = new HashMap<>();
|
||||
for (Type ti : interfaces(t)) {
|
||||
if (tMap.containsKey(ti)) {
|
||||
throw new AssertionError("Malformed intersection");
|
||||
}
|
||||
tMap.put(ti.tsym, ti);
|
||||
}
|
||||
for (Type si : interfaces(s)) {
|
||||
|
|
|
@ -5116,11 +5116,11 @@ public class Attr extends JCTree.Visitor {
|
|||
}
|
||||
|
||||
Type checkIntersection(JCTree tree, List<JCExpression> bounds) {
|
||||
Set<Type> boundSet = new HashSet<>();
|
||||
Set<Symbol> boundSet = new HashSet<>();
|
||||
if (bounds.nonEmpty()) {
|
||||
// accept class or interface or typevar as first bound.
|
||||
bounds.head.type = checkBase(bounds.head.type, bounds.head, env, false, false, false);
|
||||
boundSet.add(types.erasure(bounds.head.type));
|
||||
boundSet.add(types.erasure(bounds.head.type).tsym);
|
||||
if (bounds.head.type.isErroneous()) {
|
||||
return bounds.head.type;
|
||||
}
|
||||
|
|
|
@ -2872,11 +2872,11 @@ public class Check {
|
|||
/** Enter interface into into set.
|
||||
* If it existed already, issue a "repeated interface" error.
|
||||
*/
|
||||
void checkNotRepeated(DiagnosticPosition pos, Type it, Set<Type> its) {
|
||||
if (its.contains(it))
|
||||
void checkNotRepeated(DiagnosticPosition pos, Type it, Set<Symbol> its) {
|
||||
if (its.contains(it.tsym))
|
||||
log.error(pos, Errors.RepeatedInterface);
|
||||
else {
|
||||
its.add(it);
|
||||
its.add(it.tsym);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -845,7 +845,7 @@ public class TypeEnter implements Completer {
|
|||
|
||||
fillPermits(tree, baseEnv);
|
||||
|
||||
Set<Type> interfaceSet = new HashSet<>();
|
||||
Set<Symbol> interfaceSet = new HashSet<>();
|
||||
|
||||
for (JCExpression iface : tree.implementing) {
|
||||
Type it = iface.type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue