Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 68019 Details for
Bug 188103
[1.5][compiler] Inappropriate usage of HashSet
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch including test change
188103.txt (text/plain), 5.41 KB, created by
Philipe Mulet
on 2007-05-21 15:31:32 EDT
(
hide
)
Description:
Patch including test change
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2007-05-21 15:31:32 EDT
Size:
5.41 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v >retrieving revision 1.307 >diff -u -r1.307 Scope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 16 May 2007 20:49:40 -0000 1.307 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 21 May 2007 19:30:24 -0000 >@@ -2536,12 +2536,12 @@ > nextCandidate: for (int k = 0, max = mecs.length; k < max; k++) { > TypeBinding mec = mecs[k]; > if (mec == null) continue nextCandidate; >- Set invalidInvocations = (Set) invocations.get(mec); >+ List invalidInvocations = (List) invocations.get(mec); > int invalidSize = invalidInvocations.size(); > if (invalidSize > 1) { >- TypeBinding[] collisions; >- invalidInvocations.toArray(collisions = new TypeBinding[invalidSize]); >- problemReporter().superinterfacesCollide(collisions[0].erasure(), typeRef, collisions[0], collisions[1]); >+ TypeBinding firstInvocation = (TypeBinding) invalidInvocations.get(0); >+ TypeBinding secondInvocation = (TypeBinding) invalidInvocations.get(1); >+ problemReporter().superinterfacesCollide(firstInvocation.erasure(), typeRef, firstInvocation, secondInvocation); > type.tagBits |= TagBits.HierarchyHasProblems; > return true; > } >@@ -2756,7 +2756,7 @@ > return false; > } > >- private TypeBinding leastContainingInvocation(TypeBinding mec, Set invocations, List lubStack) { >+ private TypeBinding leastContainingInvocation(TypeBinding mec, List invocations, List lubStack) { > if (invocations == null) return mec; // no alternate invocation > int length = invocations.size(); > Iterator iter = invocations.iterator(); >@@ -2928,7 +2928,7 @@ > for (int i = 0; i < length; i++) { > TypeBinding mec = mecs[i]; > if (mec == null) continue; >- mec = leastContainingInvocation(mec, (Set)invocations.get(mec), lubStack); >+ mec = leastContainingInvocation(mec, (List)invocations.get(mec), lubStack); > if (mec == null) return null; > int dim = mec.dimensions(); > if (commonDim == -1) { >@@ -3001,7 +3001,7 @@ > TypeBinding leafType = firstType.leafComponentType(); > TypeBinding firstErasure = (leafType.isTypeVariable() || leafType.isWildcard()/*&& !leafType.isCapture()*/) ? firstType : firstType.erasure(); > if (firstErasure != firstType) { >- Set someInvocations = new HashSet(1); >+ List someInvocations = new ArrayList(1); > someInvocations.add(firstType); > allInvocations.put(firstErasure, someInvocations); > } >@@ -3063,7 +3063,7 @@ > max++; > TypeBinding superTypeErasure = (firstBound.isTypeVariable() || firstBound.isWildcard() /*&& !itsInterface.isCapture()*/) ? superType : superType.erasure(); > if (superTypeErasure != superType) { >- Set someInvocations = new HashSet(1); >+ List someInvocations = new ArrayList(1); > someInvocations.add(superType); > allInvocations.put(superTypeErasure, someInvocations); > } >@@ -3082,7 +3082,7 @@ > max++; > TypeBinding superTypeErasure = (itsInterface.isTypeVariable() || itsInterface.isWildcard() /*&& !itsInterface.isCapture()*/) ? superType : superType.erasure(); > if (superTypeErasure != superType) { >- Set someInvocations = new HashSet(1); >+ List someInvocations = new ArrayList(1); > someInvocations.add(superType); > allInvocations.put(superTypeErasure, someInvocations); > } >@@ -3097,7 +3097,7 @@ > max++; > TypeBinding superTypeErasure = (itsSuperclass.isTypeVariable() || itsSuperclass.isWildcard() /*&& !itsSuperclass.isCapture()*/) ? superType : superType.erasure(); > if (superTypeErasure != superType) { >- Set someInvocations = new HashSet(1); >+ List someInvocations = new ArrayList(1); > someInvocations.add(superType); > allInvocations.put(superTypeErasure, someInvocations); > } >@@ -3128,9 +3128,14 @@ > continue nextSuperType; > } > // record invocation >- Set someInvocations = (Set) allInvocations.get(erasedSuperType); >- if (someInvocations == null) someInvocations = new HashSet(1); >- someInvocations.add(match); >+ List someInvocations = (List) allInvocations.get(erasedSuperType); >+ if (someInvocations == null) { >+ someInvocations = new ArrayList(1); >+ someInvocations.add(match); >+ } else { >+ // using a list to record invocations in order (188103) >+ if (!someInvocations.contains(match)) someInvocations.add(match); >+ } > allInvocations.put(erasedSuperType, someInvocations); > } > continue nextOtherType; >@@ -3154,9 +3159,14 @@ > } > } > // record invocation >- Set someInvocations = (Set) allInvocations.get(erasedSuperType); >- if (someInvocations == null) someInvocations = new HashSet(1); >- someInvocations.add(match); >+ List someInvocations = (List) allInvocations.get(erasedSuperType); >+ if (someInvocations == null) { >+ someInvocations = new ArrayList(1); >+ someInvocations.add(match); >+ } else { >+ // using a list to record invocations in order (188103) >+ if (!someInvocations.contains(match)) someInvocations.add(match); >+ } > allInvocations.put(erasedSuperType, someInvocations); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 188103
:
67990
|
68019
|
68031
|
68073
|
68103