Bug 202755 - [71cat] AssertionError at com.sun.tools.javac.util.Assert.error
[71cat] AssertionError at com.sun.tools.javac.util.Assert.error
Status: NEW
Product: java
Classification: Unclassified
Component: Compiler
7.0
All All
: P3 (vote)
: TBD
Assigned To: Dusan Balek
issues@java
EXCEPTIONS_REPORT
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-27 20:26 UTC by javydreamercsw
Modified: 2014-03-20 10:45 UTC (History)
20 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
stacktrace (5.27 KB, text/plain)
2011-09-27 20:27 UTC, javydreamercsw
Details
stacktrace (4.53 KB, text/plain)
2012-05-09 09:02 UTC, ehsavoie
Details
stacktrace (3.80 KB, text/plain)
2012-11-26 16:59 UTC, sreimers
Details
stacktrace (4.67 KB, text/plain)
2013-02-12 18:01 UTC, Jesse Glick
Details
stacktrace (5.10 KB, text/plain)
2013-06-04 08:31 UTC, stefan79
Details
stacktrace (4.67 KB, text/plain)
2013-06-17 22:34 UTC, Jesse Glick
Details
stack-trace (4.42 KB, text/plain)
2013-09-20 11:11 UTC, Marian Petras
Details
stacktrace (4.60 KB, text/plain)
2014-02-04 22:31 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description javydreamercsw 2011-09-27 20:26:58 UTC
Build: NetBeans IDE Dev (Build 201109260601)
VM: Java HotSpot(TM) Client VM, 21.0-b17, Java(TM) SE Runtime Environment, 1.7.0-b147
OS: Windows 7

User Comments:
javydreamercsw: Removing a module dependency from a module.

GUEST: Scanning a large project.

GUEST: opening a module

GUEST: scrolling with mouse




Stacktrace: 
java.lang.AssertionError
   at com.sun.tools.javac.util.Assert.error(Assert.java:126)
   at com.sun.tools.javac.util.Assert.check(Assert.java:45)
   at com.sun.tools.javac.jvm.Code$State.forceStackTop(Code.java:1723)
   at com.sun.tools.javac.jvm.Gen.visitConditional(Gen.java:1715)
   at com.sun.tools.javac.tree.JCTree$JCConditional.accept(JCTree.java:1113)
   at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:840)
Comment 1 javydreamercsw 2011-09-27 20:27:02 UTC
Created attachment 111257 [details]
stacktrace
Comment 2 Dusan Balek 2011-10-12 11:18:42 UTC
Hard to fix without a reproducible test case. Are you able to reproduce the
issue? If so, could you please create a simple test case and attach it to the
issue? Thanks.
Comment 3 javydreamercsw 2011-10-12 17:34:17 UTC
As you can see from the reports it appears to happen randomly. I haven't seen it again on recent builds.
Comment 4 ehsavoie 2012-05-09 09:02:54 UTC
Created attachment 119192 [details]
stacktrace
Comment 5 sreimers 2012-11-26 16:59:24 UTC
Created attachment 128413 [details]
stacktrace
Comment 6 Jesse Glick 2013-02-12 18:01:47 UTC
Created attachment 131315 [details]
stacktrace
Comment 7 Jesse Glick 2013-02-12 18:02:34 UTC
Just happened to me in a dev build. Impossible to say how to reproduce; had switched Git branch and did a priming build from an external shell. When I came back to NB I saw this error mixed in with project scanning.
Comment 8 stefan79 2013-06-04 08:31:28 UTC
Created attachment 135304 [details]
stacktrace

Error occured while debugging (java) and then wheeling (mouse).
Comment 9 Jesse Glick 2013-06-17 22:34:49 UTC
Created attachment 135923 [details]
stacktrace

Editing a POM.
Comment 10 Marian Petras 2013-09-20 11:08:47 UTC
It happened when I saved the Java file that I just modified.
The code that I added immediately before I got the exception was:

	final AbstractPayment abstractPayment = getPayment();
	final Payment payment = (abstractPayment instanceof Payment)
	                        ? (Payment) abstractPayment
	                        : null;

(AbstractPayment is an abstract class, Payment is a direct non-abstract subclass of it.)

--
Product Version: NetBeans IDE 7.4 Dev (Build 201309180002)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 7 version 6.1 running on amd64; Cp1250; cs_CZ (nb)
Comment 11 Marian Petras 2013-09-20 11:11:29 UTC
Created attachment 140287 [details]
stack-trace

nb-javac-impl.jar used was the patched one that was attached to bug #230708 (attachment 140173 [details]).
Comment 12 Marian Petras 2013-09-20 12:38:55 UTC
I am sure that the use of the ternary operator makes the difference. I do not get the exception if I replace the statement

	final Payment payment = (abstractPayment instanceof Payment)
	                        ? (Payment) abstractPayment
	                        : null;

with a trivial statement:

	final Payment payment = null;

If I revert the code back to the use of ternary of-then-else operator, I get the exception again (after Save).

I tried to reproduce the bug in a simple J2SE application but did not succeed. The project that I get the exception on is a large Maven-based J2EE application and both Payment and AbstractPayment are entity classes with multiple methods, fields, JPA-related annotations etc. AbstractPayment and Payment are in one EJB module project, the code containing the critical part of code is in another EJB module project.
Comment 13 Marian Petras 2013-09-20 12:43:02 UTC
Dušan, if you provide a patched, debugging version of nb-javac-impl.jar, I will use it in hope that it would provide more diagnostic data.
Comment 14 Jesse Glick 2014-02-04 22:31:16 UTC
Created attachment 144806 [details]
stacktrace

Opened a Maven project with some missing dependencies and did a (clean) build of it while browsing sources.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo