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 241479 - 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: Refactoring (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-06 09:52 UTC by lforet
Modified: 2014-02-06 09:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 207343


Attachments
stacktrace (3.21 KB, text/plain)
2014-02-06 09:52 UTC, lforet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lforet 2014-02-06 09:52:40 UTC
This bug was originally marked as duplicate of bug 174590, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201402040001)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.45-b08, Java(TM) SE Runtime Environment, 1.7.0_45-b18
OS: Windows 7

User Comments:
lforet: ask for contextal menu "insert code" action,




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:212)
   at org.netbeans.api.java.source.CompilationInfo.getCompilationUnit(CompilationInfo.java:186)
   at org.netbeans.api.java.source.TreeUtilities.tokensFor(TreeUtilities.java:717)
   at org.netbeans.api.java.source.TreeUtilities.pathFor(TreeUtilities.java:333)
   at org.netbeans.api.java.source.TreeUtilities.pathFor(TreeUtilities.java:264)
   at org.netbeans.api.java.source.TreePathHandle$TreeDelegate.resolve(TreePathHandle.java:468)
Comment 1 lforet 2014-02-06 09:52:42 UTC
Created attachment 144860 [details]
stacktrace
Comment 2 Ralph Ruijs 2014-02-06 09:58:06 UTC
Fixed by fb7e308ff54d