View | Details | Raw Unified | Return to bug 80904 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java (+24 lines)
Lines 5413-5418 Link Here
5413
		}
5413
		}
5414
	}
5414
	}
5415
5415
5416
	/*
5417
	 * Ensures that the start position of an argument that has a previous sibbling with a comment is correct
5418
	 * (regression test for bug 80904 Quick Fix "Assign parameter to new field" doesn't appear with commented type)
5419
	 */
5420
	public void test0579() throws CoreException {
5421
		ICompilationUnit workingCopy = null;
5422
		try {
5423
			workingCopy = getWorkingCopy(
5424
				"/Converter/src/X.java", 
5425
				"public class X {\n" +
5426
				"  /*start*/void foo(Object/*first arg*/ arg1, Object arg2) {\n" +
5427
				"  }/*end*/\n" +
5428
				"}",
5429
				true/*resolve*/);
5430
			MethodDeclaration method = (MethodDeclaration) buildAST(workingCopy);
5431
			SingleVariableDeclaration arg2 = (SingleVariableDeclaration) method.parameters().get(1);
5432
			int start = arg2.getStartPosition();
5433
			assertEquals("Unexpected range for arg2", "Object arg2", workingCopy.getSource().substring(start, start+arg2.getLength()));
5434
		} finally {
5435
			if (workingCopy != null)
5436
				workingCopy.discardWorkingCopy();
5437
		}
5438
	}
5439
	
5416
	public void test0606() throws JavaModelException {
5440
	public void test0606() throws JavaModelException {
5417
		ICompilationUnit sourceUnit = getCompilationUnit("Converter", "src", "test0606", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
5441
		ICompilationUnit sourceUnit = getCompilationUnit("Converter", "src", "test0606", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
5418
		ASTNode result = runConversion(sourceUnit, true);
5442
		ASTNode result = runConversion(sourceUnit, true);
(-)model/org/eclipse/jdt/internal/compiler/SourceElementParser.java (+4 lines)
Lines 394-399 Link Here
394
		requestor.acceptFieldReference(fr.token, fr.sourceStart);
394
		requestor.acceptFieldReference(fr.token, fr.sourceStart);
395
	}
395
	}
396
}
396
}
397
protected void consumeFormalParameter(boolean isVarArgs) {
398
	super.consumeFormalParameter(isVarArgs);
399
	flushCommentsDefinedPriorTo(this.scanner.currentPosition);
400
}
397
protected void consumeInterfaceHeaderName1() {
401
protected void consumeInterfaceHeaderName1() {
398
	int currentAstPtr = this.astPtr;
402
	int currentAstPtr = this.astPtr;
399
	super.consumeInterfaceHeaderName1();
403
	super.consumeInterfaceHeaderName1();

Return to bug 80904