Fixed: [Issue 148] Elements with different types bug same names are
marked as errors.
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue148_FixDuplicateNameError_Test.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue148_FixDuplicateNameError_Test.java
new file mode 100644
index 0000000..6379232
--- /dev/null
+++ b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue148_FixDuplicateNameError_Test.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2011 Google Inc.
+ *
+ * All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
+ * Public License v1.0 which accompanies this distribution, and is available at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package com.google.eclipse.protobuf.bugs;
+
+import static com.google.eclipse.protobuf.junit.core.Setups.unitTestSetup;
+import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.Assert.assertThat;
+
+import com.google.eclipse.protobuf.junit.core.XtextRule;
+import com.google.eclipse.protobuf.validation.ProtobufJavaValidator;
+
+import org.eclipse.emf.common.util.*;
+import org.junit.*;
+
+import java.util.List;
+
+/**
+ * Tests fix for <a href="http://code.google.com/p/protobuf-dt/issues/detail?id=91">Issue 91</a>.
+ *
+ * @author alruiz@google.com (Alex Ruiz)
+ */
+public class Issue148_FixDuplicateNameError_Test {
+
+ @Rule public XtextRule xtext = createWith(unitTestSetup());
+
+ private ProtobufJavaValidator validator;
+
+ @Before public void setUp() {
+ validator = xtext.getInstanceOf(ProtobufJavaValidator.class);
+ }
+
+ // package abc;
+ //
+ // message abc {
+ //
+ // }
+ @Test public void should_allow_elements_of_different_types_have_same_name() {
+ BasicDiagnostic diagnostics = new BasicDiagnostic();
+ validator.validate(xtext.root(), diagnostics, null);
+ List<Diagnostic> children = diagnostics.getChildren();
+ assertThat(children.size(), equalTo(0));
+ }
+}
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue91AddSupportForUTF16Strings.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue91_AddSupportForUTF16Strings_Test.java
similarity index 95%
rename from com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue91AddSupportForUTF16Strings.java
rename to com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue91_AddSupportForUTF16Strings_Test.java
index c7785eb..b694cbe 100644
--- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue91AddSupportForUTF16Strings.java
+++ b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue91_AddSupportForUTF16Strings_Test.java
@@ -23,7 +23,7 @@
*
* @author alruiz@google.com (Alex Ruiz)
*/
-public class Issue91AddSupportForUTF16Strings {
+public class Issue91_AddSupportForUTF16Strings_Test {
@Rule public XtextRule xtext = createWith(unitTestSetup());
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/GenerateProtobuf.mwe2 b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/GenerateProtobuf.mwe2
index cf43ef8..95422d6 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/GenerateProtobuf.mwe2
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/GenerateProtobuf.mwe2
@@ -67,7 +67,7 @@
// java-based API for validation
fragment = validation.JavaValidatorFragment {
// composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
- composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
+ // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
// registerForImportedPackages = true
}