Code cleanup.
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue131_AddOptionsForService_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue131_AddOptionsForService_Test.java
similarity index 88%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue131_AddOptionsForService_Test.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue131_AddOptionsForService_Test.java
index 28443ba..8243be9 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue131_AddOptionsForService_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue131_AddOptionsForService_Test.java
@@ -6,12 +6,12 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.scoping;
+package com.google.eclipse.protobuf.bugs;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainAllNames.containAll;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
@@ -21,6 +21,7 @@
import com.google.eclipse.protobuf.junit.core.XtextRule;
import com.google.eclipse.protobuf.protobuf.Option;
+import com.google.eclipse.protobuf.scoping.ProtobufScopeProvider;
/**
* Tests fix for <a href="http://code.google.com/p/protobuf-dt/issues/detail?id=131">Issue 131</a>.
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue147_AddSupportForGroupOptions_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue147_AddSupportForGroupOptions_Test.java
similarity index 85%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue147_AddSupportForGroupOptions_Test.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue147_AddSupportForGroupOptions_Test.java
index 8428302..d03a371 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue147_AddSupportForGroupOptions_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue147_AddSupportForGroupOptions_Test.java
@@ -6,14 +6,13 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.scoping;
+package com.google.eclipse.protobuf.bugs;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainAllNames.containAll;
-import static com.google.eclipse.protobuf.scoping.ContainAllFields.containAll;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
-import static com.google.eclipse.protobuf.scoping.OptionType.FIELD;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllFields.containAll;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
@@ -25,6 +24,7 @@
import com.google.eclipse.protobuf.junit.core.XtextRule;
import com.google.eclipse.protobuf.protobuf.*;
+import com.google.eclipse.protobuf.scoping.*;
/**
* Tests fix for <a href="http://code.google.com/p/protobuf-dt/issues/detail?id=147">Issue 147</a>.
@@ -57,7 +57,8 @@
@Test public void should_provide_fields_for_native_option() {
NativeFieldOption option = xtext.find("deprecated", NativeFieldOption.class);
IScope scope = provider.scope_OptionSource_target(option.getSource(), reference);
- Collection<MessageField> optionSources = descriptor().optionsOfType(FIELD);
+ Group group = xtext.find("membership", Group.class);
+ Collection<MessageField> optionSources = descriptor().availableOptionsFor(group);
assertThat(descriptionsIn(scope), containAll(optionSources));
}
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue156_AddSupportForEnumValueOptions_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue156_AddSupportForEnumValueOptions_Test.java
similarity index 86%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue156_AddSupportForEnumValueOptions_Test.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue156_AddSupportForEnumValueOptions_Test.java
index 3d8022b..f354856 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue156_AddSupportForEnumValueOptions_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue156_AddSupportForEnumValueOptions_Test.java
@@ -6,12 +6,12 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.scoping;
+package com.google.eclipse.protobuf.bugs;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainAllNames.containAll;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
@@ -21,6 +21,7 @@
import com.google.eclipse.protobuf.junit.core.XtextRule;
import com.google.eclipse.protobuf.protobuf.CustomFieldOption;
+import com.google.eclipse.protobuf.scoping.ProtobufScopeProvider;
/**
* Tests fix for <a href="http://code.google.com/p/protobuf-dt/issues/detail?id=156">Issue 156</a>.
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue157_GroupsShouldBeTypes_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue157_GroupsShouldBeTypes_Test.java
similarity index 86%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue157_GroupsShouldBeTypes_Test.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue157_GroupsShouldBeTypes_Test.java
index d8e1452..25f5c3c 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue157_GroupsShouldBeTypes_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue157_GroupsShouldBeTypes_Test.java
@@ -6,12 +6,12 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.scoping;
+package com.google.eclipse.protobuf.bugs;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainNames.contain;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
+import static com.google.eclipse.protobuf.junit.matchers.ContainNames.contain;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
@@ -21,6 +21,7 @@
import com.google.eclipse.protobuf.junit.core.XtextRule;
import com.google.eclipse.protobuf.protobuf.*;
+import com.google.eclipse.protobuf.scoping.ProtobufScopeProvider;
/**
* Tests fix for <a href="http://code.google.com/p/protobuf-dt/issues/detail?id=157">Issue 157</a>.
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue161_PackageScoping_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue161_PackageScoping_Test.java
similarity index 88%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue161_PackageScoping_Test.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue161_PackageScoping_Test.java
index c41da43..956f7e7 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Issue161_PackageScoping_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue161_PackageScoping_Test.java
@@ -6,17 +6,18 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.scoping;
+package com.google.eclipse.protobuf.bugs;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainNames.contain;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
+import static com.google.eclipse.protobuf.junit.matchers.ContainNames.contain;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import com.google.eclipse.protobuf.junit.core.XtextRule;
import com.google.eclipse.protobuf.protobuf.*;
+import com.google.eclipse.protobuf.scoping.ProtobufScopeProvider;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/IEObjectDescriptions.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/IEObjectDescriptions.java
similarity index 97%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/IEObjectDescriptions.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/IEObjectDescriptions.java
index 0b0df69..dc824e0 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/IEObjectDescriptions.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/IEObjectDescriptions.java
@@ -6,7 +6,7 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.scoping;
+package com.google.eclipse.protobuf.junit;
import static java.util.Collections.unmodifiableSet;
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllFields.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllFields.java
similarity index 83%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllFields.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllFields.java
index fdef015..45851e9 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllFields.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllFields.java
@@ -6,23 +6,24 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.scoping;
+package com.google.eclipse.protobuf.junit.matchers;
import java.util.*;
import org.eclipse.emf.ecore.EObject;
import org.hamcrest.*;
+import com.google.eclipse.protobuf.junit.IEObjectDescriptions;
import com.google.eclipse.protobuf.protobuf.MessageField;
/**
* @author alruiz@google.com (Alex Ruiz)
*/
-class ContainAllFields extends BaseMatcher<IEObjectDescriptions> {
+public class ContainAllFields extends BaseMatcher<IEObjectDescriptions> {
private final Collection<MessageField> fields = new ArrayList<MessageField>();
- static ContainAllFields containAll(Collection<MessageField> fields) {
+ public static ContainAllFields containAll(Collection<MessageField> fields) {
return new ContainAllFields(fields);
}
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllFieldsInMessage.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllFieldsInMessage.java
similarity index 83%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllFieldsInMessage.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllFieldsInMessage.java
index 1612b99..75a8f10 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllFieldsInMessage.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllFieldsInMessage.java
@@ -6,7 +6,7 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.scoping;
+package com.google.eclipse.protobuf.junit.matchers;
import static org.eclipse.xtext.EcoreUtil2.getAllContentsOfType;
@@ -15,20 +15,21 @@
import org.eclipse.emf.ecore.EObject;
import org.hamcrest.*;
+import com.google.eclipse.protobuf.junit.IEObjectDescriptions;
import com.google.eclipse.protobuf.protobuf.*;
/**
* @author alruiz@google.com (Alex Ruiz)
*/
-class ContainAllFieldsInMessage extends BaseMatcher<IEObjectDescriptions> {
+public class ContainAllFieldsInMessage extends BaseMatcher<IEObjectDescriptions> {
private final EObject container;
- static ContainAllFieldsInMessage containAllFieldsIn(Group group) {
+ public static ContainAllFieldsInMessage containAllFieldsIn(Group group) {
return new ContainAllFieldsInMessage(group);
}
- static ContainAllFieldsInMessage containAllFieldsIn(Message message) {
+ public static ContainAllFieldsInMessage containAllFieldsIn(Message message) {
return new ContainAllFieldsInMessage(message);
}
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllLiteralsInEnum.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllLiteralsInEnum.java
similarity index 85%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllLiteralsInEnum.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllLiteralsInEnum.java
index 9c36b2c..4b8c17a 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllLiteralsInEnum.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllLiteralsInEnum.java
@@ -6,7 +6,7 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.scoping;
+package com.google.eclipse.protobuf.junit.matchers;
import static org.eclipse.xtext.EcoreUtil2.getAllContentsOfType;
@@ -15,17 +15,18 @@
import org.eclipse.emf.ecore.EObject;
import org.hamcrest.*;
+import com.google.eclipse.protobuf.junit.IEObjectDescriptions;
import com.google.eclipse.protobuf.protobuf.*;
import com.google.eclipse.protobuf.protobuf.Enum;
/**
* @author alruiz@google.com (Alex Ruiz)
*/
-class ContainAllLiteralsInEnum extends BaseMatcher<IEObjectDescriptions> {
+public class ContainAllLiteralsInEnum extends BaseMatcher<IEObjectDescriptions> {
private final Enum anEnum;
- static ContainAllLiteralsInEnum containAllLiteralsIn(Enum anEnum) {
+ public static ContainAllLiteralsInEnum containAllLiteralsIn(Enum anEnum) {
return new ContainAllLiteralsInEnum(anEnum);
}
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllNames.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllNames.java
similarity index 81%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllNames.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllNames.java
index ae207bf..a5b842a 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainAllNames.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainAllNames.java
@@ -6,20 +6,22 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.scoping;
+package com.google.eclipse.protobuf.junit.matchers;
import java.util.*;
import org.hamcrest.*;
+import com.google.eclipse.protobuf.junit.IEObjectDescriptions;
+
/**
* @author alruiz@google.com (Alex Ruiz)
*/
-class ContainAllNames extends BaseMatcher<IEObjectDescriptions> {
+public class ContainAllNames extends BaseMatcher<IEObjectDescriptions> {
private final String[] expectedNames;
- static ContainAllNames containAll(String... names) {
+ public static ContainAllNames containAll(String... names) {
return new ContainAllNames(names);
}
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainNames.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainNames.java
similarity index 79%
rename from com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainNames.java
rename to com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainNames.java
index 9f6c52f..4458174 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ContainNames.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/junit/matchers/ContainNames.java
@@ -6,7 +6,7 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.scoping;
+package com.google.eclipse.protobuf.junit.matchers;
import static java.util.Arrays.asList;
@@ -14,14 +14,16 @@
import org.hamcrest.*;
+import com.google.eclipse.protobuf.junit.IEObjectDescriptions;
+
/**
* @author alruiz@google.com (Alex Ruiz)
*/
-class ContainNames extends BaseMatcher<IEObjectDescriptions> {
+public class ContainNames extends BaseMatcher<IEObjectDescriptions> {
private final List<String> expectedNames;
- static ContainNames contain(String... names) {
+ public static ContainNames contain(String... names) {
return new ContainNames(names);
}
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_ComplexTypeLink_target_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_ComplexTypeLink_target_Test.java
index 21e7a4d..ebf6dfe 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_ComplexTypeLink_target_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_ComplexTypeLink_target_Test.java
@@ -8,10 +8,10 @@
*/
package com.google.eclipse.protobuf.scoping;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainAllNames.containAll;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_ExtensionFieldName_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_ExtensionFieldName_Test.java
index 46579ec..ad04200 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_ExtensionFieldName_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_ExtensionFieldName_Test.java
@@ -8,10 +8,10 @@
*/
package com.google.eclipse.protobuf.scoping;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainAllNames.containAll;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_NormalFieldName_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_NormalFieldName_Test.java
index 81d620b..75c0205 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_NormalFieldName_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_NormalFieldName_Test.java
@@ -8,10 +8,10 @@
*/
package com.google.eclipse.protobuf.scoping;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainAllFieldsInMessage.containAllFieldsIn;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllFieldsInMessage.containAllFieldsIn;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralLink_target_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralLink_target_Test.java
index 389a83b..ddcbb5e 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralLink_target_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralLink_target_Test.java
@@ -8,10 +8,10 @@
*/
package com.google.eclipse.protobuf.scoping;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainAllLiteralsInEnum.containAllLiteralsIn;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllLiteralsInEnum.containAllLiteralsIn;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_ExtensionOptionField_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_ExtensionOptionField_Test.java
index 499515e..4e8ef3c 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_ExtensionOptionField_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_ExtensionOptionField_Test.java
@@ -8,10 +8,10 @@
*/
package com.google.eclipse.protobuf.scoping;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainAllNames.containAll;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_MessageOptionField_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_MessageOptionField_Test.java
index 9cafb44..789ed68 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_MessageOptionField_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_MessageOptionField_Test.java
@@ -8,11 +8,11 @@
*/
package com.google.eclipse.protobuf.scoping;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.SearchOption.IGNORE_CASE;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainAllFieldsInMessage.containAllFieldsIn;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllFieldsInMessage.containAllFieldsIn;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionSource_target_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionSource_target_Test.java
index c6317fa..bc47d00 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionSource_target_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionSource_target_Test.java
@@ -8,11 +8,11 @@
*/
package com.google.eclipse.protobuf.scoping;
+import static com.google.eclipse.protobuf.junit.IEObjectDescriptions.descriptionsIn;
import static com.google.eclipse.protobuf.junit.core.Setups.integrationTestSetup;
import static com.google.eclipse.protobuf.junit.core.XtextRule.createWith;
-import static com.google.eclipse.protobuf.scoping.ContainAllNames.containAll;
-import static com.google.eclipse.protobuf.scoping.ContainAllFields.containAll;
-import static com.google.eclipse.protobuf.scoping.IEObjectDescriptions.descriptionsIn;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllFields.containAll;
+import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static com.google.eclipse.protobuf.scoping.OptionType.*;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/PackageIntersectionDescriptions.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/PackageIntersectionDescriptions.java
index af48d2d..30c5d6d 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/PackageIntersectionDescriptions.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/PackageIntersectionDescriptions.java
@@ -32,6 +32,7 @@
private final Function<EObject, String> resolver = newResolver(String.class, "name");
+ // See issue 161
Collection<IEObjectDescription> intersection(Package fromImporter, Package fromImported, EObject e) {
if (fromImporter == null || fromImported == null) return emptySet();
return intersection(segmentNames(fromImporter), segmentNames(fromImported), e);