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 59893 - The fire method in event source should be generated with throws statement
Summary: The fire method in event source should be generated with throws statement
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Beans (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-13 11:58 UTC by Jiri Prox
Modified: 2010-09-23 08:35 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 Jiri Prox 2005-06-13 11:58:08 UTC
The fire method of event source shoud contains throws statement if the
appropriate method of the listener can thow exception. Otherwise in the
generated code there is error announcing uncatched exception.
Example: 

private void 
fireVetoableChangeListenerVetoableChange(java.beans.PropertyChangeEvent event) {
  if (vetoableChangeListener == null) return;
  vetoableChangeListener.vetoableChange(event);
}

The vetoableChange(event) throws the PropertyVetoException so the generated code
should look like this:


private void
fireVetoableChangeListenerVetoableChange(java.beans.PropertyChangeEvent event)
throws java.beans.PropertyVetoException {

        if (vetoableChangeListener == null) return;
        vetoableChangeListener.vetoableChange(event);
    }