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 39071 Details for
Bug 80904
Quick Fix "Assign parameter to new field" doesn't appear with commented type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Better patch and same regression test
80904.txt (text/plain), 2.75 KB, created by
Jerome Lanneluc
on 2006-04-20 13:31:48 EDT
(
hide
)
Description:
Better patch and same regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2006-04-20 13:31:48 EDT
Size:
2.75 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java,v >retrieving revision 1.171 >diff -u -r1.171 ASTConverterTest2.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 29 Mar 2006 04:03:06 -0000 1.171 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 19 Apr 2006 16:45:14 -0000 >@@ -5413,6 +5413,30 @@ > } > } > >+ /* >+ * Ensures that the start position of an argument that has a previous sibbling with a comment is correct >+ * (regression test for bug 80904 Quick Fix "Assign parameter to new field" doesn't appear with commented type) >+ */ >+ public void test0579() throws CoreException { >+ ICompilationUnit workingCopy = null; >+ try { >+ workingCopy = getWorkingCopy( >+ "/Converter/src/X.java", >+ "public class X {\n" + >+ " /*start*/void foo(Object/*first arg*/ arg1, Object arg2) {\n" + >+ " }/*end*/\n" + >+ "}", >+ true/*resolve*/); >+ MethodDeclaration method = (MethodDeclaration) buildAST(workingCopy); >+ SingleVariableDeclaration arg2 = (SingleVariableDeclaration) method.parameters().get(1); >+ int start = arg2.getStartPosition(); >+ assertEquals("Unexpected range for arg2", "Object arg2", workingCopy.getSource().substring(start, start+arg2.getLength())); >+ } finally { >+ if (workingCopy != null) >+ workingCopy.discardWorkingCopy(); >+ } >+ } >+ > public void test0606() throws JavaModelException { > ICompilationUnit sourceUnit = getCompilationUnit("Converter", "src", "test0606", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ > ASTNode result = runConversion(sourceUnit, true); >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/compiler/SourceElementParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java,v >retrieving revision 1.67 >diff -u -r1.67 SourceElementParser.java >--- model/org/eclipse/jdt/internal/compiler/SourceElementParser.java 20 Apr 2006 17:18:05 -0000 1.67 >+++ model/org/eclipse/jdt/internal/compiler/SourceElementParser.java 20 Apr 2006 17:18:36 -0000 >@@ -394,6 +394,10 @@ > requestor.acceptFieldReference(fr.token, fr.sourceStart); > } > } >+protected void consumeFormalParameter(boolean isVarArgs) { >+ super.consumeFormalParameter(isVarArgs); >+ flushCommentsDefinedPriorTo(this.scanner.currentPosition); >+} > protected void consumeInterfaceHeaderName1() { > int currentAstPtr = this.astPtr; > super.consumeInterfaceHeaderName1();
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 80904
:
38954
| 39071