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 15487 - Executor.execute(DataObject) -> IOException: loc ann ignored
Summary: Executor.execute(DataObject) -> IOException: loc ann ignored
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: anovak
URL:
Keywords:
: 9676 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-09-13 23:08 UTC by Jesse Glick
Modified: 2008-12-22 21:49 UTC (History)
0 users

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 Jesse Glick 2001-09-13 23:08:53 UTC
[dev sep 12] Localized annotations to IOException's thrown from
Executor.execute(DataObject) are not politely displayed to the user by
the "Incorrect Configuration" dialog: the unlocalized detail message
is shown instead. The ErrorManager correctly displays the annotation
in the log file. ExecSupport.choose should be EM-aware, and it is not.
Comment 1 Jan Zajicek 2001-09-14 08:22:04 UTC
Assigning to Ales.
Comment 2 anovak 2001-09-18 13:51:24 UTC
I do not understand the problem - what should ExecSupport.choose do?
As far as I see it notifies the exception to ErrorManager and it
displays the dialog with ex.getLocalizedMessage().
Comment 3 Jesse Glick 2001-09-19 14:06:14 UTC
Notifying the exception to ErrorManager is fine (since it is using
INFORMATIONAL meaning an average user will not see it). But an
exception thrown using the recommended idiom:
----%<----
IOException ioe = new IOException("simple message for developer: " +
param);
String nicemsg = NbBundle.getMessage(This.class,
"EXC_problem_with_exec", param);
TopManager.getDefault().getErrorManager().annotate(ioe, nicemsg);
throw ioe;
----%<----
will display the unlocalized detail message. It should be displaying
the localized annotation. See also my [PENDING] comment in this code
which points out that it will currently display a bare class name if a
ClassNotFoundException is thrown! This is clearly wrong. Either the
localized annotation should be extracted using EM's API and shown in a
NotifyDescriptor.Message; or ND.Exception should be used but its
message should be left as the default (and make sure NB.Exception does
the extraction of a localized message correctly). If there is no
localized annotation (e.g. random CNFE), the dialog should just say
there was an unexpected problem (and perhaps the notification of the
exception should be done at EXCEPTION level since this means there was
a bug in the code and it should be reported).
Comment 4 anovak 2001-09-20 14:32:55 UTC
OK, I partially fixed it - instead of just setting
ex.getLocalizedMessage, I am trying to find an Annotation first.
So, the "recommended idiom" should started to work.

I tried to notify any exception without annotations at EXCEPTION
level, but it means that you will see two dialogs at a time - one with
the exception and the second is the "configure" dialog. It does not
seem very well and I am nearly sure that UI folks would not be happy.

One way how to got an exception that has not any annotations is just
to cripple External Executor which gives something like:
java.io.IOException: fg/home2/ales/java/jdk/jdk1.3.1-fcs/jre/bin/java:
not found
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:54)
        at java.lang.Runtime.execInternal(Native Method)
        at java.lang.Runtime.exec(Runtime.java:551)
        ...

I think that we need to extend the "configure" dialog to have an
option to show the exception, which is pretty difficult anyway - if
you want to stay consistent with the classic dialog for displaying
exceptions you must use core.output.OutPane, while NotifyDescriptor is
implemented in openide ...

This is probably a task for UI engineers.

Marking as fixed for now, though, I feel that it is not perfect.

http://www.netbeans.org/source/browse/openide/src/org/openide/loaders/ExecSupport.java.diff?r1=1.43&r2=1.44
Comment 5 Jesse Glick 2001-09-21 10:46:26 UTC
Agreed this is good enough for now; the ideal behavior would be that
the dialog as shown by ErrorManager.notify(Throwable) would be shown,
with all related details such as showing the correct error level, user
annotations, options for stack trace, etc.; and ExecSupport would
simply add to this the "Configure..." button. Unfortunately as you say
the APIs do not permit that for now, and showing two dialogs would be
unpleasant, so this is problem the best workaround.
Comment 6 rmatous 2001-11-22 09:13:10 UTC
*** Issue 9676 has been marked as a duplicate of this issue. ***
Comment 7 Quality Engineering 2003-07-01 16:02:35 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified
Comment 8 Quality Engineering 2003-07-01 16:22:27 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.