Bug 230708 - ClassCastException: java.lang.String cannot be cast to java.lang.Number
ClassCastException: java.lang.String cannot be cast to java.lang.Number
Status: REOPENED
Product: java
Classification: Unclassified
Component: Compiler
7.4
All All
: P3 (vote)
: 7.4
Assigned To: Dusan Balek
issues@java
EXCEPTIONS_REPORT
:
: 233232 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-04 08:34 UTC by aldobrucale
Modified: 2013-09-19 13:49 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
stacktrace (4.97 KB, text/plain)
2013-06-04 08:34 UTC, aldobrucale
Details
patched nb-javac (2.55 MB, application/x-java-archive)
2013-09-17 14:00 UTC, Dusan Balek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aldobrucale 2013-06-04 08:34:42 UTC
Build: NetBeans IDE Dev (Build 201306022301)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11
OS: Linux

User Comments:
aldobrucale: Starting netbeans




Stacktrace: 
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
   at com.sun.tools.javac.jvm.Items$ImmediateItem.coerce(Items.java:648)
   at com.sun.tools.javac.jvm.Items$Item.coerce(Items.java:269)
   at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:937)
   at com.sun.tools.javac.jvm.Gen.genArgs(Gen.java:954)
   at com.sun.tools.javac.jvm.Gen.visitNewClass(Gen.java:1888)
   at com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1514)
Comment 1 aldobrucale 2013-06-04 08:34:43 UTC
Created attachment 135305 [details]
stacktrace
Comment 2 Dusan Balek 2013-06-04 11:28:56 UTC
Is the issue reproducible with a clean userdir? Do you have a reproducible test case? Thanks.
Comment 3 karamba84 2013-08-05 12:06:46 UTC
As soon as i kill my m2/repository, netbeans will throw this all time long. Its really annoying!
Comment 4 Dusan Balek 2013-08-06 13:19:32 UTC
*** Bug 233232 has been marked as a duplicate of this bug. ***
Comment 5 Dusan Balek 2013-09-05 14:12:59 UTC
Unfortunately, I'm not able to reproduce the problem. Could you please provide a reproducible test case? Thanks.
Comment 6 Marian Petras 2013-09-16 14:23:56 UTC
This happens every time I open a certain Java source file (J2EE entity bean).

I tried to use the trick of starting with a clean userdir. So I did not close the problematic file (to make the IDE open it after the next startup), shut the IDE down, deleted the "userdir" and started the IDE again. It did not help, the exception occurred again.

I cannot provide the problematic source code file but I can help with finding the cause - e.g. by installing a custom patch with extensive logging (preferred) or by trying to find the root cause by reducing it progressively (pretty much time-consuming for me).

I reopened this bug because it has almost 20 duplicates and I because I want to help fix it.
Comment 7 Dusan Balek 2013-09-17 14:00:16 UTC
Created attachment 140173 [details]
patched nb-javac
Comment 8 Dusan Balek 2013-09-17 14:09:41 UTC
Fine Marian, if you are willing to help please replace the original nb-javac-impl.jar (located in java/modules/ext) with the patched version that should add more information to the ClassCastExceptions being thrown. Then try to reproduce the problem and attach the additional information provided. Thanks.
Comment 9 Marian Petras 2013-09-18 09:52:14 UTC
I did not get the exception with the patched nb-javac. When I replaced it with the original nb-javac from NB 7.4 Beta, I got the exception again. Maybe the bug is already fixed in recent development versions of NB 7.4?
Comment 10 Marian Petras 2013-09-19 13:49:35 UTC
I downloaded and installed dev. version of NetBeans 7.4 (build 201309180002) and installed the patched nb-javac-impl.jar there. But I did not get any exception.


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