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 101731 Details for
Bug 233625
Content Assist outof memory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and regression test
233625.txt (text/plain), 7.69 KB, created by
Jerome Lanneluc
on 2008-05-23 09:39:54 EDT
(
hide
)
Description:
Proposed fix and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2008-05-23 09:39:54 EDT
Size:
7.69 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v >retrieving revision 1.266 >diff -u -r1.266 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 8 May 2008 19:24:20 -0000 1.266 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 23 May 2008 13:39:20 -0000 >@@ -10114,4 +10114,17 @@ > IMethodBinding binding = declaration.resolveBinding(); > assertNotNull("No binding", binding); > } >+ >+ /* >+ * Ensures that requesting a binding with a non-existing parameterized type doesn't throw an OutOfMemoryError >+ * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=233625 ) >+ */ >+ public void test0312() throws JavaModelException { >+ String[] bindingKeys = new String[] {"Ljava/util/Map<Ljava/lang/Class<Ljava/lang/Class;*>;Ljava/util/List<LField;>;>;"}; >+ BindingRequestor requestor = new BindingRequestor(); >+ resolveASTs(new ICompilationUnit[] {} , bindingKeys, requestor, getJavaProject("Converter15"), null); >+ assertBindingsEqual( >+ "<null>", >+ requestor.getBindings(bindingKeys)); >+ } > } >\ No newline at end of file >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java,v >retrieving revision 1.33 >diff -u -r1.33 BindingKeyParser.java >--- model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java 18 Jan 2008 15:31:39 -0000 1.33 >+++ model/org/eclipse/jdt/internal/core/util/BindingKeyParser.java 23 May 2008 13:39:22 -0000 >@@ -568,82 +568,78 @@ > } > > public void parse(boolean pauseAfterFullyQualifiedName) { >- try { >- if (!this.parsingPaused) { >- // fully qualified name >- parseFullyQualifiedName(); >- parseSecondaryType(); >- if (pauseAfterFullyQualifiedName) { >- this.parsingPaused = true; >- return; >- } >- } >- if (!hasTypeName()) { >- consumeKey(); >+ if (!this.parsingPaused) { >+ // fully qualified name >+ parseFullyQualifiedName(); >+ parseSecondaryType(); >+ if (pauseAfterFullyQualifiedName) { >+ this.parsingPaused = true; > return; > } >- consumeTopLevelType(); >- parseInnerType(); >- >- if (this.scanner.isAtParametersStart()) { >- this.scanner.skipParametersStart(); >- if (this.scanner.isAtTypeParameterStart()) { >- // generic type >- parseGenericType(); >- // skip ";>" >- this.scanner.skipParametersEnd(); >- // local type in generic type >- parseInnerType(); >- } else if (this.scanner.isAtTypeArgumentStart()) >- // parameterized type >- parseParameterizedType(null/*top level type or member type with raw enclosing type*/, false/*no raw*/); >- else if (this.scanner.isAtRawTypeEnd()) >- // raw type >- parseRawType(); >- } else { >- // non-generic type >- consumeNonGenericType(); >- } >- >- consumeType(); >- this.scanner.skipTypeEnd(); >- >- if (this.scanner.isAtFieldOrMethodStart()) { >- switch (this.scanner.nextToken()) { >- case Scanner.FIELD: >- parseField(); >- if (this.scanner.isAtAnnotationStart()) { >- parseAnnotation(); >- } >- return; >- case Scanner.METHOD: >- parseMethod(); >- if (this.scanner.isAtLocalVariableStart()) { >- parseLocalVariable(); >- } else if (this.scanner.isAtTypeVariableStart()) { >- parseTypeVariable(); >- } else if (this.scanner.isAtAnnotationStart()) { >- parseAnnotation(); >- } >- break; >- default: >- malformedKey(); >- return; >- } >- } else if (this.scanner.isAtTypeVariableStart()) { >- parseTypeVariable(); >- } else if (this.scanner.isAtWildcardStart()) { >- parseWildcard(); >- } else if (this.scanner.isAtTypeWithCaptureStart()) { >- parseTypeWithCapture(); >- } else if (this.scanner.isAtAnnotationStart()) { >- parseAnnotation(); >- } >- >+ } >+ if (!hasTypeName()) { > consumeKey(); >- } catch (IllegalArgumentException e) { >- // the given key was illegal >+ return; >+ } >+ consumeTopLevelType(); >+ parseInnerType(); >+ >+ if (this.scanner.isAtParametersStart()) { >+ this.scanner.skipParametersStart(); >+ if (this.scanner.isAtTypeParameterStart()) { >+ // generic type >+ parseGenericType(); >+ // skip ";>" >+ this.scanner.skipParametersEnd(); >+ // local type in generic type >+ parseInnerType(); >+ } else if (this.scanner.isAtTypeArgumentStart()) >+ // parameterized type >+ parseParameterizedType(null/*top level type or member type with raw enclosing type*/, false/*no raw*/); >+ else if (this.scanner.isAtRawTypeEnd()) >+ // raw type >+ parseRawType(); >+ } else { >+ // non-generic type >+ consumeNonGenericType(); >+ } >+ >+ consumeType(); >+ this.scanner.skipTypeEnd(); >+ >+ if (this.scanner.isAtFieldOrMethodStart()) { >+ switch (this.scanner.nextToken()) { >+ case Scanner.FIELD: >+ parseField(); >+ if (this.scanner.isAtAnnotationStart()) { >+ parseAnnotation(); >+ } >+ return; >+ case Scanner.METHOD: >+ parseMethod(); >+ if (this.scanner.isAtLocalVariableStart()) { >+ parseLocalVariable(); >+ } else if (this.scanner.isAtTypeVariableStart()) { >+ parseTypeVariable(); >+ } else if (this.scanner.isAtAnnotationStart()) { >+ parseAnnotation(); >+ } >+ break; >+ default: >+ malformedKey(); >+ return; >+ } >+ } else if (this.scanner.isAtTypeVariableStart()) { >+ parseTypeVariable(); >+ } else if (this.scanner.isAtWildcardStart()) { >+ parseWildcard(); >+ } else if (this.scanner.isAtTypeWithCaptureStart()) { >+ parseTypeWithCapture(); >+ } else if (this.scanner.isAtAnnotationStart()) { >+ parseAnnotation(); > } >+ >+ consumeKey(); > } > > private void parseFullyQualifiedName() { >Index: model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java,v >retrieving revision 1.49 >diff -u -r1.49 BindingKeyResolver.java >--- model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java 5 Feb 2008 15:48:31 -0000 1.49 >+++ model/org/eclipse/jdt/internal/core/util/BindingKeyResolver.java 23 May 2008 13:39:22 -0000 >@@ -242,6 +242,10 @@ > if (this.methodBinding == null) > return; > TypeBinding[] arguments = getTypeBindingArguments(); >+ if (arguments == null) { >+ this.methodBinding = null; >+ return; >+ } > if (arguments.length != this.methodBinding.typeVariables().length) > this.methodBinding = this.environment.createParameterizedGenericMethod(this.methodBinding, (RawTypeBinding) null); > else >@@ -302,6 +306,10 @@ > > public void consumeParameterizedType(char[] simpleTypeName, boolean isRaw) { > TypeBinding[] arguments = getTypeBindingArguments(); >+ if (arguments == null) { >+ this.typeBinding = null; >+ return; >+ } > if (simpleTypeName != null) { > if (this.genericType == null) { > // parameterized member type with raw enclosing type >@@ -527,7 +535,7 @@ > BindingKeyResolver resolver = (BindingKeyResolver) this.types.get(i); > TypeBinding compilerBinding2 = (TypeBinding) resolver.compilerBinding; > if (compilerBinding2 == null) { >- throw new IllegalArgumentException(); >+ return null; > } > arguments[i] = compilerBinding2; > }
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 233625
:
101731
|
101771
|
102124