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 23318 Details for
Bug 100302
StackOverflowError during completion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Proposed patch
patchjdtcore002.txt (text/plain), 5.54 KB, created by
David Audel
on 2005-06-16 09:04:56 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
David Audel
Created:
2005-06-16 09:04:56 EDT
Size:
5.54 KB
patch
obsolete
>Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java,v >retrieving revision 1.139 >diff -u -r1.139 CompletionParser.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 3 Jun 2005 14:00:48 -0000 1.139 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 16 Jun 2005 12:52:46 -0000 >@@ -1898,7 +1898,8 @@ > } > protected void consumeInsideCastExpression() { > int end = intStack[intPtr--]; >- if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_PARAMETERIZED_CAST) { >+ boolean isParameterized =(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_PARAMETERIZED_CAST); >+ if(isParameterized) { > popElement(K_PARAMETERIZED_CAST); > > if(this.identifierLengthStack[this.identifierLengthPtr] > 0) { >@@ -1911,6 +1912,9 @@ > } > } > Expression castType = getTypeReference(intStack[intPtr--]); >+ if(isParameterized) { >+ intPtr--; >+ } > castType.sourceEnd = end - 1; > castType.sourceStart = intStack[intPtr--] + 1; > pushOnExpressionStack(castType); >@@ -1925,6 +1929,8 @@ > pushOnElementStack(K_CAST_STATEMENT); > } > protected void consumeInsideCastExpressionWithQualifiedGenerics() { >+ popElement(K_PARAMETERIZED_CAST); >+ > Expression castType; > int end = this.intStack[this.intPtr--]; > >@@ -1932,6 +1938,7 @@ > TypeReference rightSide = getTypeReference(0); > > castType = computeQualifiedGenericsFromRightSide(rightSide, dim); >+ this.intPtr--; > castType.sourceEnd = end - 1; > castType.sourceStart = this.intStack[this.intPtr--] + 1; > pushOnExpressionStack(castType); >Index: model/org/eclipse/jdt/core/Signature.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java,v >retrieving revision 1.73 >diff -u -r1.73 Signature.java >--- model/org/eclipse/jdt/core/Signature.java 3 Jun 2005 08:26:24 -0000 1.73 >+++ model/org/eclipse/jdt/core/Signature.java 16 Jun 2005 12:52:50 -0000 >@@ -2434,15 +2434,32 @@ > * @see Util#scanArrayTypeSignature(char[], int) > */ > private static int appendArrayTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer, boolean isVarArgs) { >+ int length = string.length; > // need a minimum 2 char >- if (start >= string.length - 1) { >+ if (start >= length - 1) { > throw new IllegalArgumentException(); > } > char c = string[start]; > if (c != C_ARRAY) { //$NON-NLS-1$ > throw new IllegalArgumentException(); > } >- int e = appendTypeSignature(string, start + 1, fullyQualifyTypeNames, buffer); >+ >+ int index = start; >+ c = string[++index]; >+ while(c == C_ARRAY) { >+ // need a minimum 2 char >+ if (index >= length - 1) { >+ throw new IllegalArgumentException(); >+ } >+ c = string[++index]; >+ } >+ >+ int e = appendTypeSignature(string, index, fullyQualifyTypeNames, buffer); >+ >+ for(int i = 1, dims = index - start; i < dims; i++) { >+ buffer.append('[').append(']'); >+ } >+ > if (isVarArgs) { > buffer.append('.').append('.').append('.'); > } else { >Index: model/org/eclipse/jdt/internal/core/util/Util.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java,v >retrieving revision 1.68 >diff -u -r1.68 Util.java >--- model/org/eclipse/jdt/internal/core/util/Util.java 31 May 2005 15:34:07 -0000 1.68 >+++ model/org/eclipse/jdt/internal/core/util/Util.java 16 Jun 2005 12:52:52 -0000 >@@ -2015,16 +2015,31 @@ > return result; > } > private static void appendArrayTypeSignature(char[] string, int start, StringBuffer buffer, boolean compact) { >+ int length = string.length; > // need a minimum 2 char >- if (start >= string.length - 1) { >+ if (start >= length - 1) { > throw new IllegalArgumentException(); > } > char c = string[start]; > if (c != Signature.C_ARRAY) { //$NON-NLS-1$ > throw new IllegalArgumentException(); > } >- appendTypeSignature(string, start + 1, buffer, compact); >- buffer.append('[').append(']'); >+ >+ int index = start; >+ c = string[++index]; >+ while(c == Signature.C_ARRAY) { >+ // need a minimum 2 char >+ if (index >= length - 1) { >+ throw new IllegalArgumentException(); >+ } >+ c = string[++index]; >+ } >+ >+ appendTypeSignature(string, index, buffer, compact); >+ >+ for(int i = 0, dims = index - start; i < dims; i++) { >+ buffer.append('[').append(']'); >+ } > } > private static void appendClassTypeSignature(char[] string, int start, StringBuffer buffer, boolean compact) { > char c = string[start]; >@@ -2400,15 +2415,25 @@ > * @exception IllegalArgumentException if this is not an array type signature > */ > public static int scanArrayTypeSignature(char[] string, int start) { >+ int length = string.length; > // need a minimum 2 char >- if (start >= string.length - 1) { >+ if (start >= length - 1) { > throw new IllegalArgumentException(); > } > char c = string[start]; > if (c != Signature.C_ARRAY) { //$NON-NLS-1$ > throw new IllegalArgumentException(); > } >- return scanTypeSignature(string, start + 1); >+ >+ c = string[++start]; >+ while(c == Signature.C_ARRAY) { >+ // need a minimum 2 char >+ if (start >= length - 1) { >+ throw new IllegalArgumentException(); >+ } >+ c = string[++start]; >+ } >+ return scanTypeSignature(string, start); > } > > /**
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 Raw
Actions:
View
Attachments on
bug 100302
: 23318 |
23319