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.
[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.
Assigning to Ales.
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().
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).
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
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.
*** Issue 9676 has been marked as a duplicate of this issue. ***
Resolved for 3.4.x or earlier, no new info since then -> verified
Resolved for 3.4.x or earlier, no new info since then -> closing.