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 2018/01/11 20:06:57 UTC

[GitHub] dtrebbien commented on a change in pull request #361: my first refactoring session

dtrebbien commented on a change in pull request #361: my first refactoring session
URL: https://github.com/apache/incubator-netbeans/pull/361#discussion_r161062001
 
 

 ##########
 File path: refactoring.api/src/org/netbeans/modules/refactoring/api/RefactoringSession.java
 ##########
 @@ -116,79 +108,66 @@ private Problem reallyDoRefactoring(boolean saveAfterDone) {
             try {
                 while (it.hasNext()) {
                     RefactoringElementImplementation element = (RefactoringElementImplementation) it.next();
-                    if (element.isEnabled() && !((element.getStatus() == RefactoringElement.GUARDED) || (element.getStatus() == RefactoringElement.READ_ONLY))) {
-                        element.performChange();
-                    }
+                    changeRefactoringElement(element, true);
                     current += progressStep;
                     fireProgressListenerStep((int) current);
                 }
             } finally {
-                for (Transaction commit : commits) {
-                    SPIAccessor.DEFAULT.check(commit, false);
-                }
-
-                UndoableWrapper wrapper = MimeLookup.getLookup("").lookup(UndoableWrapper.class);
-                for (Transaction commit : commits) {
-                    if (wrapper != null) {
-                        setWrappers(commit, wrapper);
+                commits.forEach(commit -> SPIAccessor.DEFAULT.check(commit, false));
+                UndoableWrapper undoableWrapper = MimeLookup.getLookup("").lookup(UndoableWrapper.class);
+                commits.forEach(commit -> {
+                    if (undoableWrapper != null) {
+                        undoableWrapper.setActive(true, this);
                     }
-
-                    if(commit instanceof ProgressProvider) {
+                    if (commit instanceof ProgressProvider) {
 
 Review comment:
   Nice rework of this part

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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