This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 201275 - Message about breakpoint not printed to status bar when step into selection is confirmed
Summary: Message about breakpoint not printed to status bar when step into selection i...
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 7.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords: T9Y
Depends on:
Blocks:
 
Reported: 2011-08-24 11:01 UTC by Jiri Skrivanek
Modified: 2012-05-21 13:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2011-08-24 11:01:41 UTC
Message that debugger stopped at breakpoint is not printed to status bar when it is after selection for step into. To reproduce:

- create java project
- copy the following to main class

    public static void main(String[] args) {
        int i = m1() + m2();
    }

    public static int m1() {
        return 2;
    }

    public static int m2() {
        return 1;
    }

- put breakpoint to line with int i
- start debugger and wait until stops at breakpoint (check message is printed to status bar)
- press F7 (step into)
- press F7 once more. Debugger stops at one of methods but nothing is printed to status bar.

Product Version: NetBeans IDE Dev (Build 201108230601)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17
System: Windows XP version 5.1 running on x86; Cp1250; en_US (nb)
Comment 1 Martin Entlicher 2011-09-07 12:50:25 UTC
Reproduced. But I do not think that the bug is in debugger.
The problem is, that we use org.openide.awt.StatusDisplayer for some messages and org.netbeans.editor.Utilities for other messages.
StatusDisplayer.setStatusText() logs message with the default (0) importance, while Utilities.setStatusText() and Utilities.clearStatusText() uses "1" importance (see StatusBar.setText() method at line 519).
The result is that after Utilities.clearStatusText() is called, no messages are displayed till the "empty" clearing messages expires (after 5 seconds).

Debugger sets the status texts correctly, but the one empty status with higher importance prevents them from appearing.

Please note that I can not solve this by calling
Utilities.setStatusText(.., .., 0), since 0 importance is not accepted by StatusDisplayer.setStatusText(). IMHO Utilities.setStatusText() should use the 0 importance by default.

Moving to editor to evaluate why the 1 importance is used.
Comment 2 Jan Lahoda 2012-05-17 15:41:27 UTC
Lets see how this works (it works in the specified tests case, so the question is whether this will be enough for other typical usecases):
http://hg.netbeans.org/main-silver/rev/c3b763972342
Comment 3 Quality Engineering 2012-05-18 09:54:46 UTC
Integrated into 'main-golden', will be available in build *201205180400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c3b763972342
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #201275: clearing status bar message not by setting an empty message, but rather by actually removing the original message.