Skip to content

Conversation

@RoiSoleil
Copy link

Fix #693

@RoiSoleil
Copy link
Author

@iloveeclipse @gayanper

@iloveeclipse
Copy link
Member

@RoiSoleil : the test fails:

org.eclipse.jdt.debug.tests.eval.LambdaVariableTest.testEvaluate_Bug567801_VariableWithIntersectionTypeArgument_MustEvaluationWithCorrectType
The evaluation of '" + snippet + "'  should not have errors : [T cannot be resolved to a type, This lambda expression refers to the missing type T]

@RoiSoleil
Copy link
Author

To fix this test fail i need to specify the generic method type in RemoteEvaluatorBuilder#build but there is no API on IEvaluationContext to do so. Could you take a look because i'm not sure i can handle it ...

*/
if (genericSignature.startsWith(String.valueOf(Signature.C_TYPE_VARIABLE)) || genericSignature.startsWith(String.valueOf(Signature.C_CAPTURE))
if (genericSignature.startsWith(String.valueOf(Signature.C_TYPE_VARIABLE))) {
fixedSignature.append(genericSignature.substring(String.valueOf(Signature.C_TYPE_VARIABLE).length(), genericSignature.length() - 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you provide the value you get in the generic signature with your test case which you provided this fix for ?

@gayanper
Copy link
Contributor

gayanper commented May 8, 2025

To fix this test fail i need to specify the generic method type in RemoteEvaluatorBuilder#build but there is no API on IEvaluationContext to do so. Could you take a look because i'm not sure i can handle it ...

The idea of the original fix was to avoid using generic types like in the failing test scenario since we are unable to resolve them in debugger context. The reason is we are unable to parse the snippet in such a way where we can resolve generics.

So now with this fix, it seems the snippet might be ending up with a generic type which was not replaced, if you can debug the final snippet after applying the scanAndFixSignature invocation, We can find out what is happening.

@gayanper
Copy link
Contributor

gayanper commented May 8, 2025

@RoiSoleil thanks for coming up with a PR, it is really appreciated the time you put into coming up with this fix.

@RoiSoleil
Copy link
Author

In SourceBasedSourceGenerator#adddTypeParameters we deal with type parameter so it works for normal breakpoint but in CodeSnippetToCuMapper we cannot specify type parameters so it fails ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to set a conditional breakpoint in a method with a parameter using generic extends X

3 participants