Skip to content

Commit

Permalink
Cleans up some more FindBugs warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwin Shin committed Apr 13, 2013
1 parent f7e391b commit 75029b1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Expand Up @@ -8,7 +8,6 @@
import java.io.IOException;
import java.util.List;

import javax.inject.Inject;
import javax.jcr.NamespaceRegistry;
import javax.jcr.RepositoryException;
import javax.ws.rs.DefaultValue;
Expand All @@ -26,7 +25,6 @@
import org.fcrepo.generator.rdf.TripleSource;
import org.fcrepo.generator.rdf.TripleSource.Triple;
import org.fcrepo.generator.rdf.Utils;
import org.fcrepo.services.ObjectService;
import org.openrdf.model.URI;
import org.openrdf.model.ValueFactory;
import org.openrdf.sail.memory.model.MemValueFactory;
Expand All @@ -38,9 +36,6 @@
public class ObjectRdfGenerator extends AbstractResource {

List<TripleSource<FedoraObject>> objectGenerators;

@Inject
ObjectService objectService;

final private static ValueFactory valFactory = new MemValueFactory();

Expand Down
Expand Up @@ -44,6 +44,9 @@ public List<Triple> getTriples(final Datastream ds,

@Override
public Triple apply(Triple t) {
if (t == null) {
return null;
}
try {
return new Triple(uriInfo.getBaseUriBuilder().path(
"objects").path(ds.getObject().getName())
Expand Down
Expand Up @@ -44,6 +44,9 @@ public List<org.fcrepo.generator.rdf.TripleSource.Triple> getTriples(

@Override
public Triple apply(Triple t) {
if (t == null) {
return null;
}
return new Triple(uriInfo.getBaseUriBuilder().path(
t.subject).build().toString(), t.predicate,
t.object);
Expand Down
Expand Up @@ -54,6 +54,9 @@ public List<Triple> getTriples(final Node source, final UriInfo... uriInfo)

@Override
public Triple apply(Property p) {
if (p == null) {
return null;
}
try {
return new Triple(
p.getParent().getPath(),
Expand All @@ -72,6 +75,9 @@ public Triple apply(Property p) {

@Override
public List<Triple> apply(Property p) {
if (p == null) {
return null;
}
final Builder<Triple> triples = builder();
try {
for (Value v : p.getValues()) {
Expand Down Expand Up @@ -101,7 +107,7 @@ private static String expandJCRNamespace(final String name,
@Override
public boolean apply(Property p) {
try {
return p.isMultiple();
return p == null ? false : p.isMultiple();
} catch (RepositoryException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit 75029b1

Please sign in to comment.