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 5485

Summary: Serialize and Serialize As actions in the Customize dialog throw an exception
Product: platform Reporter: Jan Palka <janpalka>
Component: -- Other --Assignee: Jaroslav Tulach <jtulach>
Status: CLOSED INVALID    
Severity: normal    
Priority: P4    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Jan Palka 2000-01-21 01:05:55 UTC
I do not know how to obtain the exception.  Only message box with a generic message (Exception occured ..) is shown.

[jglick] see #5719 also
Comment 1 Jaroslav Tulach 2000-06-28 15:25:59 UTC
Duplicated with #5719
Comment 2 Marek Grummich 2000-07-25 09:43:59 UTC
Priority is changed to P4 (normal).
Comment 3 Ivana Ladenbergerova 2001-01-25 15:15:59 UTC
comment from the user laurent.sauvage@forlog.fr


In Bean Customizer:
The Serialize As command fails to serialize a bean.
This because there's a PropertyChangeListener (probably Bean Customizer itself)
in the PropertyChangeSupport listener list that isn't serializable.
Imagine a bean extending standard JButton.
Because of PropertyChangeSupport changeSupport is not transient in Component.
All PropertyChangeListener must be serialized.

Sample failing code:
import java.beans.*;
import java.io.*;
import javax.swing.JButton;

public class ProgressionButton extends JButton implements java.io.Serializable {


    /** Creates new ProgressionButton */
    public ProgressionButton() {
    }

    public void addPropertyChangeListener(PropertyChangeListener listener)
    {
        super.addPropertyChangeSupport(listener);
    }
    public void removePropertyChangeListener(PropertyChangeListener listener)
    {
       super.removePropertyChangeSupport(listener);
    }
}
********************
this code fails to be serialized using BeanCustomizer.
simply put in comments calls to super methods so the ProgressionButton can be
serialized.
Comment 4 skmajji 2001-01-25 19:27:59 UTC
I checked this bug in the latest build and it looks like fixed, however it is
still appears in FFJ 2.0