| Index: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/util/ToFormattedSourceVisitor.java
|
| diff --git a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/util/ToFormattedSourceVisitor.java b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/util/ToFormattedSourceVisitor.java
|
| index 1bd4d3d128ce7cbfd3d230686a09504055c8ade6..49da7f622f452c812356b8e5ede5bc9b5094ff7d 100644
|
| --- a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/util/ToFormattedSourceVisitor.java
|
| +++ b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/util/ToFormattedSourceVisitor.java
|
| @@ -30,6 +30,7 @@ public class ToFormattedSourceVisitor implements AstVisitor<Void> {
|
| public static final String COMMENTS_KEY = "List of comments before statement";
|
| public static final String BLOCK_BODY_KEY = "Block body source";
|
| public static final String EXPRESSION_BODY_KEY = "Expression body source";
|
| + public static final String DEFAULT_VALUE_KEY = "Default parameter value";
|
|
|
| /**
|
| * The writer to which the source is to be written.
|
| @@ -315,7 +316,15 @@ public class ToFormattedSourceVisitor implements AstVisitor<Void> {
|
| @Override
|
| public Void visitDefaultFormalParameter(DefaultFormalParameter node) {
|
| visitNode(node.getParameter());
|
| - if (node.getSeparator() != null) {
|
| + String defaultValueSource = (String) node.getProperty(DEFAULT_VALUE_KEY);
|
| + if (defaultValueSource != null) {
|
| + if (node.getKind() == ParameterKind.POSITIONAL) {
|
| + writer.print(" = ");
|
| + } else {
|
| + writer.print(": ");
|
| + }
|
| + writer.print(defaultValueSource);
|
| + } else if (node.getSeparator() != null) {
|
| writer.print(" ");
|
| writer.print(node.getSeparator().getLexeme());
|
| visitNodeWithPrefix(" ", node.getDefaultValue());
|
|
|