svatoun commented on a change in pull request #361: my first refactoring session
URL: https://github.com/apache/incubator-netbeans/pull/361#discussion_r161170995
##########
File path:
refactoring.api/src/org/netbeans/modules/refactoring/api/RefactoringSession.java
##########
@@ -352,61 +341,34 @@ private void fireProgressListenerStop() {
progressSupport.fireProgressListenerStop(this);
}
}
-
- private void setWrappers(Transaction commit, UndoableWrapper wrap) {
- wrap.setActive(true, this);
-
- // if (!(commit instanceof RefactoringCommit))
- // return;
- // for (FileObject f:((RefactoringCommit)
commit).getModifiedFiles()) {
- // Document doc = getDocument(f);
- // if (doc!=null)
- //
doc.putProperty(BaseDocument.UndoableEditWrapper.class, wrap);
- // }
- }
-
- private void unsetWrappers(Transaction commit, UndoableWrapper wrap) {
- wrap.setActive(false, null);
-
- // setWrappers(commit, null);
- }
-
- private Document getDocument(FileObject f) {
- try {
- DataObject dob = DataObject.find(f);
- EditorCookie cookie = dob.getLookup().lookup(EditorCookie.class);
- if (cookie == null)
- return null;
- return cookie.getDocument();
- } catch (DataObjectNotFoundException ex) {
- return null;
- }
- }
-
private class ElementsCollection extends
AbstractCollection<RefactoringElement> {
+
@Override
public Iterator<RefactoringElement> iterator() {
return new Iterator() {
- //private final Iterator<RefactoringElementImplementation>
inner = internalList.iterator();
+
private final Iterator<RefactoringElementImplementation>
inner2 = SPIAccessor.DEFAULT.getFileChanges(bag).iterator();
private int index = 0;
@Override
public void remove() {
throw new UnsupportedOperationException();
}
-
+
@Override
public RefactoringElement next() {
if (index < internalList.size()) {
- return new
RefactoringElement(internalList.get(index++));
+ RefactoringElementImplementation implementation =
internalList.get(index);
Review comment:
Coding style in effect does not prohibit pre/postfix increments.
----------------------------------------------------------------
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