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

(-)src/org/eclipse/jdt/core/tests/eval/DebugEvaluationTest.java (+50 lines)
Lines 3868-3873 Link Here
3868
		removeTempClass("A62");
3868
		removeTempClass("A62");
3869
	}
3869
	}
3870
}
3870
}
3871
public void test066() {
3872
	if (this.complianceLevel < ClassFileConstants.JDK1_5) return;
3873
	try {
3874
		String sourceA66 =
3875
			"public class A66 {\n"
3876
				+ "\tprivate int i;\n"
3877
				+ "\tpublic A66() {;\n"
3878
				+ "\t}\n"
3879
				+ "\tprivate <U> int foo(int i) {;\n"
3880
				+ "\t\treturn i;\n"    
3881
				+ "\t}\n"               
3882
				+ "\tpublic void bar() {\n"
3883
				+ "\t}\n"
3884
				+ "}";
3885
		compileAndDeploy15(sourceA66, "A66");
3886
3887
		String userCode = "new A66().bar();";
3888
		JDIStackFrame stackFrame =
3889
			new JDIStackFrame(this.jdiVM, this, userCode, "A66", "bar", -1);
3890
3891
		DebugRequestor requestor = new DebugRequestor();
3892
		char[] snippet = "return this.<Object>foo(3);".toCharArray();
3893
		try {
3894
			context.evaluate(
3895
				snippet,
3896
				stackFrame.localVariableTypeNames(),
3897
				stackFrame.localVariableNames(),
3898
				stackFrame.localVariableModifiers(),
3899
				stackFrame.declaringTypeName(),
3900
				stackFrame.isStatic(),
3901
				stackFrame.isConstructorCall(),
3902
				getEnv(),
3903
				getCompilerOptions(),
3904
				requestor,
3905
				getProblemFactory());
3906
		} catch (InstallException e) {
3907
			assertTrue("No targetException " + e.getMessage(), false);
3908
		}
3909
		assertTrue(
3910
			"Should get one result but got " + (requestor.resultIndex + 1),
3911
			requestor.resultIndex == 0);
3912
		EvaluationResult result = requestor.results[0];
3913
		assertTrue("Code snippet should not have problems", !result.hasProblems());
3914
		assertTrue("Result should have a value", result.hasValue());
3915
		assertEquals("Value", "3".toCharArray(), result.getValueDisplayString());
3916
		assertEquals("Type", "int".toCharArray(), result.getValueTypeName());
3917
	} finally {
3918
		removeTempClass("A66");
3919
	}
3920
}
3871
/**
3921
/**
3872
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=178861
3922
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=178861
3873
 */
3923
 */

Return to bug 235774