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.
Summary: | ErrorManagerDelegatesToLoggingTest.testAnnotateExceptionWithCNFECause fails with NPE | ||
---|---|---|---|
Product: | platform | Reporter: | AlexanderIoffe |
Component: | -- Other -- | Assignee: | Jaroslav Tulach <jtulach> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | anebuzelsky, jskrivanek, vriha |
Priority: | P2 | Keywords: | JDK_SPECIFIC |
Version: | 7.3.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
AlexanderIoffe
2013-07-02 18:33:01 UTC
More tests fail with the same reason: ExceptionsTest testAttachMessageForClassNotFound ExceptionsTest testAttachLocalizedMessageForClassNFE ExceptionsTest testAttachLocalizedMessageForClassNFEIfNoMsg ExceptionsTest testAnnotateExceptionWithCNFECause ExceptionsTest testAnnotateCNFE I tried to run the test both in trun and 7.3.1 code base and it works for me (Windows7, JDK7u25): ant -f openide.util test-unit -Dtest.includes=**/ErrorManagerDelegatesToLoggingTest.class Also the test passes on all platforms for trunk. E.g. on Linux: http://hudson4qe.cz.oracle.com/view/Trunk-QE/job/StableBTD-7.4/15/jdk=JDK%207,label=Ubuntu-slave3/testReport/org.openide/ErrorManagerDelegatesToLoggingTest/ Please, provide your steps and environment to reproduce failure. Mentioned test fails with jdk1.7.0_40. It is because ErrorManager at line 849 does not check the records field for null ("for (LogRecord r : records) {"). Here is comment by Alexander about changes in Throwable.initCause: Here at java.lang.Throwable.initCause(Throwable.java:456) we have a Objects.toString() call. However, this change is intentional. This is a part of fix for JDK-8012044. The idea is just to provide a bit more information to user throwing IllegalStateException Current code is: 454 public synchronized Throwable initCause(Throwable cause) { 455 if (this.cause != this) 456 throw new IllegalStateException("Can't overwrite cause with " + 457 Objects.toString(cause, "a null"), this); 458 if (cause == this) 459 throw new IllegalArgumentException("Self-causation not permitted", this); 460 this.cause = cause; 461 return this; 462 } Previous code was: 454 public synchronized Throwable initCause(Throwable cause) { 455 if (this.cause != this) 456 throw new IllegalStateException("Can't overwrite cause"); 457 if (cause == this) 458 throw new IllegalArgumentException("Self-causation not permitted"); 459 this.cause = cause; 460 return this; 461 } So I see now two problems in NB: 1. Trying to call initCause when it's not allowed and so you'll get IllegalStateException 2. Having AnnException.toString() not defended from NPE, which is not good anyway. Fails regularly within stable test distribution because we switched to JDK 1.7.0_40-b40. http://hudson4qe.cz.oracle.com/view/Trunk-QE/job/StableBTD-7.4/59/jdk=JDK%207,label=XP-slave2/testReport/org.openide/ErrorManagerDelegatesToLoggingTest/testAnnotateCNFE ergonomics#ce5e042bebba erogonomics builder still failing. Not yet fixed in main-silver. The build fails due to #234996. That is not under my control. From my point of view the issue is fixed, so don't reopen it for me, I can't do anything more. Integrated into 'main-silver', will be available in build *201309010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/ce5e042bebba User: Jaroslav Tulach <jtulach@netbeans.org> Log: #232167: Prevent NPE on 1.7.0_40 *** Bug 234650 has been marked as a duplicate of this bug. *** |