Community
Participate
Working Groups
Build Identifier: I20100608-0911 Eclipse currently contains two eveluation engines: LocalEvaluationEngine and ASTEvaluationEngine. Both use CodeSnippetToCuMapper to generate a "__run" method that contains the snippet to be evaluated. The problem is that this __run method always has return type "void". For ASTEvaluationEngine this is not a problem. When parsing the AST, the resulting typing error (void methods cannot return a value) is simply ignored. (see ASTEvaluationEngine.createExpressionFromAST(..), line 410) For LocalEvaluationEngine, however, this typing error seems fatal. Due to the error, no ClassFile gets ever generated for the snippet. I wonder whether I am missing something or if LocalEvaluationEngine ever worked? Can somebody clarify this? Thanks! Reproducible: Always Steps to Reproduce: n/a
The local evaluation uses JDT Core evaluation APIs to create and deploy class files locally. @see org.eclipse.jdt.core.eval.IEvaluationContext
(In reply to comment #1) > The local evaluation uses JDT Core evaluation APIs to create and deploy class > files locally. @see org.eclipse.jdt.core.eval.IEvaluationContext Hi Darin. Thanks for your comment. I am afraid I don't quite understand. Are you saying that (a) this is a not a bug for JDT/debug but rather for JDT/core or are you saying that (b) this is not a bug at all? I did not find the comments in IEvaluationContext to be helpful because they do not address the issue that I described. (no class file generated)
This is not a bug. Class files are created/compiled and deployed locally. The API used is: org.eclipse.jdt.core.eval.IEvaluationContext.evaluateCodeSnippet(String, String[], String[], int[], IType, boolean, boolean, ICodeSnippetRequestor, IProgressMonitor) The ICodeSnippetRequestor passed into the evaluation is called back with the class files that get deployed: org.eclipse.jdt.core.eval.ICodeSnippetRequestor.acceptClassFiles(byte[][], String[][], String)