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 111238 Details for
Bug 245563
npe in reconciler
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test
patch_245563.txt (text/plain), 3.00 KB, created by
Olivier Thomann
on 2008-08-28 14:57:37 EDT
(
hide
)
Description:
Proposed fix + regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2008-08-28 14:57:37 EDT
Size:
3.00 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java,v >retrieving revision 1.50 >diff -u -r1.50 ForeachStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java 27 Jun 2008 16:03:55 -0000 1.50 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java 28 Aug 2008 18:56:23 -0000 >@@ -373,7 +373,11 @@ > printIndent(indent, output).append("for ("); //$NON-NLS-1$ > this.elementVariable.printAsExpression(0, output); > output.append(" : ");//$NON-NLS-1$ >- this.collection.print(0, output).append(") "); //$NON-NLS-1$ >+ if (this.collection != null) { >+ this.collection.print(0, output).append(") "); //$NON-NLS-1$ >+ } else { >+ output.append(')'); >+ } > //block > if (this.action == null) { > output.append(';'); >@@ -525,7 +529,9 @@ > > if (visitor.visit(this, blockScope)) { > this.elementVariable.traverse(visitor, this.scope); >- this.collection.traverse(visitor, this.scope); >+ if (this.collection != null) { >+ this.collection.traverse(visitor, this.scope); >+ } > if (this.action != null) { > this.action.traverse(visitor, this.scope); > } >#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.275 >diff -u -r1.275 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 20 Aug 2008 11:55:44 -0000 1.275 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 28 Aug 2008 18:56:26 -0000 >@@ -46,7 +46,7 @@ > } > > static { >-// TESTS_NUMBERS = new int[] { 322 }; >+// TESTS_NUMBERS = new int[] { 323 }; > // TESTS_RANGE = new int[] { 308, -1 }; > // TESTS_NAMES = new String[] {"test0204"}; > } >@@ -10342,4 +10342,31 @@ > IMemberValuePairBinding pairBinding = memberValuePairBindings[0]; > assertNull("Got a value", pairBinding.getValue()); > } >+ /* >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=245563 >+ */ >+ public void test0323() throws JavaModelException { >+ String contents = >+ "class X {\n" + >+ " {\n" + >+ " for(Object obj:\n" + >+ " new Object[]{\n" + >+ " new Object(){\n" + >+ " int field=method(\n" + >+ " });\n" + >+ " }\n" + >+ " });\n" + >+ " }\n" + >+ " int method(int...args){\n" + >+ " return args.length;\n" + >+ " }\n" + >+ "}\n" + >+ ""; >+ this.workingCopy = getWorkingCopy( >+ "/Converter15/src/test0322/X.java", >+ contents, >+ true/*resolve*/ >+ ); >+ assertNotNull("No node", buildAST(contents, workingCopy, false, true, true)); >+ } > } >\ No newline at end of file
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 245563
: 111238