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 159537 - java.lang.RuntimeException: Uncompilable source code
Summary: java.lang.RuntimeException: Uncompilable source code
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Andrey Yamkovoy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-03 15:43 UTC by desmond_kirrane
Modified: 2009-10-06 13:57 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description desmond_kirrane 2009-03-03 15:43:46 UTC
When running a Unit test I get the following error:

java.lang.RuntimeException: Uncompilable source code
        at com.test.MyTestCase.testMyTest(MyTestCase.java:192)  
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        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 org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
Test com.test.MyTestCase FAILED
Comment 1 Andrei Chistiakov 2009-03-04 13:47:29 UTC
Reassigning to junit component
Comment 2 racy 2009-03-04 18:47:56 UTC
I get the same exception message when I try to access an inner Enum class.
When I run the following code I get a RuntimeException with the message "Uncompilable source code", but only if I run it
from the Netbeans IDE. If I make a JAR file and run it from outside the IDE I do not get the exception.

Exception:

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code
        at enumbug.Main$Col.values(Main.java)
        at enumbug.Main.main(Main.java:30)

Code:

public class Main {

    enum Col {NAME ("Name"), ID ("Skill ID"), SCHOOL ("School"), COUNT ("Count");
        String desc;
        Col(String desc) {
            this.desc = desc;
        }

        public String getDescription() {
            return desc;
        }

    }

    public static void main(String[] args) {
        int numColumns = Col.values().length;
    }

}
Comment 3 Alexei Mokeev 2009-03-05 13:49:52 UTC
Assigning issues from Michael to Andrey.
Comment 4 bartvdc 2009-03-10 08:22:49 UTC
The same here in a maven project, it disappeared when compile on save was disabled.
Found the hint in a comment on http://www.netbeans.org/issues/show_bug.cgi?id=153840
Comment 5 Andrey Yamkovoy 2009-03-19 13:21:55 UTC
Can't reproduce this issue. From the stack trace looks like the cause is at
com.test.MyTestCase.testMyTest(MyTestCase.java:192)

First of all please check this works outside of IDE and attach the source code.
Comment 6 ianfrance 2009-06-23 10:34:16 UTC
I have also encountered this problem. Using 6.7RC2. It occurred for me and a colleague when running an individual test
file (ctrl F6). Although for each of us this was a different test file, and the exception was caused elsewhere in our
code (in different places for each of us).

When running all tests no problems are seen, it is only when running just one test file. When the error occurs it
persists on that one file through a clear of the netbeans cache and through "clean and build" of the project.

Switching off the "compile on save" for tests solved the problem.

It occurred in different code places for both of us and I can't see any connection between the occurrences. I am unable
to supply the code, and doubt it would be reproducible for you anyway: as I say it doesn't seem to occur in the same
place for different developers.

I have moved to RC3 and not seen this issue yet.
Comment 7 pribyl 2009-10-06 13:57:53 UTC
Product Version: NetBeans IDE 6.8 Beta (Build 200910020947)
Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

I was not able to reproduce this problem on recent build. As there is no additional info since June, I am closing this
issue as WORKSFORME (hopefully the problem was fixed).

However, if the problem persists, please reopen.

Thanks