Author: rhauch
Date: 2009-11-30 12:06:05 -0500 (Mon, 30 Nov 2009)
New Revision: 1369
Modified:
trunk/.gitignore
trunk/dna-graph/pom.xml
trunk/dna-graph/src/main/java/org/jboss/dna/graph/query/optimize/RewriteAsRangeCriteria.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java
trunk/dna-jcr/pom.xml
trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/DefinitionCache.java
Log:
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.
Modified: trunk/.gitignore
===================================================================
--- trunk/.gitignore 2009-11-29 12:25:56 UTC (rev 1368)
+++ trunk/.gitignore 2009-11-30 17:06:05 UTC (rev 1369)
@@ -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
Modified: trunk/dna-graph/pom.xml
===================================================================
--- trunk/dna-graph/pom.xml 2009-11-29 12:25:56 UTC (rev 1368)
+++ trunk/dna-graph/pom.xml 2009-11-30 17:06:05 UTC (rev 1369)
@@ -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)
-->
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/query/optimize/RewriteAsRangeCriteria.java
===================================================================
---
trunk/dna-graph/src/main/java/org/jboss/dna/graph/query/optimize/RewriteAsRangeCriteria.java 2009-11-29
12:25:56 UTC (rev 1368)
+++
trunk/dna-graph/src/main/java/org/jboss/dna/graph/query/optimize/RewriteAsRangeCriteria.java 2009-11-30
17:06:05 UTC (rev 1369)
@@ -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 @@
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
Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java 2009-11-29
12:25:56 UTC (rev 1368)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/session/GraphSession.java 2009-11-30
17:06:05 UTC (rev 1369)
@@ -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 @@
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 @@
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 @@
}
// 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 @@
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 @@
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 @@
}
// 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 @@
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);
Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java 2009-11-29
12:25:56 UTC (rev 1368)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java 2009-11-30
17:06:05 UTC (rev 1369)
@@ -513,7 +513,7 @@
this.pathToParent = pathToParent;
this.name = name;
this.state = ElementEntryState.TBD;
- properties = new LinkedHashMultimap<Name, Object>();
+ properties = LinkedHashMultimap.create();
}
protected void setName( Name name ) {
Modified: trunk/dna-jcr/pom.xml
===================================================================
--- trunk/dna-jcr/pom.xml 2009-11-29 12:25:56 UTC (rev 1368)
+++ trunk/dna-jcr/pom.xml 2009-11-30 17:06:05 UTC (rev 1369)
@@ -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>
Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/DefinitionCache.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/DefinitionCache.java 2009-11-29 12:25:56
UTC (rev 1368)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/DefinitionCache.java 2009-11-30 17:06:05
UTC (rev 1369)
@@ -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);