mbien commented on code in PR #9069:
URL: https://github.com/apache/netbeans/pull/9069#discussion_r2690409712
##########
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:
i suppose this used to be an optimization to create a smaller CP for inline
rename?
i tried to look through history and the switch slowly grew over time
https://github.com/emilianbold/netbeans-releases/commit/0a558e4f1980436335f260a36d35658e55c4dd64
https://github.com/emilianbold/netbeans-releases/commit/f2d147e5a942e3446dbc94f8b8f90e4867257c80
--
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