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 257489 - IllegalStateException: Cannot call getCompilationUnit() if current phase < JavaSource.Phase.PARSED. You must call toPhase(Phase.PARSED) first.
Summary: IllegalStateException: Cannot call getCompilationUnit() if current phase < Ja...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-08 19:35 UTC by Maksim Khramov
Modified: 2016-06-22 01:50 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 195894


Attachments
stacktrace (7.82 KB, text/plain)
2016-01-08 19:35 UTC, Maksim Khramov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maksim Khramov 2016-01-08 19:35:21 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-291-on-20151117)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.20-b23, Java(TM) SE Runtime Environment, 1.8.0_20-b26
OS: Windows 7

User Comments:
GUEST: <Please provide a description of the problem or the steps to reproduce>
HI i have  created the form by using SWINGS in java.But form is not showing in design mode.

mkhramov: Open java GUI form class from Netbeans Module project




Stacktrace: 
java.lang.IllegalStateException: Cannot call getCompilationUnit() if current phase < JavaSource.Phase.PARSED. You must call toPhase(Phase.PARSED) first.
   at org.netbeans.modules.java.source.parsing.CompilationInfoImpl.getCompilationUnit(CompilationInfoImpl.java:219)
   at org.netbeans.api.java.source.CompilationInfo.getCompilationUnit(CompilationInfo.java:184)
   at org.netbeans.api.java.source.CompilationInfo.getTopLevelElements(CompilationInfo.java:249)
   at org.netbeans.modules.java.source.queriesimpl.JavaOperationsImpl.getTopLevelClasses(JavaOperationsImpl.java:103)
   at org.netbeans.modules.java.source.queries.api.Queries.getTopLevelClasses(Queries.java:92)
   at org.netbeans.modules.form.FormJavaSource$1.apply(FormJavaSource.java:153)
Comment 1 Maksim Khramov 2016-01-08 19:35:23 UTC
Created attachment 158071 [details]
stacktrace
Comment 2 Tomas Pavek 2016-01-11 10:39:40 UTC
Looks like a problem of java.source.queriesimpl.
Comment 3 Tomas Zezula 2016-06-21 13:17:28 UTC
The issue from report #806749 is caused by missing NBClassReader (libs.nbjavac) - wrongly installed IDE.
Report number #679464 is caused by NoSuchMethodError - wrong update of the IDE.
Report number #634803 is caused by the OOM.

The #806749 and #679464 are fixed in dev by correct dependency versions.
The #634803 is reported as OOM in other issue.

However I've change the JavaOperationsImpl to fail as expected with checked exception.
jet-main b96488c2722c
Comment 4 Quality Engineering 2016-06-22 01:50:33 UTC
Integrated into 'main-silver', will be available in build *201606220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b96488c2722c
User: Tomas Zezula <tzezula@netbeans.org>
Log: #257489:IllegalStateException: Cannot call getCompilationUnit() if current phase < JavaSource.Phase.PARSED. You must call toPhase(Phase.PARSED) first.