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 262721 - 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: Hints (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
: 262796 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-07-07 19:13 UTC by _ gtzabari
Modified: 2016-07-19 01:42 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 225116


Attachments
stacktrace (4.56 KB, text/plain)
2016-07-07 19:13 UTC, _ gtzabari
Details
stacktrace (2.73 KB, text/plain)
2016-07-15 12:42 UTC, IrianR
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2016-07-07 19:13:03 UTC
This bug was originally marked as duplicate of bug 241479, 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 201607060002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.92-b14, Java(TM) SE Runtime Environment, 1.8.0_92-b14
OS: Windows 10

User Comments:
gtzabari: Invoked "Introduce method". Exception thrown.




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:220)
   at org.netbeans.api.java.source.CompilationInfo.getCompilationUnit(CompilationInfo.java:184)
   at org.netbeans.api.java.source.TreeUtilities.tokensFor(TreeUtilities.java:753)
   at org.netbeans.api.java.source.TreeUtilities.pathFor(TreeUtilities.java:367)
   at org.netbeans.api.java.source.TreeUtilities.pathFor(TreeUtilities.java:298)
   at org.netbeans.api.java.source.TreePathHandle$TreeDelegate.resolve(TreePathHandle.java:488)
Comment 1 _ gtzabari 2016-07-07 19:13:05 UTC
Created attachment 160305 [details]
stacktrace
Comment 2 IrianR 2016-07-15 12:42:55 UTC
Created attachment 160402 [details]
stacktrace

Typing in a new method name from hint action "introduce new method"
Comment 3 Svata Dedic 2016-07-15 20:52:20 UTC
Will be fixed in jet-main#dd11d689d2f3
Comment 4 Svata Dedic 2016-07-18 14:06:34 UTC
*** Bug 262796 has been marked as a duplicate of this bug. ***
Comment 5 Quality Engineering 2016-07-19 01:42:36 UTC
Integrated into 'main-silver', will be available in build *201607190002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/dd11d689d2f3
User: Svata Dedic <sdedic@netbeans.org>
Log: #262721: parser must reach RESOLVED phase before validation