Fixed minor bug introduced in last check-in: "default =" should be "default = ".
diff --git a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CommonKeyword_toString_Test.java b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CommonKeyword_toString_Test.java index d7335fa..9895bfc 100644 --- a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CommonKeyword_toString_Test.java +++ b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CommonKeyword_toString_Test.java
@@ -21,7 +21,7 @@ */ public class CommonKeyword_toString_Test { - @Test public void should_return_keyword_value() { + @Test public void should_return_value() { assertThat(BOOL.toString(), equalTo("bool")); }
diff --git a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement_hasValue_Test.java b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement_hasValue_Test.java index 2b5329b..ea8a741 100644 --- a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement_hasValue_Test.java +++ b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement_hasValue_Test.java
@@ -22,8 +22,8 @@ public class CompoundElement_hasValue_Test { @Test public void should_return_true_if_value_is_equal_to_String() { - assertThat(DEFAULT_EQUAL.hasValue("default ="), equalTo(true)); - assertThat(DEFAULT_EQUAL_IN_BRACKETS.hasValue("[default =]"), equalTo(true)); + assertThat(DEFAULT_EQUAL.hasValue("default = "), equalTo(true)); + assertThat(DEFAULT_EQUAL_IN_BRACKETS.hasValue("[default = ]"), equalTo(true)); assertThat(EMPTY_STRING.hasValue("\"\""), equalTo(true)); assertThat(DEFAULT_EQUAL_STRING.hasValue("default = \"\""), equalTo(true)); assertThat(DEFAULT_EQUAL_STRING_IN_BRACKETS.hasValue("[default = \"\"]"), equalTo(true));
diff --git a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement_toString_Test.java b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement_toString_Test.java index a8c40c6..66b0157 100644 --- a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement_toString_Test.java +++ b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement_toString_Test.java
@@ -21,8 +21,8 @@ */ public class CompoundElement_toString_Test { - @Test public void should_return_keyword_value() { - assertThat(DEFAULT_EQUAL.toString(), equalTo("default =")); + @Test public void should_return_value() { + assertThat(DEFAULT_EQUAL.toString(), equalTo("default = ")); } }
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement.java index 030ea0f..f12e808 100644 --- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement.java +++ b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/grammar/CompoundElement.java
@@ -17,7 +17,7 @@ */ public enum CompoundElement { - DEFAULT_EQUAL(join(DEFAULT, EQUAL)), + DEFAULT_EQUAL(join(DEFAULT, EQUAL, "")), DEFAULT_EQUAL_IN_BRACKETS(inBrackets(DEFAULT_EQUAL)), EMPTY_STRING("\"\""), DEFAULT_EQUAL_STRING(join(DEFAULT_EQUAL, EMPTY_STRING)), @@ -25,14 +25,17 @@ PACKED_EQUAL_TRUE(join(PACKED, EQUAL, TRUE)), PACKED_EQUAL_TRUE_IN_BRACKETS(inBrackets(PACKED_EQUAL_TRUE)); + private static final String SPACE = " "; + private final String value; private static String join(Object...objects) { StringBuilder buffer = new StringBuilder(); int count = objects.length; for (int i = 0; i < count; i++) { - buffer.append(objects[i].toString()); - if (i < count - 1) buffer.append(" "); + String s = objects[i].toString(); + buffer.append(s); + if (i < count - 1 && !s.endsWith(SPACE)) buffer.append(SPACE); } return buffer.toString(); }