You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Maxim Berkultsev (JIRA)" <ji...@apache.org> on 2006/04/28 11:13:38 UTC
[jira] Created: (HARMONY-420) improper listener notification in
java.beans.VetoableChangeSupport
improper listener notification in java.beans.VetoableChangeSupport
------------------------------------------------------------------
Key: HARMONY-420
URL: http://issues.apache.org/jira/browse/HARMONY-420
Project: Harmony
Type: Bug
Components: Classlib
Environment: Harmony Class Library, J9
Reporter: Maxim Berkultsev
Priority: Minor
VetoableChangeSupport functionality is not covered completely
Following test code is under examination
----------------------------------------------
import java.beans.*;
public class VetoableChangeSupportTest {
private VetoableChangeSupport support = new VetoableChangeSupport(this);
private PropertyChangeEvent event;
private String vetoedPropertyName = "property1";
private Integer basicOldValue = new Integer(1);
private Integer basicNewValue = new Integer(2);
public static void main(String[] args) {
new VetoableChangeSupportTest().run();
}
void run(){
support.addVetoableChangeListener(new VetoableChangeListener() {
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
event = e;
String propertyName = e.getPropertyName();
Integer oldValue = (Integer) e.getOldValue();
Integer newValue = (Integer) e.getNewValue();
System.out.println("in the first listener with property named = "
+ propertyName
+ " and old value = "
+ oldValue
+ " and new value = "
+ newValue
);
if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicNewValue)) {
System.out.println("in the first listener with property named = "
+ propertyName
+ " and old value = "
+ oldValue
+ " and new value = "
+ newValue
+ " exception is thrown"
);
throw new PropertyVetoException(propertyName + " change is vetoed.", e);
}
}
});
support.addVetoableChangeListener(new VetoableChangeListener() {
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
event = e;
String propertyName = e.getPropertyName();
Integer oldValue = (Integer) e.getOldValue();
Integer newValue = (Integer) e.getNewValue();
System.out.println("in the second listener with property named = "
+ propertyName
+ " and old value = "
+ oldValue
+ " and new value = "
+ newValue
);
if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicOldValue)) {
System.out.println("in the second listener with property named = "
+ propertyName
+ " and old value = "
+ oldValue
+ " and new value = "
+ newValue
+ " exception is thrown"
);
throw new PropertyVetoException(propertyName + " change is vetoed.", e);
}
}
});
try {
support.fireVetoableChange(vetoedPropertyName, basicNewValue, basicOldValue);
} catch(PropertyVetoException pve) {
System.out.println("PropertyVetoException is finally thrown.");
}
}
}
----------------------------------------------
For j9 + ClassLib the output of the test is
in the first listener with property named = property1 and old value = 2 and new value = 1
in the second listener with property named = property1 and old value = 2 and new value = 1
in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown
in the first listener with property named = property1 and old value = 1 and new value = 2
in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown
PropertyVetoException is finally thrown.
For RI
in the first listener with property named = property1 and old value = 2 and new value = 1
in the second listener with property named = property1 and old value = 2 and new value = 1
in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown
in the first listener with property named = property1 and old value = 1 and new value = 2
in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown
in the second listener with property named = property1 and old value = 1 and new value = 2
PropertyVetoException is finally thrown.
Looks like the second listener is not notified after the PropertyVetoException is thrown for the second time
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-420) improper listener notification in
java.beans.VetoableChangeSupport
Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-420?page=comments#action_12434954 ]
Alexey Petrenko commented on HARMONY-420:
-----------------------------------------
Patch is still applicable.
> improper listener notification in java.beans.VetoableChangeSupport
> ------------------------------------------------------------------
>
> Key: HARMONY-420
> URL: http://issues.apache.org/jira/browse/HARMONY-420
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Harmony Class Library, J9
> Reporter: Maxim Berkultsev
> Priority: Minor
> Attachments: diff
>
>
> VetoableChangeSupport functionality is not covered completely
> Following test code is under examination
> ----------------------------------------------
> import java.beans.*;
> public class VetoableChangeSupportTest {
>
> private VetoableChangeSupport support = new VetoableChangeSupport(this);
>
> private PropertyChangeEvent event;
>
> private String vetoedPropertyName = "property1";
>
> private Integer basicOldValue = new Integer(1);
> private Integer basicNewValue = new Integer(2);
>
> public static void main(String[] args) {
> new VetoableChangeSupportTest().run();
> }
> void run(){
> support.addVetoableChangeListener(new VetoableChangeListener() {
> public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
> event = e;
> String propertyName = e.getPropertyName();
>
> Integer oldValue = (Integer) e.getOldValue();
> Integer newValue = (Integer) e.getNewValue();
>
> System.out.println("in the first listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> );
>
>
> if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicNewValue)) {
> System.out.println("in the first listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> + " exception is thrown"
> );
> throw new PropertyVetoException(propertyName + " change is vetoed.", e);
> }
> }
> });
>
> support.addVetoableChangeListener(new VetoableChangeListener() {
> public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
> event = e;
> String propertyName = e.getPropertyName();
>
> Integer oldValue = (Integer) e.getOldValue();
> Integer newValue = (Integer) e.getNewValue();
>
> System.out.println("in the second listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> );
>
> if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicOldValue)) {
> System.out.println("in the second listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> + " exception is thrown"
> );
> throw new PropertyVetoException(propertyName + " change is vetoed.", e);
> }
> }
> });
>
> try {
> support.fireVetoableChange(vetoedPropertyName, basicNewValue, basicOldValue);
> } catch(PropertyVetoException pve) {
> System.out.println("PropertyVetoException is finally thrown.");
> }
> }
>
> }
> ----------------------------------------------
> For j9 + ClassLib the output of the test is
> in the first listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown
> in the first listener with property named = property1 and old value = 1 and new value = 2
> in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown
> PropertyVetoException is finally thrown.
> For RI
> in the first listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown
> in the first listener with property named = property1 and old value = 1 and new value = 2
> in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown
> in the second listener with property named = property1 and old value = 1 and new value = 2
> PropertyVetoException is finally thrown.
> Looks like the second listener is not notified after the PropertyVetoException is thrown for the second time
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (HARMONY-420) [classlib][beans]improper listener
notification in java.beans.VetoableChangeSupport
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-420?page=all ]
Paulex Yang resolved HARMONY-420.
---------------------------------
Resolution: Fixed
Mikhail and Alexey, patch applied at revision r448773, thanks a lot to look at this.
Maxim, please verify the problem is fully resolved as you expected, thank you.
> [classlib][beans]improper listener notification in java.beans.VetoableChangeSupport
> -----------------------------------------------------------------------------------
>
> Key: HARMONY-420
> URL: http://issues.apache.org/jira/browse/HARMONY-420
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Harmony Class Library, J9
> Reporter: Maxim Berkultsev
> Assigned To: Paulex Yang
> Priority: Minor
> Attachments: diff
>
>
> VetoableChangeSupport functionality is not covered completely
> Following test code is under examination
> ----------------------------------------------
> import java.beans.*;
> public class VetoableChangeSupportTest {
>
> private VetoableChangeSupport support = new VetoableChangeSupport(this);
>
> private PropertyChangeEvent event;
>
> private String vetoedPropertyName = "property1";
>
> private Integer basicOldValue = new Integer(1);
> private Integer basicNewValue = new Integer(2);
>
> public static void main(String[] args) {
> new VetoableChangeSupportTest().run();
> }
> void run(){
> support.addVetoableChangeListener(new VetoableChangeListener() {
> public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
> event = e;
> String propertyName = e.getPropertyName();
>
> Integer oldValue = (Integer) e.getOldValue();
> Integer newValue = (Integer) e.getNewValue();
>
> System.out.println("in the first listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> );
>
>
> if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicNewValue)) {
> System.out.println("in the first listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> + " exception is thrown"
> );
> throw new PropertyVetoException(propertyName + " change is vetoed.", e);
> }
> }
> });
>
> support.addVetoableChangeListener(new VetoableChangeListener() {
> public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
> event = e;
> String propertyName = e.getPropertyName();
>
> Integer oldValue = (Integer) e.getOldValue();
> Integer newValue = (Integer) e.getNewValue();
>
> System.out.println("in the second listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> );
>
> if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicOldValue)) {
> System.out.println("in the second listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> + " exception is thrown"
> );
> throw new PropertyVetoException(propertyName + " change is vetoed.", e);
> }
> }
> });
>
> try {
> support.fireVetoableChange(vetoedPropertyName, basicNewValue, basicOldValue);
> } catch(PropertyVetoException pve) {
> System.out.println("PropertyVetoException is finally thrown.");
> }
> }
>
> }
> ----------------------------------------------
> For j9 + ClassLib the output of the test is
> in the first listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown
> in the first listener with property named = property1 and old value = 1 and new value = 2
> in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown
> PropertyVetoException is finally thrown.
> For RI
> in the first listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown
> in the first listener with property named = property1 and old value = 1 and new value = 2
> in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown
> in the second listener with property named = property1 and old value = 1 and new value = 2
> PropertyVetoException is finally thrown.
> Looks like the second listener is not notified after the PropertyVetoException is thrown for the second time
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-420) [classlib][beans]improper listener
notification in java.beans.VetoableChangeSupport
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-420?page=all ]
Paulex Yang updated HARMONY-420:
--------------------------------
Summary: [classlib][beans]improper listener notification in java.beans.VetoableChangeSupport (was: improper listener notification in java.beans.VetoableChangeSupport)
Assignee: Paulex Yang
> [classlib][beans]improper listener notification in java.beans.VetoableChangeSupport
> -----------------------------------------------------------------------------------
>
> Key: HARMONY-420
> URL: http://issues.apache.org/jira/browse/HARMONY-420
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Harmony Class Library, J9
> Reporter: Maxim Berkultsev
> Assigned To: Paulex Yang
> Priority: Minor
> Attachments: diff
>
>
> VetoableChangeSupport functionality is not covered completely
> Following test code is under examination
> ----------------------------------------------
> import java.beans.*;
> public class VetoableChangeSupportTest {
>
> private VetoableChangeSupport support = new VetoableChangeSupport(this);
>
> private PropertyChangeEvent event;
>
> private String vetoedPropertyName = "property1";
>
> private Integer basicOldValue = new Integer(1);
> private Integer basicNewValue = new Integer(2);
>
> public static void main(String[] args) {
> new VetoableChangeSupportTest().run();
> }
> void run(){
> support.addVetoableChangeListener(new VetoableChangeListener() {
> public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
> event = e;
> String propertyName = e.getPropertyName();
>
> Integer oldValue = (Integer) e.getOldValue();
> Integer newValue = (Integer) e.getNewValue();
>
> System.out.println("in the first listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> );
>
>
> if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicNewValue)) {
> System.out.println("in the first listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> + " exception is thrown"
> );
> throw new PropertyVetoException(propertyName + " change is vetoed.", e);
> }
> }
> });
>
> support.addVetoableChangeListener(new VetoableChangeListener() {
> public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
> event = e;
> String propertyName = e.getPropertyName();
>
> Integer oldValue = (Integer) e.getOldValue();
> Integer newValue = (Integer) e.getNewValue();
>
> System.out.println("in the second listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> );
>
> if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicOldValue)) {
> System.out.println("in the second listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> + " exception is thrown"
> );
> throw new PropertyVetoException(propertyName + " change is vetoed.", e);
> }
> }
> });
>
> try {
> support.fireVetoableChange(vetoedPropertyName, basicNewValue, basicOldValue);
> } catch(PropertyVetoException pve) {
> System.out.println("PropertyVetoException is finally thrown.");
> }
> }
>
> }
> ----------------------------------------------
> For j9 + ClassLib the output of the test is
> in the first listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown
> in the first listener with property named = property1 and old value = 1 and new value = 2
> in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown
> PropertyVetoException is finally thrown.
> For RI
> in the first listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown
> in the first listener with property named = property1 and old value = 1 and new value = 2
> in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown
> in the second listener with property named = property1 and old value = 1 and new value = 2
> PropertyVetoException is finally thrown.
> Looks like the second listener is not notified after the PropertyVetoException is thrown for the second time
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-420) improper listener notification in
java.beans.VetoableChangeSupport
Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-420?page=all ]
Mikhail Fursov updated HARMONY-420:
-----------------------------------
Attachment: diff
Here is a diff with bugfix and minimimized testcase
Note that the command 'ant -Dbuild.module beans test' does not run org.apache.harmony.beans.tests.java.beans testsuite by some unknown reason..
> improper listener notification in java.beans.VetoableChangeSupport
> ------------------------------------------------------------------
>
> Key: HARMONY-420
> URL: http://issues.apache.org/jira/browse/HARMONY-420
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Harmony Class Library, J9
> Reporter: Maxim Berkultsev
> Priority: Minor
> Attachments: diff
>
>
> VetoableChangeSupport functionality is not covered completely
> Following test code is under examination
> ----------------------------------------------
> import java.beans.*;
> public class VetoableChangeSupportTest {
>
> private VetoableChangeSupport support = new VetoableChangeSupport(this);
>
> private PropertyChangeEvent event;
>
> private String vetoedPropertyName = "property1";
>
> private Integer basicOldValue = new Integer(1);
> private Integer basicNewValue = new Integer(2);
>
> public static void main(String[] args) {
> new VetoableChangeSupportTest().run();
> }
> void run(){
> support.addVetoableChangeListener(new VetoableChangeListener() {
> public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
> event = e;
> String propertyName = e.getPropertyName();
>
> Integer oldValue = (Integer) e.getOldValue();
> Integer newValue = (Integer) e.getNewValue();
>
> System.out.println("in the first listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> );
>
>
> if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicNewValue)) {
> System.out.println("in the first listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> + " exception is thrown"
> );
> throw new PropertyVetoException(propertyName + " change is vetoed.", e);
> }
> }
> });
>
> support.addVetoableChangeListener(new VetoableChangeListener() {
> public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
> event = e;
> String propertyName = e.getPropertyName();
>
> Integer oldValue = (Integer) e.getOldValue();
> Integer newValue = (Integer) e.getNewValue();
>
> System.out.println("in the second listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> );
>
> if(propertyName.equals(vetoedPropertyName) && newValue.equals(basicOldValue)) {
> System.out.println("in the second listener with property named = "
> + propertyName
> + " and old value = "
> + oldValue
> + " and new value = "
> + newValue
> + " exception is thrown"
> );
> throw new PropertyVetoException(propertyName + " change is vetoed.", e);
> }
> }
> });
>
> try {
> support.fireVetoableChange(vetoedPropertyName, basicNewValue, basicOldValue);
> } catch(PropertyVetoException pve) {
> System.out.println("PropertyVetoException is finally thrown.");
> }
> }
>
> }
> ----------------------------------------------
> For j9 + ClassLib the output of the test is
> in the first listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown
> in the first listener with property named = property1 and old value = 1 and new value = 2
> in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown
> PropertyVetoException is finally thrown.
> For RI
> in the first listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1
> in the second listener with property named = property1 and old value = 2 and new value = 1 exception is thrown
> in the first listener with property named = property1 and old value = 1 and new value = 2
> in the first listener with property named = property1 and old value = 1 and new value = 2 exception is thrown
> in the second listener with property named = property1 and old value = 1 and new value = 2
> PropertyVetoException is finally thrown.
> Looks like the second listener is not notified after the PropertyVetoException is thrown for the second time
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira