You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/03/26 16:38:37 UTC

[GitHub] [netbeans] dbalek commented on a change in pull request #2013: Fix Java refactoring with vanilla javac

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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