Author: rhauch
Date: 2009-07-29 17:33:49 -0400 (Wed, 29 Jul 2009)
New Revision: 1138
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java
trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorCreateWorkspacesTest.java
trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/DnaJcrDeployer.java
trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/JcrResources.java
Log:
DNA-496 Fixed a number of non-critical compiler errors and warnings that show up in
Eclipse but not the Maven builds.
Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java 2009-07-26 18:25:46 UTC
(rev 1137)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/Graph.java 2009-07-29 21:33:49 UTC
(rev 1138)
@@ -57,7 +57,6 @@
import org.jboss.dna.graph.property.Name;
import org.jboss.dna.graph.property.NameFactory;
import org.jboss.dna.graph.property.Path;
-import org.jboss.dna.graph.property.PathFactory;
import org.jboss.dna.graph.property.PathNotFoundException;
import org.jboss.dna.graph.property.Property;
import org.jboss.dna.graph.property.PropertyFactory;
@@ -3036,9 +3035,9 @@
@Override
protected Batch submit( String workspaceName,
- Location on,
- Name property,
- List<Object> values ) {
+ Location on,
+ Name property,
+ List<Object> values ) {
requests.addValues(workspaceName, on, property, values);
return nextRequests.and();
}
@@ -3050,15 +3049,15 @@
@Override
protected Batch submit( String workspaceName,
- Location on,
- Name property,
- List<Object> values ) {
+ Location on,
+ Name property,
+ List<Object> values ) {
requests.removeValues(workspaceName, on, property, values);
return nextRequests.and();
}
};
}
-
+
/**
* Set the properties on a node.
*
@@ -5064,12 +5063,12 @@
public abstract class AddValueAction<T> extends AbstractAction<T>
implements AddValue<T> {
- private final String workspaceName;
- private final List<Object> values = new LinkedList<Object>();
+ protected final String workspaceName;
+ protected final List<Object> values = new LinkedList<Object>();
protected AddValueAction( T afterConjunction,
- String workspaceName,
- Object firstValue ) {
+ String workspaceName,
+ Object firstValue ) {
super(afterConjunction);
this.workspaceName = workspaceName;
@@ -5082,9 +5081,7 @@
}
public On<T> to( String name ) {
- NameFactory nameFactory = context.getValueFactories().getNameFactory();
-
- return to(nameFactory.create(name));
+ return to(createName(name));
}
public On<T> to( final Name name ) {
@@ -5112,8 +5109,7 @@
}
public T on( String toPath ) {
- PathFactory pathFactory =
context.getValueFactories().getPathFactory();
- return on(Location.create(pathFactory.create(toPath)));
+ return on(Location.create(createPath(toPath)));
}
public T on( UUID to ) {
@@ -5131,8 +5127,8 @@
public abstract class RemoveValueAction<T> extends AbstractAction<T>
implements RemoveValue<T> {
- private final String workspaceName;
- private final List<Object> values = new LinkedList<Object>();
+ protected final String workspaceName;
+ protected final List<Object> values = new LinkedList<Object>();
protected RemoveValueAction( T afterConjunction,
String workspaceName,
@@ -5149,9 +5145,7 @@
}
public On<T> from( String name ) {
- NameFactory nameFactory = context.getValueFactories().getNameFactory();
-
- return from(nameFactory.create(name));
+ return from(createName(name));
}
public On<T> from( final Name name ) {
@@ -5179,8 +5173,7 @@
}
public T on( String toPath ) {
- PathFactory pathFactory =
context.getValueFactories().getPathFactory();
- return on(Location.create(pathFactory.create(toPath)));
+ return on(Location.create(createPath(toPath)));
}
public T on( UUID to ) {
@@ -5188,12 +5181,12 @@
}
};
}
-
+
protected abstract T submit( String workspaceName,
- Location on,
- Name property,
- List<Object> values );
-
+ Location on,
+ Name property,
+ List<Object> values );
+
}
/**
Modified:
trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorCreateWorkspacesTest.java
===================================================================
---
trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorCreateWorkspacesTest.java 2009-07-26
18:25:46 UTC (rev 1137)
+++
trunk/extensions/dna-connector-filesystem/src/test/java/org/jboss/dna/connector/filesystem/FileSystemConnectorCreateWorkspacesTest.java 2009-07-29
21:33:49 UTC (rev 1138)
@@ -25,7 +25,6 @@
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
-import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import org.jboss.dna.graph.Graph;
@@ -92,7 +91,7 @@
}
@Test
- public void shouldReturnListOfWorkspacesMatchingAbsoluteCanonicalPathsToDirectories()
throws IOException {
+ public void shouldReturnListOfWorkspacesMatchingAbsoluteCanonicalPathsToDirectories()
{
// The the actual names of the workspaces ...
Set<String> workspaceNames = new HashSet<String>();
for (String workspaceName : graph.getWorkspaces()) {
@@ -101,7 +100,7 @@
}
// The actual names should be the absolute paths to the directories representing
the root ...
String absolutePathToRepositories =
"./src/test/resources/repositories/";
-
+
assertThat(workspaceNames.remove(absolutePathToRepositories +
"airplanes"), is(true));
assertThat(workspaceNames.remove(absolutePathToRepositories + "cars"),
is(true));
assertThat(workspaceNames.isEmpty(), is(true));
Modified:
trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/DnaJcrDeployer.java
===================================================================
---
trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/DnaJcrDeployer.java 2009-07-26
18:25:46 UTC (rev 1137)
+++
trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/DnaJcrDeployer.java 2009-07-29
21:33:49 UTC (rev 1138)
@@ -25,17 +25,17 @@
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
+import net.jcip.annotations.NotThreadSafe;
import org.jboss.dna.web.jcr.rest.spi.RepositoryProvider;
-import net.jcip.annotations.NotThreadSafe;
-
/**
- * Servlet context listener that is responsible for {@link
RepositoryFactory#initialize(javax.servlet.ServletContext) initializing}
- * the {@link RepositoryFactory repository factory}.
+ * Servlet context listener that is responsible for {@link
RepositoryFactory#initialize(javax.servlet.ServletContext)
+ * initializing} the {@link RepositoryFactory repository factory}.
* <p>
- * This class is not thread safe, but in practice this does not matter as the servlet
container must ensure that only
- * a single instance of this exists per web context and that it is only called in a
single-threaded manner.
+ * This class is not thread safe, but in practice this does not matter as the servlet
container must ensure that only a single
+ * instance of this exists per web context and that it is only called in a
single-threaded manner.
* </p>
+ *
* @see RepositoryFactory
*/
@NotThreadSafe
@@ -43,6 +43,8 @@
/**
* Alerts the repository factory that the web application is shutting down
+ *
+ * @param event the servlet context event
* @see RepositoryFactory#shutdown()
* @see RepositoryProvider#shutdown()
*/
@@ -52,6 +54,8 @@
/**
* Initializes the repository factory
+ *
+ * @param event the servlet context event
* @see RepositoryFactory#initialize(javax.servlet.ServletContext)
*/
public void contextInitialized( ServletContextEvent event ) {
Modified:
trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/JcrResources.java
===================================================================
---
trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/JcrResources.java 2009-07-26
18:25:46 UTC (rev 1137)
+++
trunk/extensions/dna-web-jcr-rest/src/main/java/org/jboss/dna/web/jcr/rest/JcrResources.java 2009-07-29
21:33:49 UTC (rev 1138)
@@ -128,7 +128,7 @@
*/
private Session getSession( HttpServletRequest request,
String rawRepositoryName,
- String rawWorkspaceName ) throws NotFoundException,
RepositoryException {
+ String rawWorkspaceName ) throws RepositoryException {
assert request != null;
assert request.getUserPrincipal() != null : "Request must be
authorized";
@@ -477,21 +477,21 @@
values[i] = jsonValues.getString(i);
}
} else {
- values = new String[] { (String)value };
+ values = new String[] {(String)value};
}
if (propName.equals(JcrResources.MIXIN_TYPES_PROPERTY)) {
Set<String> toBeMixins = new
HashSet<String>(Arrays.asList(values));
Set<String> asIsMixins = new HashSet<String>();
-
+
for (NodeType nodeType : node.getMixinNodeTypes()) {
asIsMixins.add(nodeType.getName());
}
-
+
Set<String> mixinsToAdd = new HashSet<String>(toBeMixins);
mixinsToAdd.removeAll(asIsMixins);
asIsMixins.removeAll(toBeMixins);
-
+
for (String nodeType : mixinsToAdd) {
node.addMixin(nodeType);
}
@@ -502,9 +502,8 @@
} else {
if (values.length == 1) {
node.setProperty(propName, values[0]);
-
- }
- else {
+
+ } else {
node.setProperty(propName, values);
}
}