View | Details | Raw Unified | Return to bug 91709
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java (+43 lines)
Lines 2729-2734 Link Here
2729
	}
2729
	}
2730
}
2730
}
2731
/*
2731
/*
2732
 * Ensures that a method that has a type parameter starting with $ can be reconciled against.
2733
 * (regression test for bug 91709 [1.5][model] Quick Fix Error but no Problem Reported)
2734
 */
2735
public void testTypeParameterStartingWithDollar() throws CoreException {
2736
	this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
2737
	this.workingCopy = null;
2738
	WorkingCopyOwner owner = new WorkingCopyOwner() {};
2739
	ICompilationUnit workingCopy1 = null;
2740
	try {
2741
		workingCopy1 = getWorkingCopy(
2742
			"/Reconciler15/src/test/Y.java",
2743
			"package test;\n"+
2744
			"public class Y<$T> {\n"+
2745
			"	void foo($T t);\n"+
2746
			"}\n",
2747
			owner,
2748
			null /*no problem requestor*/
2749
		);
2750
		
2751
		this.problemRequestor =  new ProblemRequestor();
2752
		this.workingCopy = getWorkingCopy("Reconciler15/src/test/X.java", "", owner, this.problemRequestor);
2753
		setWorkingCopyContents(
2754
			"package test;\n"+
2755
			"public class X {\n"+
2756
			"	public void bar() {\n"+
2757
			"    new Y<String>().foo(\"\");\n" +
2758
			"	}\n"+
2759
			"}\n"
2760
		);
2761
		this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, owner, null);
2762
2763
		assertProblems(
2764
			"Unexpected problems",
2765
			"----------\n" + 
2766
			"----------\n"
2767
		);
2768
	} finally {
2769
		if (workingCopy1 != null) {
2770
			workingCopy1.discardWorkingCopy();
2771
		}
2772
	}
2773
}
2774
/*
2732
 * Ensures that a working copy with a type with a dollar name can be reconciled without errors.
2775
 * Ensures that a working copy with a type with a dollar name can be reconciled without errors.
2733
 * (regression test for bug 117121 Can't create class called A$B in eclipse)
2776
 * (regression test for bug 117121 Can't create class called A$B in eclipse)
2734
 */
2777
 */
(-)model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java (-1 / +1 lines)
Lines 791-797 Link Here
791
					if (!nameStarted) {
791
					if (!nameStarted) {
792
						nameFragmentStart = this.namePos+1;
792
						nameFragmentStart = this.namePos+1;
793
						nameStarted = true;
793
						nameStarted = true;
794
					} else
794
					} else if (this.namePos > nameFragmentStart) // handle name starting with a $ (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=91709)
795
						identCount ++;
795
						identCount ++;
796
					break;
796
					break;
797
				case Signature.C_GENERIC_START :
797
				case Signature.C_GENERIC_START :

Return to bug 91709