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 202755

Summary: [71cat] AssertionError at com.sun.tools.javac.util.Assert.error
Product: java Reporter: javydreamercsw <javydreamercsw>
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: normal CC: alied, ayermolayev, bhulse, bokc, dcremonini, ehsavoie, frankv, FrantaM, gavenkoa, gbivins, jessholle, jglick, jskrivanek, junqueira_raphael, jyeary, Leperous, lhochet, mgukov, mmirilovic, mpetras, Nanocom, nleck, ovrabec, ralphbenjamin, rgw21, Rudieri, sreimers, stefan79, tipirneni, vv159170
Priority: P2 Keywords: 8.1_WAIVER_APPROVED
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 177048
Attachments: stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stack-trace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace

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.
Comment 15 alied 2014-06-22 05:17:57 UTC
Created attachment 147737 [details]
stacktrace

working with a very weird free form project
Comment 16 Marian Mirilovic 2015-02-04 10:27:06 UTC
112 duplicates -> P2
Comment 17 Dusan Balek 2015-04-22 07:47:16 UTC
Enhanced logging.

http://hg.netbeans.org/nb-javac/rev/3fa2d0a790fb
Comment 18 Dusan Balek 2015-09-08 11:58:17 UTC
There are no recent reports (the last came from build 141118) that should contain an enhanced logging information necessary to fix the issue (since there is no reproducible test case) so I'm asking for 8.1 WAIVER.
Comment 19 Jiri Kovalsky 2015-09-09 16:42:01 UTC
Bug waiver for 8.1 approved.
Comment 20 Jiri Skrivanek 2016-04-08 06:20:40 UTC
Created attachment 159158 [details]
stacktrace

Sources externally updated.
Comment 21 Jiri Skrivanek 2016-04-12 06:50:52 UTC
Created attachment 159221 [details]
stacktrace

When sources were updated externally.
Comment 22 Ondrej Vrabec 2016-04-12 09:14:54 UTC
Created attachment 159223 [details]
stacktrace

just git pulled new modifications in java files
Comment 23 Jiri Skrivanek 2016-04-13 09:08:54 UTC
Created attachment 159246 [details]
stacktrace

While scanning.
Comment 24 Ralph Ruijs 2016-04-18 08:26:58 UTC
Created attachment 159301 [details]
stacktrace

Moved a class
Comment 25 Ralph Ruijs 2016-04-21 12:29:59 UTC
Created attachment 159370 [details]
stacktrace

Opened spi.palette
Comment 26 Vladimir Voskresensky 2016-04-28 17:27:05 UTC
Created attachment 159469 [details]
stacktrace

external update of sources
Comment 27 Dusan Balek 2016-06-28 13:06:57 UTC
Should be fixed together with #258733.