Index: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/ConstructorSemanticProcessor.java |
diff --git a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/ConstructorSemanticProcessor.java b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/ConstructorSemanticProcessor.java |
index c56fa791f1396acf2c3590290b864896a296e278..a10f8d5e212dc1264c52e30666a5add38c8ed994 100644 |
--- a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/ConstructorSemanticProcessor.java |
+++ b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/ConstructorSemanticProcessor.java |
@@ -42,6 +42,7 @@ import static com.google.dart.java2dart.util.ASTFactory.typeName; |
import org.eclipse.jdt.core.dom.IMethodBinding; |
+import java.util.Iterator; |
import java.util.List; |
/** |
@@ -183,10 +184,18 @@ public class ConstructorSemanticProcessor extends SemanticProcessor { |
return; |
} |
// add redirecting constructor invocation |
+ List<ConstructorInitializer> initializers = node.getInitializers(); |
RedirectingConstructorInvocation redirect = redirectingConstructorInvocation( |
"thisConstructorRedirection", |
methodInvocation.getArgumentList().getArguments()); |
- node.getInitializers().add(redirect); |
+ initializers.add(redirect); |
+ // remove speculative "super" constructor invocation |
+ for (Iterator<ConstructorInitializer> iter = initializers.iterator(); iter.hasNext();) { |
+ ConstructorInitializer initializer = iter.next(); |
+ if (initializer instanceof SuperConstructorInvocation) { |
+ iter.remove(); |
+ } |
+ } |
// remove body |
node.setBody(emptyFunctionBody()); |
// record constructor invocation |