dbalek commented on a change in pull request #2013: Fix Java refactoring with 
vanilla javac
URL: https://github.com/apache/netbeans/pull/2013#discussion_r398719990
 
 

 ##########
 File path: 
java/java.source.base/src/org/netbeans/api/java/source/SourceUtils.java
 ##########
 @@ -1366,4 +1366,21 @@ private static boolean isPkgOrMdl(@NonNull final 
ElementKind kind) {
     public static Object getDiagnosticParam(Diagnostic<?> d, int index) {
         return Hacks.getDiagnosticParam(d, index);
     }
+
+    /**
+     * Ensure that the given file is parsed from source, in the context of the
+     * provided parser instance.
+     *
+     * Please note this only has an effect before invoking {@link 
CompilationController#toPhase(org.netbeans.api.java.source.JavaSource.Phase) }.
+     *
+     * @param cc the parser instance that should be augmented
+     * @param file the input source file
+     * @since 2.46
+     */
+    public static void forceSource(CompilationController cc, FileObject file) {
+        if (cc.getPhase() != Phase.MODIFIED) {
+            throw new IllegalStateException("Must invoke before running 
toPhase!");
 
 Review comment:
   "Must be invoked before ..."  ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to