Permalink
Browse files

DNA-561 Google Collections API compatibility issues w/ Weld/AS 6

Applied the patch and successfully ran all of the tests.  Nicely done, John!

Also uploaded the Google Collections 1.0RC3 (jar,sources,javadoc) to the JBoss Maven Repository.

git-svn-id: https://svn.jboss.org/repos/modeshape/trunk@1369 76366958-4244-0410-ad5e-bbfabb93f86b
  • Loading branch information...
1 parent 5670a88 commit 95c874a9d0b74eb7d856b85788b2c65cb7df29b1 @rhauch rhauch committed Nov 30, 2009
View
@@ -41,6 +41,8 @@
/web/dna-web-jcr-rest-war/target/
/web/dna-web-jcr-rest-client/target/
+/utils/dna-jpa-ddl-gen/target/
+
/extensions/dna-classloader-maven/target
/extensions/dna-common-jdbc/target
/extensions/dna-connector-federation/target
View
@@ -32,11 +32,11 @@
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
- <dependency>
- <groupId>com.google.code.google-collections</groupId>
- <artifactId>google-collect</artifactId>
- <version>snapshot-20080530</version>
- </dependency>
+ <dependency>
+ <groupId>com.google.collections</groupId>
+ <artifactId>google-collections</artifactId>
+ <version>1.0-rc3</version>
+ </dependency>
<!--
Testing (note the scope)
-->
@@ -46,6 +46,7 @@
import org.jboss.dna.graph.query.plan.PlanNode;
import org.jboss.dna.graph.query.plan.PlanNode.Property;
import org.jboss.dna.graph.query.plan.PlanNode.Type;
+import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
@@ -80,7 +81,7 @@ public PlanNode execute( QueryContext context,
for (PlanNode access : plan.findAllAtOrBelow(Type.ACCESS)) {
// Look for select nodes below an ACCESS node that have a single Comparison constraint,
// and accumulate them keyed by the dynamic operand ...
- Multimap<DynamicOperand, PlanNode> selectNodeByOperand = Multimaps.newArrayListMultimap();
+ Multimap<DynamicOperand, PlanNode> selectNodeByOperand = ArrayListMultimap.create();
for (PlanNode select : access.findAllAtOrBelow(Type.SELECT)) {
Constraint constraint = select.getProperty(Property.SELECT_CRITERIA, Constraint.class);
// Look for Comparison constraints that use a range operator
@@ -66,6 +66,7 @@
import org.jboss.dna.graph.request.Request;
import org.jboss.dna.graph.session.GraphSession.Authorizer.Action;
import com.google.common.collect.ListMultimap;
+import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimaps;
/**
@@ -86,7 +87,7 @@
@NotThreadSafe
public class GraphSession<Payload, PropertyPayload> {
- protected final ListMultimap<Name, Node<Payload, PropertyPayload>> NO_CHILDREN = Multimaps.immutableMultimap();
+ protected final ListMultimap<Name, Node<Payload, PropertyPayload>> NO_CHILDREN = LinkedListMultimap.create();
protected final Map<Name, PropertyInfo<PropertyPayload>> NO_PROPERTIES = Collections.emptyMap();
protected final Authorizer authorizer;
@@ -1621,7 +1622,7 @@ public void loadedWith( List<Location> children,
if (children.isEmpty()) {
childrenByName = cache.NO_CHILDREN;
} else {
- childrenByName = Multimaps.newLinkedListMultimap();
+ childrenByName = LinkedListMultimap.create();
for (Location location : children) {
NodeId id = cache.idFactory.create();
Name childName = location.getPath().getLastSegment().getName();
@@ -1699,7 +1700,7 @@ protected void synchronizeWithNewlyPersistedNode( Location newChild ) {
Name childName = childPath.getLastSegment().getName();
if (this.childrenByName.isEmpty()) {
// Just have to add the child ...
- this.childrenByName = Multimaps.newLinkedListMultimap();
+ this.childrenByName = LinkedListMultimap.create();
if (childPath.getLastSegment().hasIndex()) {
// The child has a SNS index, but this is an only child ...
newChild = newChild.with(cache.pathFactory.create(childPath.getParent(), childName));
@@ -1710,7 +1711,7 @@ protected void synchronizeWithNewlyPersistedNode( Location newChild ) {
}
// Unfortunately, there is no efficient way to insert into the multi-map, so we need to recreate it ...
- ListMultimap<Name, Node<Payload, PropertyPayload>> children = Multimaps.newLinkedListMultimap();
+ ListMultimap<Name, Node<Payload, PropertyPayload>> children = LinkedListMultimap.create();
boolean added = false;
for (Node<Payload, PropertyPayload> child : this.childrenByName.values()) {
if (!added && child.isNew()) {
@@ -1988,7 +1989,7 @@ protected void moveTo( Node<Payload, PropertyPayload> parent,
child.remove();
// Now add the child ...
if (parent.childrenByName == cache.NO_CHILDREN) {
- parent.childrenByName = Multimaps.newLinkedListMultimap();
+ parent.childrenByName = LinkedListMultimap.create();
}
parent.childrenByName.put(newNodeName, child);
child.parent = parent;
@@ -2035,7 +2036,7 @@ public void copyTo( Node<Payload, PropertyPayload> parent ) {
parent.load();
if (parent.childrenByName == cache.NO_CHILDREN) {
- parent.childrenByName = Multimaps.newLinkedListMultimap();
+ parent.childrenByName = LinkedListMultimap.create();
}
cache.nodeOperations.preCopy(this, parent);
@@ -2101,7 +2102,7 @@ public void orderChildBefore( Path.Segment childToBeMoved,
}
// Unfortunately, there is no efficient way to insert into the multi-map, so we need to recreate it ...
- ListMultimap<Name, Node<Payload, PropertyPayload>> children = Multimaps.newLinkedListMultimap();
+ ListMultimap<Name, Node<Payload, PropertyPayload>> children = LinkedListMultimap.create();
for (Node<Payload, PropertyPayload> child : childrenByName.values()) {
if (child == nodeToBeMoved) continue;
if (before != null && child.getSegment().equals(before)) {
@@ -2388,7 +2389,7 @@ public final Location getLocation() {
Node<Payload, PropertyPayload> child = cache.createNode(this, cache.idFactory.create(), newChild);
child.markAsNew(); // marks parent as changed
if (childrenByName == cache.NO_CHILDREN) {
- childrenByName = Multimaps.newLinkedListMultimap();
+ childrenByName = LinkedListMultimap.create();
}
childrenByName.put(name, child);
@@ -513,7 +513,7 @@ protected ElementEntry( ElementEntry parent,
this.pathToParent = pathToParent;
this.name = name;
this.state = ElementEntryState.TBD;
- properties = new LinkedHashMultimap<Name, Object>();
+ properties = LinkedHashMultimap.create();
}
protected void setName( Name name ) {
View
@@ -102,11 +102,11 @@
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-tests</artifactId>
</dependency>
- <dependency>
- <groupId>com.google.code.google-collections</groupId>
- <artifactId>google-collect</artifactId>
- <version>snapshot-20080530</version>
- </dependency>
+ <dependency>
+ <groupId>com.google.collections</groupId>
+ <artifactId>google-collections</artifactId>
+ <version>1.0-rc3</version>
+ </dependency>
<dependency>
<groupId>org.jboss.security</groupId>
@@ -53,7 +53,7 @@
* first, followed by those of the immediate supertypes, followed by those from those supertypes' supertypes, etc.
* </p>
*/
- private final Multimap<Name, JcrNodeDefinition> childNodeDefinitionsThatAllowSns = new LinkedListMultimap<Name, JcrNodeDefinition>();
+ private final Multimap<Name, JcrNodeDefinition> childNodeDefinitionsThatAllowSns = LinkedListMultimap.create();
/**
* A local cache of all defined and inherited child node definitions, keyed by their name, that do <i>not</i> allow
* same-name-sibilings. This includes residual child node definitions, which are keyed by the
@@ -67,7 +67,7 @@
* first, followed by those of the immediate supertypes, followed by those from those supertypes' supertypes, etc.
* </p>
*/
- private final Multimap<Name, JcrNodeDefinition> childNodeDefinitionsThatAllowNoSns = new LinkedListMultimap<Name, JcrNodeDefinition>();
+ private final Multimap<Name, JcrNodeDefinition> childNodeDefinitionsThatAllowNoSns = LinkedListMultimap.create();
/**
* A local cache of all defined and inherited property definitions, keyed by their name, that allow multiple values. This
@@ -80,7 +80,7 @@
* or the multiple attribute" (Section 4.7.15 of the JSR-283 draft specification).
* </p>
*/
- private final Multimap<Name, JcrPropertyDefinition> multiValuedPropertyDefinitions = new LinkedListMultimap<Name, JcrPropertyDefinition>();
+ private final Multimap<Name, JcrPropertyDefinition> multiValuedPropertyDefinitions = LinkedListMultimap.create();
/**
* A local cache of all defined and inherited property definitions, keyed by their name, that allow single values. This
* includes residual property definitions, which are keyed by the {@link JcrNodeType#RESIDUAL_NAME}. The content of this map
@@ -92,10 +92,10 @@
* or the multiple attribute" (Section 4.7.15 of the JSR-283 draft specification).
* </p>
*/
- private final Multimap<Name, JcrPropertyDefinition> singleValuedPropertyDefinitions = new LinkedListMultimap<Name, JcrPropertyDefinition>();
+ private final Multimap<Name, JcrPropertyDefinition> singleValuedPropertyDefinitions = LinkedListMultimap.create();
- private final Multimap<Name, JcrNodeDefinition> allChildNodeDefinitions = new LinkedListMultimap<Name, JcrNodeDefinition>();
- private final Multimap<Name, JcrPropertyDefinition> allPropertyDefinitions = new LinkedListMultimap<Name, JcrPropertyDefinition>();
+ private final Multimap<Name, JcrNodeDefinition> allChildNodeDefinitions = LinkedListMultimap.create();
+ private final Multimap<Name, JcrPropertyDefinition> allPropertyDefinitions = LinkedListMultimap.create();
DefinitionCache( JcrNodeType nodeType ) {
addDefinitionsForTypeAndAllSupertypes(nodeType);

0 comments on commit 95c874a

Please sign in to comment.