| Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServiceUtils_NEW.java
|
| diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServiceUtils_NEW.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServiceUtils_NEW.java
|
| index 4dd235a5bd05ba55edde064c13d6a02ce77d39a8..67bfb7c3251f88049e2cf0a6c2260ebac3748747 100644
|
| --- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServiceUtils_NEW.java
|
| +++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServiceUtils_NEW.java
|
| @@ -71,6 +71,27 @@ public class ServiceUtils_NEW {
|
| }
|
|
|
| /**
|
| + * Simplifies the given {@link Change}. If it is a {@link CompositeChange}, and it is zero
|
| + * children - returns {@code null}; if it has one child - attempts to simplify it; otherwise
|
| + * returns the current {@link Change}.
|
| + */
|
| + public static Change expandSingleChildCompositeChanges(Change change) {
|
| + while (change instanceof CompositeChange) {
|
| + CompositeChange compositeChange = (CompositeChange) change;
|
| + Change[] children = compositeChange.getChildren();
|
| + if (children.length == 0) {
|
| + return null;
|
| + } else if (children.length == 1) {
|
| + change = children[0];
|
| + compositeChange.remove(change);
|
| + } else {
|
| + break;
|
| + }
|
| + }
|
| + return change;
|
| + }
|
| +
|
| + /**
|
| * @return the LTK change for the given Services {@link CompositeChange}.
|
| */
|
| public static CompositeChange toLTK(SourceChange sourceChange) {
|
|
|