Code cleanup.
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/naming/LocalNamesProvider_names_Test.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/naming/LocalNamesProvider_namesFor_Test.java
similarity index 90%
rename from com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/naming/LocalNamesProvider_names_Test.java
rename to com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/naming/LocalNamesProvider_namesFor_Test.java
index 3915817..1ec858f 100644
--- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/naming/LocalNamesProvider_names_Test.java
+++ b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/naming/LocalNamesProvider_namesFor_Test.java
@@ -23,11 +23,11 @@
import com.google.eclipse.protobuf.protobuf.Enum;
/**
- * Tests for <code>{@link LocalNamesProvider#names(EObject)}</code>.
+ * Tests for <code>{@link LocalNamesProvider#namesFor(EObject)}</code>.
*
* @author alruiz@google.com (Alex Ruiz)
*/
-public class LocalNamesProvider_names_Test {
+public class LocalNamesProvider_namesFor_Test {
@Rule public XtextRule xtext = overrideRuntimeModuleWith(unitTestModule());
private LocalNamesProvider namesProvider;
@@ -50,7 +50,7 @@
// }
@Test public void should_return_all_possible_local_names() {
Enum phoneType = xtext.find("PhoneType", " {", Enum.class);
- List<QualifiedName> names = namesProvider.names(phoneType);
+ List<QualifiedName> names = namesProvider.namesFor(phoneType);
assertThat(names.get(0).toString(), equalTo("PhoneType"));
assertThat(names.get(1).toString(), equalTo("PhoneNumber.PhoneType"));
assertThat(names.get(2).toString(), equalTo("Person.PhoneNumber.PhoneType"));
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/IProtobufQualifiedNameProvider.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/IProtobufQualifiedNameProvider.java
index aabd384..914cc1a 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/IProtobufQualifiedNameProvider.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/IProtobufQualifiedNameProvider.java
@@ -20,10 +20,10 @@
@ImplementedBy(ProtobufQualifiedNameProvider.class)
public interface IProtobufQualifiedNameProvider extends IQualifiedNameProvider {
/**
- * Returns the qualified name of the given object, to be used as the name of an option. If the given object is a
- * <code>{@link Group}</code>, this method returns the name in lower case.
- * @param e the given object.
- * @return the qualified name of the given object, to be used as the name of an option.
+ * Returns the qualified name of the given object that is being used as the source of an option. If the given object
+ * is a <code>{@link Group}</code>, this method returns the name in lower case.
+ * @param source the source of an option.
+ * @return the qualified name of the given object that is being used as the name of an option.
*/
- QualifiedName getFullyQualifiedNameForOption(EObject e);
+ QualifiedName getFullyQualifiedNameForOption(EObject source);
}
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/LocalNamesProvider.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/LocalNamesProvider.java
index 0363fac..37e5531 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/LocalNamesProvider.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/LocalNamesProvider.java
@@ -64,12 +64,12 @@
@Inject private NamingStrategies namingStrategies;
@Inject private Packages packages;
- public List<QualifiedName> names(EObject e) {
- return allNames(e, namingStrategies.normal());
+ public List<QualifiedName> namesFor(EObject target) {
+ return allNames(target, namingStrategies.normal());
}
- public List<QualifiedName> namesForOption(EObject e) {
- return allNames(e, namingStrategies.option());
+ public List<QualifiedName> namesForOption(EObject source) {
+ return allNames(source, namingStrategies.option());
}
private List<QualifiedName> allNames(final EObject e, final NamingStrategy naming) {
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/ProtobufQualifiedNameProvider.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/ProtobufQualifiedNameProvider.java
index 585ee20..0185385 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/ProtobufQualifiedNameProvider.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/naming/ProtobufQualifiedNameProvider.java
@@ -36,12 +36,12 @@
@Inject private Packages packages;
@Inject private QualifiedNames qualifiedNames;
- @Override public QualifiedName getFullyQualifiedName(EObject e) {
- return getFullyQualifiedName(e, namingStrategies.normal());
+ @Override public QualifiedName getFullyQualifiedName(EObject target) {
+ return getFullyQualifiedName(target, namingStrategies.normal());
}
- @Override public QualifiedName getFullyQualifiedNameForOption(EObject e) {
- return getFullyQualifiedName(e, namingStrategies.option());
+ @Override public QualifiedName getFullyQualifiedNameForOption(EObject source) {
+ return getFullyQualifiedName(source, namingStrategies.option());
}
private QualifiedName getFullyQualifiedName(final EObject e, final NamingStrategy naming) {
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/TypeScopeFinder.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/TypeScopeFinder.java
index 02472f2..872630d 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/TypeScopeFinder.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/TypeScopeFinder.java
@@ -61,7 +61,7 @@
}
EObject e = (EObject) target;
Set<IEObjectDescription> descriptions = new HashSet<IEObjectDescription>();
- List<QualifiedName> names = localNamesProvider.names(e);
+ List<QualifiedName> names = localNamesProvider.namesFor(e);
int nameCount = names.size();
for (int i = level; i < nameCount; i++) {
descriptions.add(create(names.get(i), e));