lahodaj commented on code in PR #9069:
URL: https://github.com/apache/netbeans/pull/9069#discussion_r2691434060


##########
java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/RenameRefactoringPlugin.java:
##########
@@ -367,23 +367,8 @@ protected JavaSource getJavaSource(Phase p) {
         if (treePathHandle == null && docTreePathHandle == null) {
             return null;
         }
-        switch (p) {
-            case PRECHECK:
-            case FASTCHECKPARAMETERS:
-                return JavaSource.forFileObject(docTreePathHandle != null? 
docTreePathHandle.getTreePathHandle().getFileObject()
-                                                                         : 
treePathHandle.getFileObject());
-            case PREPARE:
-            case CHECKPARAMETERS:
-                if(treePathHandle != null && treePathHandle.getKind() == 
Tree.Kind.LABELED_STATEMENT) {
-                    return 
JavaSource.forFileObject(treePathHandle.getFileObject());
-                }
-                ClasspathInfo cpInfo = getClasspathInfo(refactoring);
-                JavaSource source = JavaSource.create(cpInfo, 
docTreePathHandle != null? docTreePathHandle.getTreePathHandle().getFileObject()
-                                                                         : 
treePathHandle.getFileObject());
-                return source;
-                
-        }
-        throw new IllegalStateException();
+        return JavaSource.forFileObject(docTreePathHandle != null? 
docTreePathHandle.getTreePathHandle().getFileObject()
+                                                                 : 
treePathHandle.getFileObject());

Review Comment:
   TBH, I am not sure what was the idea. I see the label rename refactoring 
probably does not have tests, I'll see if there's a meaningful way to add some.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
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