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 87552 Details for
Bug 215858
[AST/DOM] CCE when using ASTParser.setFocalPosition(int) with the position of a field declaration name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test for 3.3.x maintenance stream
patch_215858_332.txt (text/plain), 3.41 KB, created by
Olivier Thomann
on 2008-01-22 15:11:26 EST
(
hide
)
Description:
Proposed fix + regression test for 3.3.x maintenance stream
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2008-01-22 15:11:26 EST
Size:
3.41 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v >retrieving revision 1.122.2.2 >diff -u -r1.122.2.2 ASTConverterTestAST3_2.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 27 Aug 2007 19:18:55 -0000 1.122.2.2 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 22 Jan 2008 20:09:42 -0000 >@@ -24,6 +24,7 @@ > import org.eclipse.jdt.core.Flags; > import org.eclipse.jdt.core.IClassFile; > import org.eclipse.jdt.core.ICompilationUnit; >+import org.eclipse.jdt.core.IField; > import org.eclipse.jdt.core.IInitializer; > import org.eclipse.jdt.core.IJavaElement; > import org.eclipse.jdt.core.IJavaProject; >@@ -9217,8 +9218,6 @@ > assertNotNull("No fields", fields); > assertTrue("Empty", fields.length != 0); > } >- >- > /** > * http://dev.eclipse.org/bugs/show_bug.cgi?id=196354 > */ >@@ -9233,4 +9232,19 @@ > assertNotNull("No binding", packageBinding); > assertEquals("Wrong name", "Sample", packageBinding.getName()); > } >+ /** >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=215858 >+ */ >+ public void test0679() throws JavaModelException { >+ ICompilationUnit sourceUnit = getCompilationUnit("Converter" , "src", "test0679", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ >+ IType[] types = sourceUnit.getTypes(); >+ assertNotNull(types); >+ assertEquals("wrong size", 1, types.length); >+ IType type = types[0]; >+ IField field = type.getField("i"); >+ assertNotNull("No field", field); >+ ISourceRange sourceRange = field.getNameRange(); >+ ASTNode result = runConversion(AST.JLS3, sourceUnit, sourceRange.getOffset() + sourceRange.getLength() / 2, false); >+ assertNotNull(result); >+ } > } >Index: workspace/Converter/src/test0679/X.java >=================================================================== >RCS file: workspace/Converter/src/test0679/X.java >diff -N workspace/Converter/src/test0679/X.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ workspace/Converter/src/test0679/X.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,6 @@ >+package test0679; >+ >+public class X { >+ protected int i; >+ protected void foo(String string) {} >+} >#P org.eclipse.jdt.core >Index: dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java,v >retrieving revision 1.124 >diff -u -r1.124 CompilationUnitResolver.java >--- dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java 16 Mar 2007 18:28:58 -0000 1.124 >+++ dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java 22 Jan 2008 20:09:42 -0000 >@@ -425,7 +425,7 @@ > } else if (enclosingTypeDeclaration != null) { > if (node instanceof org.eclipse.jdt.internal.compiler.ast.Initializer) { > ((org.eclipse.jdt.internal.compiler.ast.Initializer) node).parseStatements(parser, enclosingTypeDeclaration, compilationUnitDeclaration); >- } else { >+ } else if (node instanceof org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) { > ((org.eclipse.jdt.internal.compiler.ast.TypeDeclaration)node).parseMethod(parser, compilationUnitDeclaration); > } > }
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 215858
:
87297
| 87552