You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Dmitry M. Kononov (JIRA)" <ji...@apache.org> on 2006/04/18 09:22:17 UTC
[jira] Created: (HARMONY-370)
BeanContextSupport.vetoableChange(...) does not throw NullPointerException
BeanContextSupport.vetoableChange(...) does not throw NullPointerException
--------------------------------------------------------------------------
Key: HARMONY-370
URL: http://issues.apache.org/jira/browse/HARMONY-370
Project: Harmony
Type: Bug
Components: Classlib
Reporter: Dmitry M. Kononov
Priority: Minor
Attachments: BeanContextSupport.java.diff, BeanContextSupportTest.java
Problem details:
java.beans.beancontext.BeanContextSupport.vetoableChange(PropertyChangeEvent pce):
Harmony does not throw NullPointerException when pce=null, while RI throws it.
Specification does not mention NullPointerException.
JUnit test to reproduce the problem:
import junit.framework.TestCase;
import java.beans.beancontext.BeanContextSupport;
import java.beans.PropertyVetoException;
public class BeanContextSupportTest extends TestCase {
public void test_vetoableChangeLjava_beans_PropertyChangeEvent() {
BeanContextSupport obj = new BeanContextSupport();
boolean b = true;
try {
obj.vetoableChange(null);
b = false;
}
catch (PropertyVetoException p) {
p.printStackTrace();
b = false;
}
catch (NullPointerException t) {
t.printStackTrace();
}
assertTrue(b);
}
}
RI output:
java.lang.NullPointerException
at java.beans.beancontext.BeanContextSupport.vetoableChange(BeanContextSupport.java:1063)
at BeanContextSupportTest.test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest.java:15)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at junit.textui.TestRunner.start(TestRunner.java:172)
at junit.textui.TestRunner.main(TestRunner.java:138)
HARMONY output:
java version 1.4.2 (subset)
.F
Time: 0.015
There was 1 failure:
1) test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest)junit.framework.AssertionFailedError
at BeanContextSupportTest.test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest.java:25)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:211)
FAILURES!!!
Tests run: 1, Failures: 1, Errors: 0
--
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-370)
BeanContextSupport.vetoableChange(...) does not throw NullPointerException
Posted by "Dmitry M. Kononov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-370?page=all ]
Dmitry M. Kononov updated HARMONY-370:
--------------------------------------
Attachment: BeanContextSupportTest.java
BeanContextSupport.java.diff
A test case and a patch are attached.
> BeanContextSupport.vetoableChange(...) does not throw NullPointerException
> --------------------------------------------------------------------------
>
> Key: HARMONY-370
> URL: http://issues.apache.org/jira/browse/HARMONY-370
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Dmitry M. Kononov
> Priority: Minor
> Attachments: BeanContextSupport.java.diff, BeanContextSupportTest.java
>
> Problem details:
> java.beans.beancontext.BeanContextSupport.vetoableChange(PropertyChangeEvent pce):
> Harmony does not throw NullPointerException when pce=null, while RI throws it.
> Specification does not mention NullPointerException.
> JUnit test to reproduce the problem:
> import junit.framework.TestCase;
> import java.beans.beancontext.BeanContextSupport;
> import java.beans.PropertyVetoException;
> public class BeanContextSupportTest extends TestCase {
> public void test_vetoableChangeLjava_beans_PropertyChangeEvent() {
> BeanContextSupport obj = new BeanContextSupport();
> boolean b = true;
> try {
> obj.vetoableChange(null);
> b = false;
> }
> catch (PropertyVetoException p) {
> p.printStackTrace();
> b = false;
> }
> catch (NullPointerException t) {
> t.printStackTrace();
> }
> assertTrue(b);
>
>
> }
> }
> RI output:
> java.lang.NullPointerException
> at java.beans.beancontext.BeanContextSupport.vetoableChange(BeanContextSupport.java:1063)
> at BeanContextSupportTest.test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest.java:15)
> at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
> at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at junit.textui.TestRunner.doRun(TestRunner.java:116)
> at junit.textui.TestRunner.start(TestRunner.java:172)
> at junit.textui.TestRunner.main(TestRunner.java:138)
> HARMONY output:
> java version 1.4.2 (subset)
> .F
> Time: 0.015
> There was 1 failure:
> 1) test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest)junit.framework.AssertionFailedError
> at BeanContextSupportTest.test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest.java:25)
> at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:211)
> FAILURES!!!
> Tests run: 1, Failures: 1, Errors: 0
--
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-370)
BeanContextSupport.vetoableChange(...) does not throw NullPointerException
Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-370?page=comments#action_12374873 ]
Mark Hindess commented on HARMONY-370:
--------------------------------------
Dmitry,
This test works, but perhaps the failures cases could be made more informative. Also we discussed letting junit handle unexpected exceptions. Perhaps something like:
public void test_vetoableChangeLjava_beans_PropertyChangeEvent() throws PropertyVetoException {
BeanContextSupport obj = new BeanContextSupport();
try {
obj.vetoableChange(null);
fail("obj.vetoableChange(null); should throw NullPointerException");
} catch (NullPointerException t) {
// expected
}
}
}
I've not tested this - just typed it straight in to my browser. I'd also remove the verbose stack trace from the code path where the test passes.
> BeanContextSupport.vetoableChange(...) does not throw NullPointerException
> --------------------------------------------------------------------------
>
> Key: HARMONY-370
> URL: http://issues.apache.org/jira/browse/HARMONY-370
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Dmitry M. Kononov
> Priority: Minor
> Attachments: BeanContextSupport.java.diff, BeanContextSupportTest.java
>
> Problem details:
> java.beans.beancontext.BeanContextSupport.vetoableChange(PropertyChangeEvent pce):
> Harmony does not throw NullPointerException when pce=null, while RI throws it.
> Specification does not mention NullPointerException.
> JUnit test to reproduce the problem:
> import junit.framework.TestCase;
> import java.beans.beancontext.BeanContextSupport;
> import java.beans.PropertyVetoException;
> public class BeanContextSupportTest extends TestCase {
> public void test_vetoableChangeLjava_beans_PropertyChangeEvent() {
> BeanContextSupport obj = new BeanContextSupport();
> boolean b = true;
> try {
> obj.vetoableChange(null);
> b = false;
> }
> catch (PropertyVetoException p) {
> p.printStackTrace();
> b = false;
> }
> catch (NullPointerException t) {
> t.printStackTrace();
> }
> assertTrue(b);
>
>
> }
> }
> RI output:
> java.lang.NullPointerException
> at java.beans.beancontext.BeanContextSupport.vetoableChange(BeanContextSupport.java:1063)
> at BeanContextSupportTest.test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest.java:15)
> at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
> at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at junit.textui.TestRunner.doRun(TestRunner.java:116)
> at junit.textui.TestRunner.start(TestRunner.java:172)
> at junit.textui.TestRunner.main(TestRunner.java:138)
> HARMONY output:
> java version 1.4.2 (subset)
> .F
> Time: 0.015
> There was 1 failure:
> 1) test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest)junit.framework.AssertionFailedError
> at BeanContextSupportTest.test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest.java:25)
> at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:211)
> FAILURES!!!
> Tests run: 1, Failures: 1, Errors: 0
--
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] Closed: (HARMONY-370) BeanContextSupport.vetoableChange(...)
does not throw NullPointerException
Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-370?page=all ]
Mikhail Loenko closed HARMONY-370:
----------------------------------
Resolution: Duplicate
Assign To: Mikhail Loenko
cumulative issue for HARMONY-362 to HARMONY-370 is submitted as HARMONY-373
> BeanContextSupport.vetoableChange(...) does not throw NullPointerException
> --------------------------------------------------------------------------
>
> Key: HARMONY-370
> URL: http://issues.apache.org/jira/browse/HARMONY-370
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Dmitry M. Kononov
> Assignee: Mikhail Loenko
> Priority: Minor
> Attachments: BeanContextSupport.java.diff, BeanContextSupportTest.java
>
> Problem details:
> java.beans.beancontext.BeanContextSupport.vetoableChange(PropertyChangeEvent pce):
> Harmony does not throw NullPointerException when pce=null, while RI throws it.
> Specification does not mention NullPointerException.
> JUnit test to reproduce the problem:
> import junit.framework.TestCase;
> import java.beans.beancontext.BeanContextSupport;
> import java.beans.PropertyVetoException;
> public class BeanContextSupportTest extends TestCase {
> public void test_vetoableChangeLjava_beans_PropertyChangeEvent() {
> BeanContextSupport obj = new BeanContextSupport();
> boolean b = true;
> try {
> obj.vetoableChange(null);
> b = false;
> }
> catch (PropertyVetoException p) {
> p.printStackTrace();
> b = false;
> }
> catch (NullPointerException t) {
> t.printStackTrace();
> }
> assertTrue(b);
>
>
> }
> }
> RI output:
> java.lang.NullPointerException
> at java.beans.beancontext.BeanContextSupport.vetoableChange(BeanContextSupport.java:1063)
> at BeanContextSupportTest.test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest.java:15)
> at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
> at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at junit.textui.TestRunner.doRun(TestRunner.java:116)
> at junit.textui.TestRunner.start(TestRunner.java:172)
> at junit.textui.TestRunner.main(TestRunner.java:138)
> HARMONY output:
> java version 1.4.2 (subset)
> .F
> Time: 0.015
> There was 1 failure:
> 1) test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest)junit.framework.AssertionFailedError
> at BeanContextSupportTest.test_vetoableChangeLjava_beans_PropertyChangeEvent(BeanContextSupportTest.java:25)
> at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:211)
> FAILURES!!!
> Tests run: 1, Failures: 1, Errors: 0
--
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