Community
Participate
Working Groups
build I20080603-2000 1) add the following method in DebugEvaluationTest.java public void test065() { if (this.complianceLevel < ClassFileConstants.JDK1_5) return; try { String sourceA65 = "public class A65<T> {\n" + "\tprivate int i;\n" + "\tpublic <U>A65() {;\n" + "\t}\n" + "\tprivate <U>A65(int i) {;\n" + "\t\tthis.i = i;\n" + "\t}\n" + "\tpublic void bar() {\n" + "\t}\n" + "}"; compileAndDeploy15(sourceA65, "A65"); String userCode = "new <Object>A65<Object>().bar();"; JDIStackFrame stackFrame = new JDIStackFrame(this.jdiVM, this, userCode, "A65", "bar", -1); DebugRequestor requestor = new DebugRequestor(); char[] snippet = "return new <Object>A65<Object>(3).i;".toCharArray(); try { context.evaluate( snippet, stackFrame.localVariableTypeNames(), stackFrame.localVariableNames(), stackFrame.localVariableModifiers(), stackFrame.declaringTypeName(), stackFrame.isStatic(), stackFrame.isConstructorCall(), getEnv(), getCompilerOptions(), requestor, getProblemFactory()); } catch (InstallException e) { assertTrue("No targetException " + e.getMessage(), false); } assertTrue( "Should get one result but got " + (requestor.resultIndex + 1), requestor.resultIndex == 0); EvaluationResult result = requestor.results[0]; assertTrue("Code snippet should not have problems", !result.hasProblems()); assertTrue("Result should have a value", result.hasValue()); assertEquals("Value", "3".toCharArray(), result.getValueDisplayString()); assertEquals("Type", "int".toCharArray(), result.getValueTypeName()); } finally { removeTempClass("A65"); } } 2) run this junit test The test fails If '<Object>' is removed from the snippet the test does not fail.
Created attachment 103709 [details] DebugEvaluationTest.test065()
Closing as a duplicate of bug 235783. 235783 is a more generic bug that covers this case. *** This bug has been marked as a duplicate of bug 235783 ***