Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317373 - [breakpoints] Compile errors shown when running conditional breakpoint when there are none
Summary: [breakpoints] Compile errors shown when running conditional breakpoint when t...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-19 19:34 EDT by Francis Upton IV CLA
Modified: 2020-03-17 18:03 EDT (History)
2 users (show)

See Also:


Attachments
Shot of compile errors (514.26 KB, image/png)
2010-06-19 19:35 EDT, Francis Upton IV CLA
no flags Details
Conditional breakpoint code (347.79 KB, image/png)
2010-06-19 19:37 EDT, Francis Upton IV CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Upton IV CLA 2010-06-19 19:34:22 EDT
I20100608-0911

1. Added a condition to a breakpoint (see screenshot)
2. Resumed execution

Bug: It showed a huge dialog with a bunch of compiler "errors" (see screenshot) which I think were not even valid. There is nothing wrong with the condition in the breakpoint.

The compiler errors complain about the final field XXX may not be initialized. But these errors are wrong, all of the static fields are initialized, for example:

    private static final Log _log = LoggerSupport.makeLogger();

I'm not sure if you will be able to reproduce this as I had been working for a while, so something might have gotten messed up.

I will file a separate bug about the size of the dialog.
Comment 1 Francis Upton IV CLA 2010-06-19 19:35:00 EDT
Created attachment 172282 [details]
Shot of compile errors
Comment 2 Francis Upton IV CLA 2010-06-19 19:37:04 EDT
Created attachment 172284 [details]
Conditional breakpoint code
Comment 3 Francis Upton IV CLA 2010-06-19 19:49:09 EDT
And the problem was still there after restarting Eclipse.

Then I built clean and the problem was still there (with the existing breakpoint).

Then I deleted and readded the breakpoint (in the same debug session), problem still there.

Then started another debug session, and the problem is still there.

So it seems I can reproduce this at will. If you can't reproduce this and need me to try and debug this, I will be happy to, if you give me some help in where to look.
Comment 4 Markus Keller CLA 2015-05-04 11:11:34 EDT
I can reproduce this with similar errors as shown in bug 317374 by creating a breakpoint at the first body line of org.eclipse.jdt.internal.ui.JavaPluginImages.createImageDescriptor(Bundle, IPath, boolean) with condition:

    url.toString().contains("new_testcase")

The condition doesn't make sense there because there's no variable "url", but I don't see why that should result in so many compile errors.

When I use an applicable condition, then everything's fine. E.g.:

    !bundle.equals(JavaPlugin.getDefault().getBundle())
Comment 5 Markus Keller CLA 2015-05-04 13:14:24 EDT
First problem is that SourceBasedSourceGenerator#buildFieldDeclaration(..) creates fields without an initializer where it should create a constant field. Note that just removing the "final" modifiers would create trouble in other situations.

Second problem is that ASTInstructionCompiler#visit(MethodInvocation) adds all problem messages, which easily overruns the dialog's capacity. It should only add messages that overlap the snippet range (like ASTEvaluationEngine#createExpressionFromAST(..)).
Comment 6 Eclipse Genie CLA 2020-03-17 18:03:26 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.