This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
package org.netbeans.modules.refactoring.spi.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.swing.text.Document;
@Override
public boolean addEdit(UndoableEdit ue) {
if (ue instanceof UndoableEditDelegate) {
if (ue instanceof List) {
return inner.addEdit(((UndoableEditDelegate) ue).unwrap());
List<UndoableEdit> listEdit = (List<UndoableEdit>) ue;
UndoableEdit topEdit = listEdit.get(listEdit.size() - 1);
// Check that there's only original document's edit and the wrapping refactoring edit
boolean refatoringEditOnly = listEdit.size() == 2;
if (refatoringEditOnly && topEdit instanceof UndoableEditDelegate) {
inner.addEdit(listEdit.get(0));
return true;
}
return false;
//return delegate.addEdit(ue);
public UndoableEdit unwrap() {
return delegate;