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 21968 Details for
Bug 97275
method reference should not contain type variable anymore
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch97275_org.eclipse.jdt.core.txt (text/plain), 3.46 KB, created by
Jerome Lanneluc
on 2005-05-30 12:06:31 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2005-05-30 12:06:31 EDT
Size:
3.46 KB
patch
obsolete
>Index: model/org/eclipse/jdt/internal/core/util/KeyToSignature.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/KeyToSignature.java,v >retrieving revision 1.18 >diff -u -r1.18 KeyToSignature.java >--- model/org/eclipse/jdt/internal/core/util/KeyToSignature.java 30 May 2005 12:45:23 -0000 1.18 >+++ model/org/eclipse/jdt/internal/core/util/KeyToSignature.java 30 May 2005 16:06:38 -0000 >@@ -16,10 +16,6 @@ > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ast.Wildcard; > >-/* >- * Converts a binding key into a signature >- */ >-// TODO (jerome) handle methods and fields > public class KeyToSignature extends BindingKeyParser { > > public static final int SIGNATURE = 0; >@@ -101,32 +97,48 @@ > this.signature.append(Signature.C_PARAM_START); > char[][] parameters = Signature.getParameterTypes(methodSignature); > for (int i = 0, parametersLength = parameters.length; i < parametersLength; i++) >- this.signature.append(substitute(parameters[i], typeParameterSigs, typeParametersSize)); >+ substitute(parameters[i], typeParameterSigs, typeParametersSize); > this.signature.append(Signature.C_PARAM_END); > > // substitute return type > char[] returnType = Signature.getReturnType(methodSignature); >- returnType = substitute(returnType, typeParameterSigs, typeParametersSize); >- this.signature.append(returnType); >+ substitute(returnType, typeParameterSigs, typeParametersSize); > > // substitute exceptions > char[][] exceptions = Signature.getThrownExceptionTypes(methodSignature); > for (int i = 0, exceptionsLength = exceptions.length; i < exceptionsLength; i++) { > this.signature.append(Signature.C_EXCEPTION_START); >- this.signature.append(substitute(exceptions[i], typeParameterSigs, typeParametersSize)); >+ substitute(exceptions[i], typeParameterSigs, typeParametersSize); > } > > } > } > >- private char[] substitute(char[] parameter, char[][] typeParameterSigs, int typeParametersLength) { >+ /* >+ * Substitutes the type variables referenced in the given parameter (a parameterized type signature) with the corresponding >+ * type argument. >+ * Appends the given parameter if it is not a parameterized type signature. >+ */ >+ private void substitute(char[] parameter, char[][] typeParameterSigs, int typeParametersLength) { > for (int i = 0; i < typeParametersLength; i++) { > if (CharOperation.equals(parameter, typeParameterSigs[i])) { > String typeArgument = ((KeyToSignature) this.arguments.get(i)).signature.toString(); >- return typeArgument.toCharArray(); >+ this.signature.append(typeArgument); >+ return; > } > } >- return parameter; >+ int genericStart = CharOperation.indexOf(Signature.C_GENERIC_START, parameter); >+ if (genericStart > -1) { >+ this.signature.append(CharOperation.subarray(parameter, 0, genericStart)); >+ char[][] parameters = Signature.getTypeArguments(parameter); >+ this.signature.append(Signature.C_GENERIC_START); >+ for (int j = 0, paramsLength = parameters.length; j < paramsLength; j++) >+ substitute(parameters[j], typeParameterSigs, typeParametersLength); >+ this.signature.append(Signature.C_GENERIC_END); >+ this.signature.append(Signature.C_SEMICOLON); >+ } else { >+ this.signature.append(parameter); >+ } > } > > public void consumeParameterizedType(char[] simpleTypeName, boolean isRaw) {
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 97275
: 21968 |
21969