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 104477 - Provide signals to developers about exceptions appeared in wizard iterator design
Summary: Provide signals to developers about exceptions appeared in wizard iterator de...
Status: RESOLVED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: Dialogs&Wizards (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-22 08:48 UTC by Denis Anisimov
Modified: 2012-05-02 12:16 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Anisimov 2007-05-22 08:48:46 UTC
Here is part of code in WizardDescriptor ( method "public void
actionPerformed(ActionEvent ev)" ) :

       
                        Runnable performFinish = new Runnable () {
                            public void run () {
                                err.log (Level.FINE, "performFinish entry."); //
NOI18N
                                Object oldValue = getValue();
                                    
                                // do instantiate
                                try {
                                    callInstantiate();
                                    setValueWithoutPCH(OK_OPTION);
                                    resetWizard();
                                } catch (IOException ioe) 
                                    // notify to log
                                    err.log(Level.FINE, null, ioe);

                                    setValueWithoutPCH(NEXT_OPTION);
                                    updateStateWithFeedback();

                                    // notify user by the wizard's status line
                                    putProperty(PROP_ERROR_MESSAGE,
ioe.getLocalizedMessage());

                                    // if validation failed => cannot move to
next panel
                                    return;
                                } catch (RuntimeException x) {
                                    // notify to log
                                    err.log(Level.FINE, null, x);

                                    setValueWithoutPCH(NEXT_OPTION);
                                    updateStateWithFeedback();

                                    // notify user by the wizard's status line
                                    putProperty(PROP_ERROR_MESSAGE,
x.getLocalizedMessage());

                                    // if validation failed => cannot move to
next panel
                                    return;
                                }
                                firePropertyChange(PROP_VALUE, oldValue, OK_OPTION);
                                
                                SwingUtilities.invokeLater (new Runnable () {
                                    public void run () {
					System.out.println( "---------- inside run just before firing action-----" );
                                        // all is OK
                                        // close wizrad
                                        err.log (Level.FINE,
"WD.finishOption.fireActionPerformed()");
                                        finishOption.fireActionPerformed();
                                        err.log (Level.FINE, "Set value to
OK_OPTION.");
                                        setValue (OK_OPTION);
                                    }
                                });
                                err.log (Level.FINE, "performFinish exit."); //
NOI18N
                            }
                        };

You can see that all debug information here is put into log with level 
Level.FINE. This concerns also exceptions. 
It is very hard to understand where is the problem for developer of wizard 
iterator ( its own implementation ) without any signals pointed to this problem.
I think ALL exceptions should be shown via ErrorManager with exception level,
not just logged with Level.FINE. Because level Level.FINE is very low level and
one need to know about this level and set it specially.
Comment 1 Jiri Rechtacek 2007-05-22 13:31:42 UTC
A patch is welcome.
Comment 2 Denis Anisimov 2007-05-22 14:46:31 UTC
I am not sure what is the best practice in such cases but I would prefer
to use 
org.openide.ErrorManager.getDefault().notify(e);
instead of 
err.log(Level.FINE, null, ioe);

in each "catch" block .
Comment 3 Jiri Rechtacek 2007-05-22 16:08:57 UTC
Btw. ErrorManager is deprecated in NB6.0. Using java/logging is favoured. If I
have seen the only one place where a Runtime exception is logger on FINE level
is WizardDescriptor.resetWizard(). Maybe it could be logged as INFO but I guess
it cannot be interesting to Wizard.Iterator implementor.
Comment 4 Denis Anisimov 2007-05-23 09:02:29 UTC
Yes, you are right about ErrorManager.
I have missed this.
Ok, so could you please just change log level Level.FINE to Level.SEVERE
in each place where exception is caught in the part of code under subject ?
I think this is acceptable minor change here.
Comment 5 Stanislav Aubrecht 2012-05-02 12:16:49 UTC
Exceptions are logged with WARNING level in recent builds, closing.