svatoun commented on a change in pull request #361: my first refactoring session
URL: https://github.com/apache/incubator-netbeans/pull/361#discussion_r161166999
##########
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);
Review comment:
Is there a reason to inline setWrappers ? Wouldn't it be better the other
way around, to move null check into (un)setWrappers ?
----------------------------------------------------------------
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:
[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