Skip to content

Commit

Permalink
Merge pull request apache#2888 from JaroslavTulach/jtulach/NoErrorDia…
Browse files Browse the repository at this point in the history
…logs

Always display errors as an icon in bottom right corner
  • Loading branch information
geertjanw authored Apr 16, 2021
2 parents 34f693b + 5f2adec commit a390098
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
4 changes: 1 addition & 3 deletions platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,7 @@ public void actionPerformed(final java.awt.event.ActionEvent ev) {
*/
private static boolean shallNotify(Level level, boolean dialog) {
int minAlert = Integer.getInteger("netbeans.exception.alert.min.level", 900); // NOI18N
boolean assertionsOn = false;
assert assertionsOn = true;
int defReport = assertionsOn ? 900 : 1001;
int defReport = 1001;
int minReport = Integer.getInteger("netbeans.exception.report.min.level", defReport); // NOI18N

if (dialog) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,14 @@ protected void setUp() throws Exception {
NotifyExcPanel.cleanInstance();
}

/**
* A simple test to ensure that error dialog window is not created modal
* until the MainWindow is visible.
*/
public void testNoModalErrorDialog() throws Exception {
public void testNoErrorDialog() throws Exception {
Frame mainWindow = WindowManager.getDefault().getMainWindow();
final JDialog modalDialog = new HiddenDialog( mainWindow, true );
DD.toReturn = modalDialog;

Logger.global.log(Level.WARNING, "Something is wrong", new NullPointerException("npe"));
waitEQ();
assertNotNull("Really returned", DD.lastDescriptor);
assertEquals("It is DialogDescriptor", DialogDescriptor.class, DD.lastDescriptor.getClass());
DialogDescriptor dd = (DialogDescriptor)DD.lastDescriptor;
assertFalse( "The request is for non-modal dialog", dd.isModal());
assertFalse("Main window is not visible", mainWindow.isVisible());
assertNull("No dialog shown", DD.lastDescriptor);
}

public void testExceptionWillGetTheLevelFromAnnoatation() throws Exception {
Expand All @@ -110,8 +102,7 @@ public void testExceptionWillGetTheLevelFromAnnoatation() throws Exception {
Exceptions.printStackTrace(npe);

waitEQ();
assertNotNull("We are going to display a warning", DD.lastDescriptor);

assertNull("No dialogs shown", DD.lastDescriptor);
}

public void testDirectlyLoggingAnExceptionWithALocalizedMessageAndTheRightLevelShowsItInADialog() throws Exception {
Expand Down

0 comments on commit a390098

Please sign in to comment.