@@ -120,16 +120,19 @@ private CompletableFuture<Value> evaluate(String expression, ThreadReference thr
120120
121121 ICompiledExpression compiledExpression = null ;
122122 ASTEvaluationEngine engine = new ASTEvaluationEngine (project , debugTarget );
123+ boolean newExpression = false ;
123124 if (breakpoint != null ) {
124125 if (StringUtils .isNotBlank (breakpoint .getLogMessage ())) {
125126 compiledExpression = (ICompiledExpression ) breakpoint .getCompiledLogpointExpression ();
126127 if (compiledExpression == null ) {
128+ newExpression = true ;
127129 compiledExpression = engine .getCompiledExpression (expression , stackframe );
128130 breakpoint .setCompiledLogpointExpression (compiledExpression );
129131 }
130132 } else {
131133 compiledExpression = (ICompiledExpression ) breakpoint .getCompiledConditionalExpression ();
132134 if (compiledExpression == null ) {
135+ newExpression = true ;
133136 compiledExpression = engine .getCompiledExpression (expression , stackframe );
134137 breakpoint .setCompiledConditionalExpression (compiledExpression );
135138 }
@@ -139,6 +142,18 @@ private CompletableFuture<Value> evaluate(String expression, ThreadReference thr
139142 }
140143
141144 if (compiledExpression .hasErrors ()) {
145+ if (!newExpression && breakpoint != null ) {
146+ if (StringUtils .isNotBlank (breakpoint .getLogMessage ())) {
147+ // for logpoint with compilation errors, don't send errors if it is already reported
148+ Value emptyValue = thread .virtualMachine ().mirrorOf ("" );
149+ completableFuture .complete (emptyValue );
150+ } else {
151+ // for conditional bp, report true to let breakpoint hit
152+ Value trueValue = thread .virtualMachine ().mirrorOf (true );
153+ completableFuture .complete (trueValue );
154+ }
155+ return completableFuture ;
156+ }
142157 completableFuture .completeExceptionally (AdapterUtils .createUserErrorDebugException (
143158 String .format ("Cannot evaluate because of compilation error(s): %s." ,
144159 StringUtils .join (compiledExpression .getErrorMessages (), "\n " )),
0 commit comments