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 54419 Details for
Bug 165620
Regression in 3.3M3 with generics - ambiguous method.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Experimentation - do not release
org.eclipse.jdt.core_01.txt (text/plain), 6.13 KB, created by
Maxime Daniel
on 2006-11-23 10:28:35 EST
(
hide
)
Description:
Experimentation - do not release
Filename:
MIME Type:
Creator:
Maxime Daniel
Created:
2006-11-23 10:28:35 EST
Size:
6.13 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java,v >retrieving revision 1.31 >diff -u -r1.31 AmbiguousMethodTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 23 Nov 2006 14:53:12 -0000 1.31 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java 23 Nov 2006 15:19:21 -0000 >@@ -1557,7 +1557,7 @@ > } > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=163370 >-public void _test044() { >+public void test044() { > this.runConformTest( > new String[] { > "X.java", >@@ -1580,7 +1580,7 @@ > } > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=165620 >-public void _test045() { >+public void test045() { > this.runConformTest( > new String[] { > "X.java", >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java,v >retrieving revision 1.86 >diff -u -r1.86 ParameterizedTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 9 Oct 2006 11:21:52 -0000 1.86 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 23 Nov 2006 15:19:35 -0000 >@@ -1058,4 +1058,29 @@ > } > return Binding.NO_TYPE_VARIABLES; > } >+ >+boolean uses(TypeBinding variable) { >+ int argsNb = this.arguments.length; >+ for (int i = 0; i < argsNb; i++) { >+ if (this.arguments[i] == variable || this.arguments[i].uses(variable)) { >+ return true; >+ } >+ } >+ return false; >+} >+TypeBinding clearedOf(TypeBinding variable) { >+ if (uses(variable)) { >+ int argsNb; >+ TypeBinding[] newArguments = new TypeBinding[argsNb = this.arguments.length]; >+ for (int i = 0; i < argsNb; i++) { >+ if (this.arguments[i].uses(variable)) { >+ return new RawTypeBinding(this.type, this.enclosingType, this.environment); >+ } >+ newArguments[i] = this.arguments[i].clearedOf(variable); >+ } >+ return new ParameterizedTypeBinding(this.type, newArguments, >+ this.enclosingType, this.environment); >+ } >+ return this; >+} > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java,v >retrieving revision 1.77 >diff -u -r1.77 TypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 9 Nov 2006 14:21:27 -0000 1.77 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 23 Nov 2006 15:19:35 -0000 >@@ -963,4 +963,11 @@ > public TypeVariableBinding[] typeVariables() { > return Binding.NO_TYPE_VARIABLES; > } >+ >+boolean uses(TypeBinding variable) { >+ return false; >+} >+TypeBinding clearedOf(TypeBinding variable) { >+ return this; >+} > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java,v >retrieving revision 1.53 >diff -u -r1.53 ParameterizedGenericMethodBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java 18 Oct 2006 13:25:23 -0000 1.53 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java 23 Nov 2006 15:19:31 -0000 >@@ -461,11 +461,18 @@ > boolean isStatic = this.isStatic(); > for (int i = 0; i < length; i++) { > newArguments[i] = isStatic ? >- originalVariables[i].upperBound() : // do not rawify for statics >+ upperBound(originalVariables[i]) : // do not rawify for statics > environment.convertToRawType(originalVariables[i].upperBound()); > } > this.tiebreakMethod = this.environment.createParameterizedGenericMethod(this.originalMethod, newArguments); > } > return this.tiebreakMethod; >- } >+ } >+ TypeBinding upperBound(TypeVariableBinding original) { >+ TypeBinding result = original.firstBound; >+ if (result == null ) { >+ return original.superclass; // java/lang/Object >+ } >+ return result.clearedOf(original); >+ } > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java,v >retrieving revision 1.54 >diff -u -r1.54 TypeVariableBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java 25 Jun 2006 21:33:33 -0000 1.54 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java 23 Nov 2006 15:19:37 -0000 >@@ -440,5 +440,8 @@ > return this.firstBound; > } > return this.superclass; // java/lang/Object >- } >+ } >+boolean uses(TypeBinding variable) { >+ return CharOperation.equals(((TypeVariableBinding)variable).sourceName, this.sourceName); >+} > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java,v >retrieving revision 1.56 >diff -u -r1.56 WildcardBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java 30 Oct 2006 22:47:40 -0000 1.56 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java 23 Nov 2006 15:19:37 -0000 >@@ -624,4 +624,11 @@ > } > return this.typeVariable; > } >+ >+boolean uses(TypeBinding variable) { >+ if (this.bound != null) { >+ return this.bound.uses(variable); >+ } >+ return false; >+} > }
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 165620
:
54401
|
54419
|
54461