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 146867 Details for
Bug 288920
[compiler] NPE renaming run() method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_288920.txt (text/plain), 3.29 KB, created by
Olivier Thomann
on 2009-09-10 10:13:24 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2009-09-10 10:13:24 EDT
Size:
3.29 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java,v >retrieving revision 1.121 >diff -u -r1.121 BinaryTypeBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 17 Aug 2009 16:14:46 -0000 1.121 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 10 Sep 2009 14:10:49 -0000 >@@ -302,7 +302,9 @@ > char[] methodDescriptor = binaryType.getEnclosingMethod(); > if (methodDescriptor != null) { > MethodBinding enclosingMethod = findMethod(methodDescriptor, missingTypeNames); >- typeVars = enclosingMethod.typeVariables; >+ if (enclosingMethod != null) { >+ typeVars = enclosingMethod.typeVariables; >+ } > } > > // attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested) >@@ -681,6 +683,7 @@ > TypeBinding[] parameters = Binding.NO_PARAMETERS; > int numOfParams = 0; > char nextChar; >+ int paramStart = index; > while ((nextChar = methodDescriptor[++index]) != ')') { > if (nextChar != '[') { > numOfParams++; >@@ -688,27 +691,41 @@ > while ((nextChar = methodDescriptor[++index]) != ';'){/*empty*/} > } > } >- >- int startIndex = 0; > if (numOfParams > 0) { > parameters = new TypeBinding[numOfParams]; >- index = 1; >- int end = 0; // first character is always '(' so skip it >+ index = paramStart + 1; >+ int end = paramStart; // first character is always '(' so skip it > for (int i = 0; i < numOfParams; i++) { > while ((nextChar = methodDescriptor[++end]) == '['){/*empty*/} > if (nextChar == 'L') > while ((nextChar = methodDescriptor[++end]) != ';'){/*empty*/} > >- if (i >= startIndex) { // skip the synthetic arg if necessary >- parameters[i - startIndex] = this.environment.getTypeFromSignature(methodDescriptor, index, end, false, this, missingTypeNames); >+ TypeBinding param = this.environment.getTypeFromSignature(methodDescriptor, index, end, false, this, missingTypeNames); >+ if (param instanceof UnresolvedReferenceBinding) { >+ param = resolveType(param, this.environment, true /* raw conversion */); > } >+ parameters[i] = param; > index = end + 1; > } > } > >- return CharOperation.equals(selector, TypeConstants.INIT) >- ? this.enclosingType.getExactConstructor(parameters) >- : this.enclosingType.getExactMethod(selector, parameters, null); >+ int parameterLength = parameters.length; >+ MethodBinding[] methods2 = this.enclosingType.getMethods(selector, parameterLength); >+ // find matching method using parameters >+ loop: for (int i = 0, max = methods2.length; i < max; i++) { >+ MethodBinding currentMethod = methods2[i]; >+ TypeBinding[] parameters2 = currentMethod.parameters; >+ int currentMethodParameterLength = parameters2.length; >+ if (parameterLength == currentMethodParameterLength) { >+ for (int j = 0; j < currentMethodParameterLength; j++) { >+ if (parameters[j] != parameters2[j] && parameters[j].erasure() != parameters2[j].erasure()) { >+ continue loop; >+ } >+ } >+ return currentMethod; >+ } >+ } >+ return null; > } > > /**
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 288920
: 146867