commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [6/7] incubator-commonsrdf git commit: Add final modifier to local variables.
Date Fri, 11 Nov 2016 22:50:52 GMT
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdGraphLike.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdGraphLike.java b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdGraphLike.java
index 7424f3d..1549109 100644
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdGraphLike.java
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdGraphLike.java
@@ -99,7 +99,7 @@ abstract class AbstractJsonLdGraphLike<T extends TripleLike> implements JsonLdGr
         // add triples to default graph by default
         BlankNodeOrIRI graphName = null;
         if (t instanceof org.apache.commons.rdf.api.Quad) {
-            org.apache.commons.rdf.api.Quad q = (org.apache.commons.rdf.api.Quad) t;
+            final org.apache.commons.rdf.api.Quad q = (org.apache.commons.rdf.api.Quad) t;
             graphName = q.getGraphName().orElse(null);
         }
         // FIXME: JSON-LD's rdfDataSet.addQuad method does not support
@@ -108,16 +108,16 @@ abstract class AbstractJsonLdGraphLike<T extends TripleLike> implements JsonLdGr
     }
 
     void add(final BlankNodeOrIRI graphName, final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        String g = factory.asJsonLdString(graphName);
-        String s = factory.asJsonLdString(subject);
-        String p = factory.asJsonLdString(predicate);
+        final String g = factory.asJsonLdString(graphName);
+        final String s = factory.asJsonLdString(subject);
+        final String p = factory.asJsonLdString(predicate);
         if (object instanceof BlankNodeOrIRI) {
-            String o = factory.asJsonLdString((BlankNodeOrIRI) object);
+            final String o = factory.asJsonLdString((BlankNodeOrIRI) object);
             rdfDataSet.addQuad(s, p, o, g);
         } else if (object instanceof Literal) {
-            Literal literal = (Literal) object;
-            String language = literal.getLanguageTag().orElse(null);
-            String datatype = literal.getDatatype().getIRIString();
+            final Literal literal = (Literal) object;
+            final String language = literal.getLanguageTag().orElse(null);
+            final String datatype = literal.getDatatype().getIRIString();
             rdfDataSet.addQuad(s, p, literal.getLexicalForm(), datatype, language, g);
         }
     }
@@ -186,16 +186,16 @@ abstract class AbstractJsonLdGraphLike<T extends TripleLike> implements JsonLdGr
 
     String graphNameAsJsonLdString(final T tripleOrQuad) {
         if (tripleOrQuad instanceof org.apache.commons.rdf.api.Quad) {
-            org.apache.commons.rdf.api.Quad quad = (org.apache.commons.rdf.api.Quad) tripleOrQuad;
+            final org.apache.commons.rdf.api.Quad quad = (org.apache.commons.rdf.api.Quad) tripleOrQuad;
             return quad.getGraphName().map(factory::asJsonLdString).orElse("@default");
         }
         return "@default";
     }
 
     Predicate<RDFDataset.Quad> quadFilter(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        Optional<Node> subjectNode = Optional.ofNullable(subject).map(factory::asJsonLdNode);
-        Optional<Node> predicateNode = Optional.ofNullable(predicate).map(factory::asJsonLdNode);
-        Optional<Node> objectNode = Optional.ofNullable(object).map(factory::asJsonLdNode);
+        final Optional<Node> subjectNode = Optional.ofNullable(subject).map(factory::asJsonLdNode);
+        final Optional<Node> predicateNode = Optional.ofNullable(predicate).map(factory::asJsonLdNode);
+        final Optional<Node> objectNode = Optional.ofNullable(object).map(factory::asJsonLdNode);
 
         return q -> {
             if (subjectNode.isPresent() && subjectNode.get().compareTo(q.getSubject()) != 0) {

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdIRI.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdIRI.java b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdIRI.java
index 616ffc7..134fd94 100644
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdIRI.java
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdIRI.java
@@ -58,7 +58,7 @@ final class JsonLdIRIImpl extends JsonLdTermImpl implements JsonLdIRI {
         if (!(obj instanceof IRI)) {
             return false;
         }
-        IRI other = (IRI) obj;
+        final IRI other = (IRI) obj;
         return node.getValue().equals(other.getIRIString());
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdLiteral.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdLiteral.java b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdLiteral.java
index 8155374..2414087 100644
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdLiteral.java
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdLiteral.java
@@ -40,7 +40,7 @@ class JsonLdLiteralImpl extends JsonLdTermImpl implements JsonLdLiteral {
 
     @Override
     public String ntriplesString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append('"');
         // Escape special characters
         sb.append(getLexicalForm().replace("\\", "\\\\"). // escaped to \\
@@ -84,11 +84,11 @@ class JsonLdLiteralImpl extends JsonLdTermImpl implements JsonLdLiteral {
     @Override
     public boolean equals(final Object obj) {
         if (obj instanceof JsonLdLiteral) {
-            JsonLdLiteral other = (JsonLdLiteral) obj;
+            final JsonLdLiteral other = (JsonLdLiteral) obj;
             return asJsonLdNode().compareTo(other.asJsonLdNode()) == 0;
         }
         if (obj instanceof Literal) {
-            Literal other = (Literal) obj;
+            final Literal other = (Literal) obj;
             return getLexicalForm().equals(other.getLexicalForm()) && getDatatype().equals(other.getDatatype())
                     && getLanguageTag().equals(other.getLanguageTag());
         }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdQuad.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdQuad.java b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdQuad.java
index 3fe9a41..bf37c6c 100644
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdQuad.java
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdQuad.java
@@ -43,7 +43,7 @@ final class JsonLdQuadImpl extends JsonLdQuadLikeImpl<BlankNodeOrIRI, IRI, RDFTe
         if (!(obj instanceof org.apache.commons.rdf.api.Quad)) {
             return false;
         }
-        org.apache.commons.rdf.api.Quad other = (org.apache.commons.rdf.api.Quad) obj;
+        final org.apache.commons.rdf.api.Quad other = (org.apache.commons.rdf.api.Quad) obj;
         return getGraphName().equals(other.getGraphName()) && getSubject().equals(other.getSubject())
                 && getPredicate().equals(other.getPredicate()) && getObject().equals(other.getObject());
     }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdQuadLike.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdQuadLike.java b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdQuadLike.java
index 496bbad..b008bab 100644
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdQuadLike.java
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdQuadLike.java
@@ -46,7 +46,7 @@ class JsonLdQuadLikeImpl<S extends RDFTerm, P extends RDFTerm, O extends RDFTerm
     @SuppressWarnings("unchecked")
     @Override
     public Optional<G> getGraphName() {
-        G g = (G) rdfTermFactory.asRDFTerm(quad.getGraph(), blankNodePrefix);
+        final G g = (G) rdfTermFactory.asRDFTerm(quad.getGraph(), blankNodePrefix);
         return Optional.ofNullable(g);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDF.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDF.java b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDF.java
index a28984d..816cf2f 100644
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDF.java
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdRDF.java
@@ -88,7 +88,7 @@ public final class JsonLdRDF implements RDF {
 
     public Node asJsonLdNode(final RDFTerm term) {
         if (term instanceof JsonLdBlankNode) {
-            JsonLdBlankNode jsonLdBlankNode = (JsonLdBlankNode) term;
+            final JsonLdBlankNode jsonLdBlankNode = (JsonLdBlankNode) term;
             if (jsonLdBlankNode.uniqueReference().startsWith(bnodePrefix)) {
                 // Only return blank nodes 'as is' if they have the same prefix
                 return jsonLdBlankNode.asJsonLdNode();
@@ -101,7 +101,7 @@ public final class JsonLdRDF implements RDF {
             return new RDFDataset.IRI(((IRI) term).getIRIString());
         }
         if (term instanceof BlankNode) {
-            String ref = ((BlankNode) term).uniqueReference();
+            final String ref = ((BlankNode) term).uniqueReference();
             if (ref.startsWith(bnodePrefix)) {
                 // one of our own (but no longer a JsonLdBlankNode),
                 // we can recover the label after our unique prefix
@@ -109,11 +109,11 @@ public final class JsonLdRDF implements RDF {
             }
             // The "foreign" unique reference might not be a valid bnode string,
             // we'll convert to a UUID
-            UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));
+            final UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));
             return new RDFDataset.BlankNode("_:" + uuid);
         }
         if (term instanceof Literal) {
-            Literal literal = (Literal) term;
+            final Literal literal = (Literal) term;
             return new RDFDataset.Literal(literal.getLexicalForm(), literal.getDatatype().getIRIString(),
                     literal.getLanguageTag().orElse(null));
         }
@@ -129,7 +129,7 @@ public final class JsonLdRDF implements RDF {
      * @return Adapted JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad}
      */
     public RDFDataset.Quad asJsonLdQuad(final org.apache.commons.rdf.api.Quad quad) {
-        BlankNodeOrIRI g = quad.getGraphName().orElse(null);
+        final BlankNodeOrIRI g = quad.getGraphName().orElse(null);
         return createJsonLdQuad(g, quad.getSubject(), quad.getPredicate(), quad.getObject());
     }
 
@@ -215,13 +215,13 @@ public final class JsonLdRDF implements RDF {
 
     @Override
     public JsonLdBlankNode createBlankNode() {
-        String id = "_:" + UUID.randomUUID().toString();
+        final String id = "_:" + UUID.randomUUID().toString();
         return new JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix);
     }
 
     @Override
     public JsonLdBlankNode createBlankNode(final String name) {
-        String id = "_:" + name;
+        final String id = "_:" + name;
         // TODO: Check if name is valid JSON-LD BlankNode identifier
         return new JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix);
     }
@@ -274,8 +274,8 @@ public final class JsonLdRDF implements RDF {
         if (blankNodeOrIRI instanceof IRI) {
             return ((IRI) blankNodeOrIRI).getIRIString();
         } else if (blankNodeOrIRI instanceof BlankNode) {
-            BlankNode blankNode = (BlankNode) blankNodeOrIRI;
-            String ref = blankNode.uniqueReference();
+            final BlankNode blankNode = (BlankNode) blankNodeOrIRI;
+            final String ref = blankNode.uniqueReference();
             if (ref.startsWith(bnodePrefix)) {
                 // One of ours (but possibly not a JsonLdBlankNode) -
                 // we can use the suffix directly
@@ -283,7 +283,7 @@ public final class JsonLdRDF implements RDF {
             } else {
                 // Map to unique bnode identifier, e.g.
                 // _:0dbd92ee-ab1a-45e7-bba2-7ade54f87ec5
-                UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));
+                final UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));
                 return "_:" + uuid;
             }
         } else {

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdTriple.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdTriple.java b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdTriple.java
index 727eb04..4211c8f 100644
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdTriple.java
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdTriple.java
@@ -41,7 +41,7 @@ final class JsonLdTripleImpl extends JsonLdQuadLikeImpl<BlankNodeOrIRI, IRI, RDF
         if (!(obj instanceof Triple)) {
             return false;
         }
-        Triple other = (Triple) obj;
+        final Triple other = (Triple) obj;
         return getSubject().equals(other.getSubject()) && getPredicate().equals(other.getPredicate())
                 && getObject().equals(other.getObject());
     }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/experimental/JsonLdParser.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/experimental/JsonLdParser.java b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/experimental/JsonLdParser.java
index 94fd981..430df02 100644
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/experimental/JsonLdParser.java
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/experimental/JsonLdParser.java
@@ -58,7 +58,7 @@ public class JsonLdParser extends AbstractRDFParser<JsonLdParser> {
 
     @Override
     public JsonLdParser contentType(final String contentType) throws IllegalArgumentException {
-        JsonLdParser c = super.contentType(contentType);
+        final JsonLdParser c = super.contentType(contentType);
         if (c.getContentType().filter(Predicate.isEqual(RDFSyntax.JSONLD).negate()).isPresent()) {
             throw new IllegalArgumentException("Unsupported contentType: " + contentType);
         }
@@ -82,8 +82,8 @@ public class JsonLdParser extends AbstractRDFParser<JsonLdParser> {
 
     @Override
     protected void parseSynchronusly() throws IOException {
-        Object json = readSource();
-        JsonLdOptions options = new JsonLdOptions();
+        final Object json = readSource();
+        final JsonLdOptions options = new JsonLdOptions();
         getBase().map(IRI::getIRIString).ifPresent(options::setBase);
         // TODO: base from readSource() (after redirection and Content-Location
         // header)
@@ -93,26 +93,26 @@ public class JsonLdParser extends AbstractRDFParser<JsonLdParser> {
         RDFDataset rdfDataset;
         try {
             rdfDataset = (RDFDataset) JsonLdProcessor.toRDF(json, options);
-        } catch (JsonLdError e) {
+        } catch (final JsonLdError e) {
             throw new IOException("Could not parse Json-LD", e);
         }
         if (getTargetGraph().isPresent()) {
-            Graph intoGraph = getTargetGraph().get();
+            final Graph intoGraph = getTargetGraph().get();
             if (intoGraph instanceof JsonLdGraph && !intoGraph.contains(null, null, null)) {
                 // Empty graph, we can just move over the map content directly:
-                JsonLdGraph jsonLdGraph = (JsonLdGraph) intoGraph;
+                final JsonLdGraph jsonLdGraph = (JsonLdGraph) intoGraph;
                 jsonLdGraph.getRdfDataSet().putAll(rdfDataset);
                 return;
                 // otherwise we have to merge as normal
             }
             // TODO: Modify JsonLdProcessor to have an actual triple callback
-            Graph parsedGraph = getJsonLdFactory().asGraph(rdfDataset);
+            final Graph parsedGraph = getJsonLdFactory().asGraph(rdfDataset);
             // sequential() as we don't know if destination is thread safe :-/
             parsedGraph.stream().sequential().forEach(intoGraph::add);
         } else if (getTargetDataset().isPresent()) {
-            Dataset intoDataset = getTargetDataset().get();
+            final Dataset intoDataset = getTargetDataset().get();
             if (intoDataset instanceof JsonLdDataset && !intoDataset.contains(null, null, null, null)) {
-                JsonLdDataset jsonLdDataset = (JsonLdDataset) intoDataset;
+                final JsonLdDataset jsonLdDataset = (JsonLdDataset) intoDataset;
                 // Empty - we can just do a brave replace!
                 jsonLdDataset.getRdfDataSet().putAll(rdfDataset);
                 return;
@@ -121,11 +121,11 @@ public class JsonLdParser extends AbstractRDFParser<JsonLdParser> {
                 // map blank nodes etc, so we'll fall back to normal Dataset
                 // appending.
             }
-            Dataset fromDataset = getJsonLdFactory().asDataset(rdfDataset);
+            final Dataset fromDataset = getJsonLdFactory().asDataset(rdfDataset);
             // .sequential() as we don't know if destination is thread-safe :-/
             fromDataset.stream().sequential().forEach(intoDataset::add);
         } else {
-            Dataset fromDataset = getJsonLdFactory().asDataset(rdfDataset);
+            final Dataset fromDataset = getJsonLdFactory().asDataset(rdfDataset);
             // No need for .sequential() here
             fromDataset.stream().forEach(getTarget());
         }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdParserBuilderTest.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdParserBuilderTest.java b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdParserBuilderTest.java
index 330447f..17adfcb 100644
--- a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdParserBuilderTest.java
+++ b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdParserBuilderTest.java
@@ -52,30 +52,30 @@ public class JsonLdParserBuilderTest {
 
     @Test
     public void parseByUrl() throws Exception {
-        URL url = getClass().getResource(TEST_JSONLD);
+        final URL url = getClass().getResource(TEST_JSONLD);
         assertNotNull("Test resource not found: " + TEST_JSONLD, url);
-        IRI iri = factory.createIRI(url.toString());
-        Graph g = factory.createGraph();
+        final IRI iri = factory.createIRI(url.toString());
+        final Graph g = factory.createGraph();
         new JsonLdParser().contentType(RDFSyntax.JSONLD).source(iri).target(g).parse().get(10, TimeUnit.SECONDS);
         checkGraph(g);
     }
 
     @Test
     public void parseByPath() throws Exception {
-        Path path = Files.createTempFile("test", ".jsonld");
+        final Path path = Files.createTempFile("test", ".jsonld");
         path.toFile().deleteOnExit();
         try (InputStream is = getClass().getResourceAsStream(TEST_JSONLD)) {
             assertNotNull("Test resource not found: " + TEST_JSONLD, is);
             Files.copy(is, path, StandardCopyOption.REPLACE_EXISTING);
         }
-        Graph g = factory.createGraph();
+        final Graph g = factory.createGraph();
         new JsonLdParser().contentType(RDFSyntax.JSONLD).source(path).target(g).parse().get(10, TimeUnit.SECONDS);
         checkGraph(g);
     }
 
     @Test
     public void parseByStream() throws Exception {
-        Graph g = factory.createGraph();
+        final Graph g = factory.createGraph();
         try (InputStream is = getClass().getResourceAsStream(TEST_JSONLD)) {
             assertNotNull("Test resource not found: " + TEST_JSONLD, is);
             new JsonLdParser().base("http://example.com/base/").contentType(RDFSyntax.JSONLD).source(is).target(g)

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdServiceLoaderTest.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdServiceLoaderTest.java b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdServiceLoaderTest.java
index e23fc3d..7e5a483 100644
--- a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdServiceLoaderTest.java
+++ b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdServiceLoaderTest.java
@@ -29,8 +29,8 @@ public class JsonLdServiceLoaderTest {
 
     @Test
     public void testServiceLoaderLookup() {
-        ServiceLoader<RDF> loader = ServiceLoader.load(RDF.class);
-        for (RDF impl : loader) {
+        final ServiceLoader<RDF> loader = ServiceLoader.load(RDF.class);
+        for (final RDF impl : loader) {
             if (impl instanceof JsonLdRDF) {
                 return; // yay
             }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4J.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4J.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4J.java
index e6f0db4..2d39bbd 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4J.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4J.java
@@ -285,7 +285,7 @@ public final class RDF4J implements RDF {
      * @return A {@link Dataset} backed by the RDF4J repository.
      */
     public RDF4JDataset asDataset(final Repository repository, final Option... options) {
-        EnumSet<Option> opts = optionSet(options);
+        final EnumSet<Option> opts = optionSet(options);
         return rdf4j.createRepositoryDatasetImpl(repository, opts.contains(Option.handleInitAndShutdown),
                 opts.contains(Option.includeInferred));
     }
@@ -323,7 +323,7 @@ public final class RDF4J implements RDF {
      * @return A {@link Graph} backed by the RDF4J repository.
      */
     public RDF4JGraph asGraph(final Repository repository, final Option... options) {
-        EnumSet<Option> opts = optionSet(options);
+        final EnumSet<Option> opts = optionSet(options);
         return rdf4j.createRepositoryGraphImpl(repository, opts.contains(Option.handleInitAndShutdown),
                 opts.contains(Option.includeInferred), new Resource[] { null }); // default
                                                                                  // graph
@@ -343,7 +343,7 @@ public final class RDF4J implements RDF {
      * @return A union {@link Graph} backed by the RDF4J repository.
      */
     public RDF4JGraph asGraphUnion(final Repository repository, final Option... options) {
-        EnumSet<Option> opts = optionSet(options);
+        final EnumSet<Option> opts = optionSet(options);
         return rdf4j.createRepositoryGraphImpl(repository, opts.contains(Option.handleInitAndShutdown),
                 opts.contains(Option.includeInferred), new Resource[] {}); // union
                                                                            // graph
@@ -376,9 +376,9 @@ public final class RDF4J implements RDF {
      * @return A {@link Graph} backed by the RDF4J repository.
      */
     public RDF4JGraph asGraph(final Repository repository, final Set<? extends BlankNodeOrIRI> contexts, final Option... option) {
-        EnumSet<Option> opts = optionSet(option);
+        final EnumSet<Option> opts = optionSet(option);
         /** NOTE: asValue() deliberately CAN handle <code>null</code> */
-        Resource[] resources = contexts.stream().map(g -> (Resource) asValue(g)).toArray(Resource[]::new);
+        final Resource[] resources = contexts.stream().map(g -> (Resource) asValue(g)).toArray(Resource[]::new);
         return rdf4j.createRepositoryGraphImpl(Objects.requireNonNull(repository),
                 opts.contains(Option.handleInitAndShutdown), opts.contains(Option.includeInferred), resources);
     }
@@ -405,13 +405,13 @@ public final class RDF4J implements RDF {
             return ((RDF4JTripleLike) tripleLike).asStatement();
         }
 
-        org.eclipse.rdf4j.model.Resource subject = (org.eclipse.rdf4j.model.Resource) asValue(tripleLike.getSubject());
-        org.eclipse.rdf4j.model.IRI predicate = (org.eclipse.rdf4j.model.IRI) asValue(tripleLike.getPredicate());
-        Value object = asValue(tripleLike.getObject());
+        final org.eclipse.rdf4j.model.Resource subject = (org.eclipse.rdf4j.model.Resource) asValue(tripleLike.getSubject());
+        final org.eclipse.rdf4j.model.IRI predicate = (org.eclipse.rdf4j.model.IRI) asValue(tripleLike.getPredicate());
+        final Value object = asValue(tripleLike.getObject());
 
         org.eclipse.rdf4j.model.Resource context = null;
         if (tripleLike instanceof Quad) {
-            Quad quad = (Quad) tripleLike;
+            final Quad quad = (Quad) tripleLike;
             context = (org.eclipse.rdf4j.model.Resource) asValue(quad.getGraphName().orElse(null));
         }
 
@@ -472,22 +472,22 @@ public final class RDF4J implements RDF {
             return ((RDF4JTerm) term).asValue();
         }
         if (term instanceof org.apache.commons.rdf.api.IRI) {
-            org.apache.commons.rdf.api.IRI iri = (org.apache.commons.rdf.api.IRI) term;
+            final org.apache.commons.rdf.api.IRI iri = (org.apache.commons.rdf.api.IRI) term;
             return getValueFactory().createIRI(iri.getIRIString());
         }
         if (term instanceof org.apache.commons.rdf.api.Literal) {
-            org.apache.commons.rdf.api.Literal literal = (org.apache.commons.rdf.api.Literal) term;
-            String label = literal.getLexicalForm();
+            final org.apache.commons.rdf.api.Literal literal = (org.apache.commons.rdf.api.Literal) term;
+            final String label = literal.getLexicalForm();
             if (literal.getLanguageTag().isPresent()) {
-                String lang = literal.getLanguageTag().get();
+                final String lang = literal.getLanguageTag().get();
                 return getValueFactory().createLiteral(label, lang);
             }
-            org.eclipse.rdf4j.model.IRI dataType = (org.eclipse.rdf4j.model.IRI) asValue(literal.getDatatype());
+            final org.eclipse.rdf4j.model.IRI dataType = (org.eclipse.rdf4j.model.IRI) asValue(literal.getDatatype());
             return getValueFactory().createLiteral(label, dataType);
         }
         if (term instanceof BlankNode) {
             // This is where it gets tricky to support round trips!
-            BlankNode blankNode = (BlankNode) term;
+            final BlankNode blankNode = (BlankNode) term;
             // FIXME: The uniqueReference might not be a valid BlankNode
             // identifier..
             // does it have to be in RDF4J?
@@ -498,13 +498,13 @@ public final class RDF4J implements RDF {
 
     @Override
     public RDF4JBlankNode createBlankNode() {
-        BNode bnode = getValueFactory().createBNode();
+        final BNode bnode = getValueFactory().createBNode();
         return (RDF4JBlankNode) asRDFTerm(bnode);
     }
 
     @Override
     public RDF4JBlankNode createBlankNode(final String name) {
-        BNode bnode = getValueFactory().createBNode(name);
+        final BNode bnode = getValueFactory().createBNode(name);
         return (RDF4JBlankNode) asRDFTerm(bnode);
     }
 
@@ -519,8 +519,8 @@ public final class RDF4J implements RDF {
      */
     @Override
     public RDF4JDataset createDataset() {
-        Sail sail = new MemoryStore();
-        Repository repository = new SailRepository(sail);
+        final Sail sail = new MemoryStore();
+        final Repository repository = new SailRepository(sail);
         return rdf4j.createRepositoryDatasetImpl(repository, true, false);
     }
 
@@ -536,22 +536,22 @@ public final class RDF4J implements RDF {
 
     @Override
     public RDF4JLiteral createLiteral(final String lexicalForm) throws IllegalArgumentException {
-        org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm);
+        final org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm);
         return (RDF4JLiteral) asRDFTerm(lit);
     }
 
     @Override
     public org.apache.commons.rdf.api.Literal createLiteral(final String lexicalForm, final org.apache.commons.rdf.api.IRI dataType)
             throws IllegalArgumentException {
-        org.eclipse.rdf4j.model.IRI iri = getValueFactory().createIRI(dataType.getIRIString());
-        org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm, iri);
+        final org.eclipse.rdf4j.model.IRI iri = getValueFactory().createIRI(dataType.getIRIString());
+        final org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm, iri);
         return (org.apache.commons.rdf.api.Literal) asRDFTerm(lit);
     }
 
     @Override
     public org.apache.commons.rdf.api.Literal createLiteral(final String lexicalForm, final String languageTag)
             throws IllegalArgumentException {
-        org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm, languageTag);
+        final org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm, languageTag);
         return (org.apache.commons.rdf.api.Literal) asRDFTerm(lit);
     }
 
@@ -578,7 +578,7 @@ public final class RDF4J implements RDF {
     }
 
     private EnumSet<Option> optionSet(final Option... options) {
-        EnumSet<Option> opts = EnumSet.noneOf(Option.class);
+        final EnumSet<Option> opts = EnumSet.noneOf(Option.class);
         opts.addAll(Arrays.asList(options));
         return opts;
     }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
index f88d597..568f5b0 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java
@@ -113,7 +113,7 @@ public class RDF4JParser extends AbstractRDFParser<RDF4JParser> implements RDFPa
 
     @Override
     protected RDF4JParser prepareForParsing() throws IOException, IllegalStateException {
-        RDF4JParser c = super.prepareForParsing();
+        final RDF4JParser c = super.prepareForParsing();
         // Ensure we have an RDF4J for conversion.
         // We'll make a new one if user has provided a non-RDF4J factory
         c.rdf4jTermFactory = (RDF4J) getRdfTermFactory().filter(RDF4J.class::isInstance)
@@ -123,13 +123,13 @@ public class RDF4JParser extends AbstractRDFParser<RDF4JParser> implements RDFPa
 
     @Override
     protected void parseSynchronusly() throws IOException {
-        Optional<RDFFormat> formatByMimeType = getContentType().flatMap(Rio::getParserFormatForMIMEType);
-        String base = getBase().map(IRI::getIRIString).orElse(null);
+        final Optional<RDFFormat> formatByMimeType = getContentType().flatMap(Rio::getParserFormatForMIMEType);
+        final String base = getBase().map(IRI::getIRIString).orElse(null);
 
-        ParserConfig parserConfig = getParserConfig();
+        final ParserConfig parserConfig = getParserConfig();
         // TODO: Should we need to set anything?
-        RDFLoader loader = new RDFLoader(parserConfig, rdf4jTermFactory.getValueFactory());
-        RDFHandler rdfHandler = makeRDFHandler();
+        final RDFLoader loader = new RDFLoader(parserConfig, rdf4jTermFactory.getValueFactory());
+        final RDFHandler rdfHandler = makeRDFHandler();
         if (getSourceFile().isPresent()) {
             // NOTE: While we could have used
             // loader.load(sourcePath.toFile()
@@ -139,12 +139,12 @@ public class RDF4JParser extends AbstractRDFParser<RDF4JParser> implements RDFPa
             // we'll always do it with our own input stream
             //
             // That means we may have to guess format by extensions:
-            Optional<RDFFormat> formatByFilename = getSourceFile().map(Path::getFileName).map(Path::toString)
+            final Optional<RDFFormat> formatByFilename = getSourceFile().map(Path::getFileName).map(Path::toString)
                     .flatMap(Rio::getParserFormatForFileName);
             // TODO: for the excited.. what about the extension after following
             // symlinks?
 
-            RDFFormat format = formatByMimeType.orElse(formatByFilename.orElse(null));
+            final RDFFormat format = formatByMimeType.orElse(formatByFilename.orElse(null));
             try (InputStream in = Files.newInputStream(getSourceFile().get())) {
                 loader.load(in, base, format, rdfHandler);
             }
@@ -152,11 +152,11 @@ public class RDF4JParser extends AbstractRDFParser<RDF4JParser> implements RDFPa
             try {
                 // TODO: Handle international IRIs properly
                 // (Unicode support for for hostname, path and query)
-                URL url = new URL(getSourceIri().get().getIRIString());
+                final URL url = new URL(getSourceIri().get().getIRIString());
                 // TODO: This probably does not support https:// -> http://
                 // redirections
                 loader.load(url, base, formatByMimeType.orElse(null), makeRDFHandler());
-            } catch (MalformedURLException ex) {
+            } catch (final MalformedURLException ex) {
                 throw new IOException("Can't handle source URL: " + getSourceIri().get(), ex);
             }
         }
@@ -199,33 +199,33 @@ public class RDF4JParser extends AbstractRDFParser<RDF4JParser> implements RDFPa
 
         if (getTargetDataset().filter(RDF4JDataset.class::isInstance).isPresent()) {
             // One of us, we can add them as Statements directly
-            RDF4JDataset dataset = (RDF4JDataset) getTargetDataset().get();
+            final RDF4JDataset dataset = (RDF4JDataset) getTargetDataset().get();
             if (dataset.asRepository().isPresent()) {
                 return new RDFInserter(dataset.asRepository().get().getConnection());
             }
             if (dataset.asModel().isPresent()) {
-                Model model = dataset.asModel().get();
+                final Model model = dataset.asModel().get();
                 return new AddToModel(model);
             }
             // Not backed by Repository or Model?
             // Third-party RDF4JDataset subclass, so we'll fall through to the
             // getTarget() handling further down
         } else if (getTargetGraph().filter(RDF4JGraph.class::isInstance).isPresent()) {
-            RDF4JGraph graph = (RDF4JGraph) getTargetGraph().get();
+            final RDF4JGraph graph = (RDF4JGraph) getTargetGraph().get();
 
             if (graph.asRepository().isPresent()) {
-                RDFInserter inserter = new RDFInserter(graph.asRepository().get().getConnection());
+                final RDFInserter inserter = new RDFInserter(graph.asRepository().get().getConnection());
                 if (!graph.getContextMask().isEmpty()) {
-                    Stream<RDF4JBlankNodeOrIRI> b = graph.getContextMask().stream();
-                    Stream<Resource> c = b.map(RDF4JBlankNodeOrIRI::asValue);
-                    Resource[] contexts = c.toArray(Resource[]::new);
+                    final Stream<RDF4JBlankNodeOrIRI> b = graph.getContextMask().stream();
+                    final Stream<Resource> c = b.map(RDF4JBlankNodeOrIRI::asValue);
+                    final Resource[] contexts = c.toArray(Resource[]::new);
                     inserter.enforceContext(contexts);
                 }
                 return inserter;
             }
             if (graph.asModel().isPresent() && graph.getContextMask().isEmpty()) {
                 // the model accepts any quad
-                Model model = graph.asModel().get();
+                final Model model = graph.asModel().get();
                 return new AddToModel(model);
             }
             // else - fall through

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/BlankNodeImpl.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/BlankNodeImpl.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/BlankNodeImpl.java
index b1ae874..7120273 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/BlankNodeImpl.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/BlankNodeImpl.java
@@ -46,7 +46,7 @@ final class BlankNodeImpl extends AbstractRDFTerm<BNode> implements RDF4JBlankNo
         // NOTE: Do NOT use Bnode.equals() as it has a more generous
         // equality based only on the value.getID();
         if (obj instanceof BlankNode) {
-            BlankNode blankNode = (BlankNode) obj;
+            final BlankNode blankNode = (BlankNode) obj;
             return uniqueReference().equals(blankNode.uniqueReference());
         }
         return false;
@@ -87,7 +87,7 @@ final class BlankNodeImpl extends AbstractRDFTerm<BNode> implements RDF4JBlankNo
 
     @Override
     public String uniqueReference() {
-        UUID uuid = new UUID(saltUUIDmost, saltUUIDleast);
+        final UUID uuid = new UUID(saltUUIDmost, saltUUIDleast);
         return "urn:uuid:" + uuid + "#" + value.getID();
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ConvertedStatements.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ConvertedStatements.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ConvertedStatements.java
index 6c3af99..6d8cd57 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ConvertedStatements.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ConvertedStatements.java
@@ -55,7 +55,7 @@ final class ConvertedStatements<T> implements ClosableIterable<T> {
     private final class ConvertedIterator implements Iterator<T> {
         @Override
         public boolean hasNext() {
-            boolean hasNext = results.hasNext();
+            final boolean hasNext = results.hasNext();
             if (!hasNext) {
                 close();
             }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/IRIImpl.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/IRIImpl.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/IRIImpl.java
index e92c03b..e2522d6 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/IRIImpl.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/IRIImpl.java
@@ -31,11 +31,11 @@ final class IRIImpl extends AbstractRDFTerm<org.eclipse.rdf4j.model.IRI> impleme
             return true;
         }
         if (obj instanceof IRIImpl) {
-            IRIImpl impl = (IRIImpl) obj;
+            final IRIImpl impl = (IRIImpl) obj;
             return asValue().equals(impl.asValue());
         }
         if (obj instanceof org.apache.commons.rdf.api.IRI) {
-            org.apache.commons.rdf.api.IRI iri = (org.apache.commons.rdf.api.IRI) obj;
+            final org.apache.commons.rdf.api.IRI iri = (org.apache.commons.rdf.api.IRI) obj;
             return value.toString().equals(iri.getIRIString());
         }
         return false;

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/LiteralImpl.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/LiteralImpl.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/LiteralImpl.java
index 2dcbb43..16d70b8 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/LiteralImpl.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/LiteralImpl.java
@@ -38,7 +38,7 @@ final class LiteralImpl extends AbstractRDFTerm<org.eclipse.rdf4j.model.Literal>
             return true;
         }
         if (obj instanceof org.apache.commons.rdf.api.Literal) {
-            org.apache.commons.rdf.api.Literal other = (org.apache.commons.rdf.api.Literal) obj;
+            final org.apache.commons.rdf.api.Literal other = (org.apache.commons.rdf.api.Literal) obj;
             return getLexicalForm().equals(other.getLexicalForm()) && getDatatype().equals(other.getDatatype())
                     && getLanguageTag().equals(other.getLanguageTag());
 
@@ -69,7 +69,7 @@ final class LiteralImpl extends AbstractRDFTerm<org.eclipse.rdf4j.model.Literal>
     @Override
     public String ntriplesString() {
         // TODO: Use a more efficient StringBuffer
-        String escaped = QUOTE + TurtleUtil.encodeString(value.getLabel()) + QUOTE;
+        final String escaped = QUOTE + TurtleUtil.encodeString(value.getLabel()) + QUOTE;
         if (value.getLanguage().isPresent()) {
             return escaped + "@" + value.getLanguage().get();
         }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ModelGraphImpl.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ModelGraphImpl.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ModelGraphImpl.java
index 1239e59..f8753fb 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ModelGraphImpl.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/ModelGraphImpl.java
@@ -97,7 +97,7 @@ final class ModelGraphImpl implements RDF4JGraph {
 
     @Override
     public long size() {
-        int size = model.size();
+        final int size = model.size();
         if (size < Integer.MAX_VALUE) {
             return size;
         } else {
@@ -134,7 +134,7 @@ final class ModelGraphImpl implements RDF4JGraph {
             @Override
             public Iterator<Triple> iterator() {
                 // double-cast to fight Java generics..
-                Stream<? extends Triple> s = stream(subject, predicate, object);
+                final Stream<? extends Triple> s = stream(subject, predicate, object);
                 return (Iterator<Triple>) s.iterator();
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/QuadImpl.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/QuadImpl.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/QuadImpl.java
index c1e8a25..93c02c9 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/QuadImpl.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/QuadImpl.java
@@ -52,7 +52,7 @@ final class QuadImpl implements Quad, RDF4JQuad {
     @Override
     public boolean equals(final Object obj) {
         if (obj instanceof Quad) {
-            Quad quad = (Quad) obj;
+            final Quad quad = (Quad) obj;
             return getGraphName().equals(quad.getGraphName()) &&
                     getSubject().equals(quad.getSubject()) && 
                     getPredicate().equals(quad.getPredicate()) &&
@@ -66,7 +66,7 @@ final class QuadImpl implements Quad, RDF4JQuad {
         if (statement.getContext() == null) {
             return Optional.empty();
         }
-        BlankNodeOrIRI g = (BlankNodeOrIRI) RDF4J.asRDFTerm(statement.getContext(), salt);
+        final BlankNodeOrIRI g = (BlankNodeOrIRI) RDF4J.asRDFTerm(statement.getContext(), salt);
         return Optional.of(g);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryDatasetImpl.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryDatasetImpl.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryDatasetImpl.java
index 7241e3e..03590f6 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryDatasetImpl.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryDatasetImpl.java
@@ -47,7 +47,7 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
 
     @Override
     public void add(final Quad tripleLike) {
-        Statement statement = rdf4jTermFactory.asStatement(tripleLike);
+        final Statement statement = rdf4jTermFactory.asStatement(tripleLike);
         try (RepositoryConnection conn = getRepositoryConnection()) {
             conn.add(statement);
             conn.commit();
@@ -56,7 +56,7 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
 
     @Override
     public boolean contains(final Quad tripleLike) {
-        Statement statement = rdf4jTermFactory.asStatement(tripleLike);
+        final Statement statement = rdf4jTermFactory.asStatement(tripleLike);
         try (RepositoryConnection conn = getRepositoryConnection()) {
             return conn.hasStatement(statement, includeInferred);
         }
@@ -64,7 +64,7 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
 
     @Override
     public void remove(final Quad tripleLike) {
-        Statement statement = rdf4jTermFactory.asStatement(tripleLike);
+        final Statement statement = rdf4jTermFactory.asStatement(tripleLike);
         try (RepositoryConnection conn = getRepositoryConnection()) {
             conn.remove(statement);
             conn.commit();
@@ -93,10 +93,10 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
 
     @Override
     public void add(final BlankNodeOrIRI graphName, final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        Resource context = (Resource) rdf4jTermFactory.asValue(graphName);
-        Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
-        org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
-        Value obj = rdf4jTermFactory.asValue(object);
+        final Resource context = (Resource) rdf4jTermFactory.asValue(graphName);
+        final Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
+        final org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
+        final Value obj = rdf4jTermFactory.asValue(object);
         try (RepositoryConnection conn = getRepositoryConnection()) {
             conn.add(subj, pred, obj, context);
             conn.commit();
@@ -105,10 +105,10 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
 
     @Override
     public boolean contains(final Optional<BlankNodeOrIRI> graphName, final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
-        org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
-        Value obj = rdf4jTermFactory.asValue(object);
-        Resource[] contexts = asContexts(graphName);
+        final Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
+        final org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
+        final Value obj = rdf4jTermFactory.asValue(object);
+        final Resource[] contexts = asContexts(graphName);
         try (RepositoryConnection conn = getRepositoryConnection()) {
             return conn.hasStatement(subj, pred, obj, includeInferred, contexts);
         }
@@ -120,8 +120,8 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
             // no contexts == any contexts
             contexts = new Resource[0];
         } else {
-            BlankNodeOrIRI g = graphName.orElse(null);
-            Resource context = (Resource) rdf4jTermFactory.asValue(g);
+            final BlankNodeOrIRI g = graphName.orElse(null);
+            final Resource context = (Resource) rdf4jTermFactory.asValue(g);
             contexts = new Resource[] { context };
         }
         return contexts;
@@ -129,10 +129,10 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
 
     @Override
     public void remove(final Optional<BlankNodeOrIRI> graphName, final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
-        org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
-        Value obj = rdf4jTermFactory.asValue(object);
-        Resource[] contexts = asContexts(graphName);
+        final Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
+        final org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
+        final Value obj = rdf4jTermFactory.asValue(object);
+        final Resource[] contexts = asContexts(graphName);
 
         try (RepositoryConnection conn = getRepositoryConnection()) {
             conn.remove(subj, pred, obj, contexts);
@@ -148,18 +148,18 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
     @Override
     public Stream<RDF4JQuad> stream(final Optional<BlankNodeOrIRI> graphName, final BlankNodeOrIRI subject, final IRI predicate,
             final RDFTerm object) {
-        Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
-        org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
-        Value obj = rdf4jTermFactory.asValue(object);
-        Resource[] contexts = asContexts(graphName);
+        final Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
+        final org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
+        final Value obj = rdf4jTermFactory.asValue(object);
+        final Resource[] contexts = asContexts(graphName);
 
         // NOTE: We can't do the usual try..with closing of the
         // RepositoryConnection here as it will have to be closed outside
         // by the user of the returned stream
-        RepositoryConnection conn = getRepositoryConnection();
+        final RepositoryConnection conn = getRepositoryConnection();
         Stream<RDF4JQuad> stream = null;
         try {
-            RepositoryResult<Statement> statements = conn.getStatements(subj, pred, obj, includeInferred, contexts);
+            final RepositoryResult<Statement> statements = conn.getStatements(subj, pred, obj, includeInferred, contexts);
             // NOTE: Iterations.stream should close RepositoryResult as long as
             // our caller closes the stream
             stream = Iterations.stream(statements).map(rdf4jTermFactory::asQuad);
@@ -183,10 +183,10 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
     @Override
     public ClosableIterable<Quad> iterate(final Optional<BlankNodeOrIRI> graphName, final BlankNodeOrIRI subject, final IRI predicate,
             final RDFTerm object) throws ConcurrentModificationException, IllegalStateException {
-        Resource[] contexts = asContexts(graphName);
-        Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
-        org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
-        Value obj = rdf4jTermFactory.asValue(object);
+        final Resource[] contexts = asContexts(graphName);
+        final Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
+        final org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
+        final Value obj = rdf4jTermFactory.asValue(object);
         return new ConvertedStatements<>(this::getRepositoryConnection, rdf4jTermFactory::asQuad, subj, pred, obj,
                 contexts);
     }
@@ -207,7 +207,7 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
     @Override
     public Optional<Graph> getGraph(final BlankNodeOrIRI graphName) {
         // NOTE: May be null to indicate default context
-        Resource context = (Resource) rdf4jTermFactory.asValue(graphName);
+        final Resource context = (Resource) rdf4jTermFactory.asValue(graphName);
         // NOTE: We carry over the 'salt' as the graph's BlankNode should be
         // equal to our BlankNodes
         return Optional.of(new RepositoryGraphImpl(repository, salt, false, includeInferred, context));
@@ -215,8 +215,8 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
 
     @Override
     public Stream<BlankNodeOrIRI> getGraphNames() {
-       RepositoryConnection conn = getRepositoryConnection();
-       RepositoryResult<Resource> contexts = conn.getContextIDs();
+       final RepositoryConnection conn = getRepositoryConnection();
+       final RepositoryResult<Resource> contexts = conn.getContextIDs();
         return Iterations.stream(contexts).map(g -> (BlankNodeOrIRI) rdf4jTermFactory.asRDFTerm(g))
                 .onClose(conn::close);
     }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryGraphImpl.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryGraphImpl.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryGraphImpl.java
index 6791978..2c8355f 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryGraphImpl.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryGraphImpl.java
@@ -54,7 +54,7 @@ class RepositoryGraphImpl extends AbstractRepositoryGraphLike<Triple> implements
 
     @Override
     public void add(final Triple tripleLike) {
-        Statement statement = rdf4jTermFactory.asStatement(tripleLike);
+        final Statement statement = rdf4jTermFactory.asStatement(tripleLike);
         try (RepositoryConnection conn = getRepositoryConnection()) {
             conn.add(statement, contextMask);
             conn.commit();
@@ -63,7 +63,7 @@ class RepositoryGraphImpl extends AbstractRepositoryGraphLike<Triple> implements
 
     @Override
     public boolean contains(final Triple tripleLike) {
-        Statement statement = rdf4jTermFactory.asStatement(tripleLike);
+        final Statement statement = rdf4jTermFactory.asStatement(tripleLike);
         try (RepositoryConnection conn = getRepositoryConnection()) {
             return conn.hasStatement(statement, includeInferred, contextMask);
         }
@@ -71,7 +71,7 @@ class RepositoryGraphImpl extends AbstractRepositoryGraphLike<Triple> implements
 
     @Override
     public void remove(final Triple tripleLike) {
-        Statement statement = rdf4jTermFactory.asStatement(tripleLike);
+        final Statement statement = rdf4jTermFactory.asStatement(tripleLike);
         try (RepositoryConnection conn = getRepositoryConnection()) {
             conn.remove(statement, contextMask);
             conn.commit();
@@ -101,9 +101,9 @@ class RepositoryGraphImpl extends AbstractRepositoryGraphLike<Triple> implements
 
     @Override
     public void add(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
-        org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
-        Value obj = rdf4jTermFactory.asValue(object);
+        final Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
+        final org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
+        final Value obj = rdf4jTermFactory.asValue(object);
         try (RepositoryConnection conn = getRepositoryConnection()) {
             conn.add(subj, pred, obj, contextMask);
             conn.commit();
@@ -112,9 +112,9 @@ class RepositoryGraphImpl extends AbstractRepositoryGraphLike<Triple> implements
 
     @Override
     public boolean contains(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
-        org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
-        Value obj = rdf4jTermFactory.asValue(object);
+        final Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
+        final org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
+        final Value obj = rdf4jTermFactory.asValue(object);
         try (RepositoryConnection conn = getRepositoryConnection()) {
             return conn.hasStatement(subj, pred, obj, includeInferred, contextMask);
         }
@@ -122,9 +122,9 @@ class RepositoryGraphImpl extends AbstractRepositoryGraphLike<Triple> implements
 
     @Override
     public void remove(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
-        org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
-        Value obj = rdf4jTermFactory.asValue(object);
+        final Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
+        final org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
+        final Value obj = rdf4jTermFactory.asValue(object);
         try (RepositoryConnection conn = getRepositoryConnection()) {
             conn.remove(subj, pred, obj, contextMask);
             conn.commit();
@@ -139,9 +139,9 @@ class RepositoryGraphImpl extends AbstractRepositoryGraphLike<Triple> implements
     @Override
     public ClosableIterable<Triple> iterate(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object)
             throws ConcurrentModificationException, IllegalStateException {
-        Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
-        org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
-        Value obj = rdf4jTermFactory.asValue(object);
+        final Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
+        final org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
+        final Value obj = rdf4jTermFactory.asValue(object);
         return new ConvertedStatements<>(this::getRepositoryConnection, rdf4jTermFactory::asTriple, subj, pred,
                 obj, contextMask);
     }
@@ -153,17 +153,17 @@ class RepositoryGraphImpl extends AbstractRepositoryGraphLike<Triple> implements
 
     @Override
     public Stream<RDF4JTriple> stream(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
-        org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
-        Value obj = rdf4jTermFactory.asValue(object);
+        final Resource subj = (Resource) rdf4jTermFactory.asValue(subject);
+        final org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate);
+        final Value obj = rdf4jTermFactory.asValue(object);
 
         // NOTE: We can't do the usual try..with closing of the
         // RepositoryConnection here as it will have to be closed outside
         // by the user of the returned stream
-        RepositoryConnection conn = getRepositoryConnection();
+        final RepositoryConnection conn = getRepositoryConnection();
         Stream<RDF4JTriple> stream = null;
         try {
-            RepositoryResult<Statement> statements = conn.getStatements(subj, pred, obj, includeInferred, contextMask);
+            final RepositoryResult<Statement> statements = conn.getStatements(subj, pred, obj, includeInferred, contextMask);
             // NOTE: Iterations.stream should close RepositoryResult as long as
             // our caller closes the stream
             stream = Iterations.stream(statements).map(this::asTripleLike);
@@ -185,8 +185,8 @@ class RepositoryGraphImpl extends AbstractRepositoryGraphLike<Triple> implements
 
     @Override
     public Set<RDF4JBlankNodeOrIRI> getContextMask() {
-        Set<RDF4JBlankNodeOrIRI> mask = new HashSet<>();
-        for (Resource s : contextMask) {
+        final Set<RDF4JBlankNodeOrIRI> mask = new HashSet<>();
+        for (final Resource s : contextMask) {
             mask.add((RDF4JBlankNodeOrIRI) rdf4jTermFactory.asRDFTerm(s));
         }
         return Collections.unmodifiableSet(mask);

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/TripleImpl.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/TripleImpl.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/TripleImpl.java
index 7fdfa0f..1802158 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/TripleImpl.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/TripleImpl.java
@@ -44,7 +44,7 @@ final class TripleImpl implements Triple, RDF4JTriple {
     @Override
     public boolean equals(final Object obj) {
         if (obj instanceof Triple) {
-            Triple triple = (Triple) obj;
+            final Triple triple = (Triple) obj;
             return getSubject().equals(triple.getSubject()) && getPredicate().equals(triple.getPredicate())
                     && getObject().equals(triple.getObject());
         }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryGraphTest.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryGraphTest.java b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryGraphTest.java
index fd3ac83..597c7d7 100644
--- a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryGraphTest.java
+++ b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/MemoryGraphTest.java
@@ -84,8 +84,8 @@ public class MemoryGraphTest extends AbstractGraphTest {
 
         @Override
         public RDF4JGraph createGraph() {
-            Sail sail = new MemoryStore();
-            Repository repository = new SailRepository(sail);
+            final Sail sail = new MemoryStore();
+            final Repository repository = new SailRepository(sail);
             repository.initialize();
             return rdf4jFactory.asGraph(repository);
         }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/NativeStoreGraphTest.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/NativeStoreGraphTest.java b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/NativeStoreGraphTest.java
index 7f56ae4..c496338 100644
--- a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/NativeStoreGraphTest.java
+++ b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/NativeStoreGraphTest.java
@@ -58,7 +58,7 @@ public class NativeStoreGraphTest extends AbstractGraphTest {
         public RDF4JGraph createGraph() {
             // We re-use the repository connection, but use a different context
             // every time
-            Set<RDF4JBlankNode> context = Collections.singleton(rdf4jFactory.createBlankNode());
+            final Set<RDF4JBlankNode> context = Collections.singleton(rdf4jFactory.createBlankNode());
             return rdf4jFactory.asGraph(getRepository(), context);
         }
 
@@ -118,7 +118,7 @@ public class NativeStoreGraphTest extends AbstractGraphTest {
     private SailRepository repository;
 
     public void createRepository() throws IOException {
-        Sail sail = new NativeStore(tempDir.newFolder());
+        final Sail sail = new NativeStore(tempDir.newFolder());
         repository = new SailRepository(sail);
         repository.initialize();
     }
@@ -127,7 +127,7 @@ public class NativeStoreGraphTest extends AbstractGraphTest {
         if (repository == null) {
             try {
                 createRepository();
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 throw new UncheckedIOException(e);
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JServiceLoaderTest.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JServiceLoaderTest.java b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JServiceLoaderTest.java
index fffa134..f07a0cb 100644
--- a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JServiceLoaderTest.java
+++ b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JServiceLoaderTest.java
@@ -29,8 +29,8 @@ public class RDF4JServiceLoaderTest {
 
     @Test
     public void testServiceLoaderLookup() {
-        ServiceLoader<RDF> loader = ServiceLoader.load(RDF.class);
-        for (RDF impl : loader) {
+        final ServiceLoader<RDF> loader = ServiceLoader.load(RDF.class);
+        for (final RDF impl : loader) {
             if (impl instanceof RDF4J) {
                 return; // yay
             }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java
index 9a2d2fd..f604f3e 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/BlankNodeImpl.java
@@ -48,7 +48,7 @@ final class BlankNodeImpl implements BlankNode, SimpleRDFTerm {
         // Both the scope and the id are used to create the UUID, ensuring that
         // a caller can reliably create the same bnode if necessary by sending
         // in the same scope to RDF.createBlankNode(String)
-        String uuidInput = "urn:uuid:" + uuidSalt + "#" + name;
+        final String uuidInput = "urn:uuid:" + uuidSalt + "#" + name;
 
         // The above is not a good value for this.id, as the id
         // needs to be further escaped for
@@ -99,7 +99,7 @@ final class BlankNodeImpl implements BlankNode, SimpleRDFTerm {
         if (!(obj instanceof BlankNodeImpl)) {
             return false;
         }
-        BlankNodeImpl other = (BlankNodeImpl) obj;
+        final BlankNodeImpl other = (BlankNodeImpl) obj;
         if (uniqueReference == null) {
             if (other.uniqueReference != null) {
                 return false;

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/simple/src/main/java/org/apache/commons/rdf/simple/DatasetGraphView.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/DatasetGraphView.java b/simple/src/main/java/org/apache/commons/rdf/simple/DatasetGraphView.java
index 631f6fd..15515f2 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/DatasetGraphView.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/DatasetGraphView.java
@@ -128,7 +128,7 @@ public class DatasetGraphView implements Graph {
 
     @Override
     public Stream<? extends Triple> stream(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        Stream<Triple> stream = dataset.stream(unionOrNamedGraph(), subject, predicate, object).map(Quad::asTriple);
+        final Stream<Triple> stream = dataset.stream(unionOrNamedGraph(), subject, predicate, object).map(Quad::asTriple);
         if (unionGraph) {
             // remove duplicates
             return stream.distinct();

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/simple/src/main/java/org/apache/commons/rdf/simple/DatasetImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/DatasetImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/DatasetImpl.java
index 736146f..b1f6bdf 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/DatasetImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/DatasetImpl.java
@@ -54,20 +54,20 @@ final class DatasetImpl implements Dataset {
 
     @Override
     public void add(final BlankNodeOrIRI graphName, final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        BlankNodeOrIRI newGraphName = (BlankNodeOrIRI) internallyMap(graphName);
-        BlankNodeOrIRI newSubject = (BlankNodeOrIRI) internallyMap(subject);
-        IRI newPredicate = (IRI) internallyMap(predicate);
-        RDFTerm newObject = internallyMap(object);
-        Quad result = factory.createQuad(newGraphName, newSubject, newPredicate, newObject);
+        final BlankNodeOrIRI newGraphName = (BlankNodeOrIRI) internallyMap(graphName);
+        final BlankNodeOrIRI newSubject = (BlankNodeOrIRI) internallyMap(subject);
+        final IRI newPredicate = (IRI) internallyMap(predicate);
+        final RDFTerm newObject = internallyMap(object);
+        final Quad result = factory.createQuad(newGraphName, newSubject, newPredicate, newObject);
         quads.add(result);
     }
 
     @Override
     public void add(final Quad quad) {
-        BlankNodeOrIRI newGraph = (BlankNodeOrIRI) internallyMap(quad.getGraphName().orElse(null));
-        BlankNodeOrIRI newSubject = (BlankNodeOrIRI) internallyMap(quad.getSubject());
-        IRI newPredicate = (IRI) internallyMap(quad.getPredicate());
-        RDFTerm newObject = internallyMap(quad.getObject());
+        final BlankNodeOrIRI newGraph = (BlankNodeOrIRI) internallyMap(quad.getGraphName().orElse(null));
+        final BlankNodeOrIRI newSubject = (BlankNodeOrIRI) internallyMap(quad.getSubject());
+        final IRI newPredicate = (IRI) internallyMap(quad.getPredicate());
+        final RDFTerm newObject = internallyMap(quad.getObject());
         // Check if any of the object references changed during the mapping, to
         // avoid creating a new Quad object if possible
         if (newGraph == quad.getGraphName().orElse(null) && newSubject == quad.getSubject()
@@ -75,7 +75,7 @@ final class DatasetImpl implements Dataset {
             quads.add(quad);
         } else {
             // Make a new Quad with our mapped instances
-            Quad result = factory.createQuad(newGraph, newSubject, newPredicate, newObject);
+            final Quad result = factory.createQuad(newGraph, newSubject, newPredicate, newObject);
             quads.add(result);
         }
     }
@@ -85,17 +85,17 @@ final class DatasetImpl implements Dataset {
             return object;
         }
         if (object instanceof BlankNode && !(object instanceof BlankNodeImpl)) {
-            BlankNode blankNode = (BlankNode) object;
+            final BlankNode blankNode = (BlankNode) object;
             // This guarantees that adding the same BlankNode multiple times to
             // this graph will generate a local object that is mapped to an
             // equivalent object, based on the code in the package private
             // BlankNodeImpl class
             return factory.createBlankNode(blankNode.uniqueReference());
         } else if (object instanceof IRI && !(object instanceof IRIImpl)) {
-            IRI iri = (IRI) object;
+            final IRI iri = (IRI) object;
             return factory.createIRI(iri.getIRIString());
         } else if (object instanceof Literal && !(object instanceof LiteralImpl)) {
-            Literal literal = (Literal) object;
+            final Literal literal = (Literal) object;
             if (literal.getLanguageTag().isPresent()) {
                 return factory.createLiteral(literal.getLexicalForm(), literal.getLanguageTag().get());
             } else {
@@ -164,8 +164,8 @@ final class DatasetImpl implements Dataset {
 
     @Override
     public void remove(final Optional<BlankNodeOrIRI> graphName, final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        Stream<Quad> toRemove = stream(graphName, subject, predicate, object);
-        for (Quad t : toRemove.collect(Collectors.toList())) {
+        final Stream<Quad> toRemove = stream(graphName, subject, predicate, object);
+        for (final Quad t : toRemove.collect(Collectors.toList())) {
             // Avoid ConcurrentModificationException in ArrayList
             remove(t);
         }
@@ -183,7 +183,7 @@ final class DatasetImpl implements Dataset {
 
     @Override
     public String toString() {
-        String s = stream().limit(TO_STRING_MAX).map(Object::toString).collect(Collectors.joining("\n"));
+        final String s = stream().limit(TO_STRING_MAX).map(Object::toString).collect(Collectors.joining("\n"));
         if (size() > TO_STRING_MAX) {
             return s + "\n# ... +" + (size() - TO_STRING_MAX) + " more";
         } else {

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java
index 268f78a..2c3bee4 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/GraphImpl.java
@@ -45,10 +45,10 @@ final class GraphImpl implements Graph {
 
     @Override
     public void add(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        BlankNodeOrIRI newSubject = (BlankNodeOrIRI) internallyMap(subject);
-        IRI newPredicate = (IRI) internallyMap(predicate);
-        RDFTerm newObject = internallyMap(object);
-        Triple result = factory.createTriple(newSubject, newPredicate, newObject);
+        final BlankNodeOrIRI newSubject = (BlankNodeOrIRI) internallyMap(subject);
+        final IRI newPredicate = (IRI) internallyMap(predicate);
+        final RDFTerm newObject = internallyMap(object);
+        final Triple result = factory.createTriple(newSubject, newPredicate, newObject);
         triples.add(result);
     }
 
@@ -66,17 +66,17 @@ final class GraphImpl implements Graph {
             return object;
         }
         if (object instanceof BlankNode) {
-            BlankNode blankNode = (BlankNode) object;
+            final BlankNode blankNode = (BlankNode) object;
             // This guarantees that adding the same BlankNode multiple times to
             // this graph will generate a local object that is mapped to an
             // equivalent object, based on the code in the package private
             // BlankNodeImpl class
             return factory.createBlankNode(blankNode.uniqueReference());
         } else if (object instanceof IRI) {
-            IRI iri = (IRI) object;
+            final IRI iri = (IRI) object;
             return factory.createIRI(iri.getIRIString());
         } else if (object instanceof Literal) {
-            Literal literal = (Literal) object;
+            final Literal literal = (Literal) object;
             if (literal.getLanguageTag().isPresent()) {
                 return factory.createLiteral(literal.getLexicalForm(), literal.getLanguageTag().get());
             } else {
@@ -88,9 +88,9 @@ final class GraphImpl implements Graph {
     }
 
     private Triple internallyMap(final Triple triple) {
-        BlankNodeOrIRI newSubject = (BlankNodeOrIRI) internallyMap(triple.getSubject());
-        IRI newPredicate = (IRI) internallyMap(triple.getPredicate());
-        RDFTerm newObject = internallyMap(triple.getObject());
+        final BlankNodeOrIRI newSubject = (BlankNodeOrIRI) internallyMap(triple.getSubject());
+        final IRI newPredicate = (IRI) internallyMap(triple.getPredicate());
+        final RDFTerm newObject = internallyMap(triple.getObject());
         // Check if any of the object references changed during the mapping, to
         // avoid creating a new Triple object if possible
         if (newSubject == triple.getSubject() && newPredicate == triple.getPredicate()
@@ -149,8 +149,8 @@ final class GraphImpl implements Graph {
 
     @Override
     public void remove(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {
-        Stream<Triple> toRemove = stream(subject, predicate, object);
-        for (Triple t : toRemove.collect(Collectors.toList())) {
+        final Stream<Triple> toRemove = stream(subject, predicate, object);
+        for (final Triple t : toRemove.collect(Collectors.toList())) {
             // Avoid ConcurrentModificationException in ArrayList
             remove(t);
         }
@@ -168,7 +168,7 @@ final class GraphImpl implements Graph {
 
     @Override
     public String toString() {
-        String s = stream().limit(TO_STRING_MAX).map(Object::toString).collect(Collectors.joining("\n"));
+        final String s = stream().limit(TO_STRING_MAX).map(Object::toString).collect(Collectors.joining("\n"));
         if (size() > TO_STRING_MAX) {
             return s + "\n# ... +" + (size() - TO_STRING_MAX) + " more";
         } else {

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/simple/src/main/java/org/apache/commons/rdf/simple/IRIImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/IRIImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/IRIImpl.java
index 67b2ef9..114eef1 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/IRIImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/IRIImpl.java
@@ -59,7 +59,7 @@ final class IRIImpl implements IRI, SimpleRDF.SimpleRDFTerm {
         if (obj == null || !(obj instanceof IRI)) {
             return false;
         }
-        IRI other = (IRI) obj;
+        final IRI other = (IRI) obj;
         return getIRIString().equals(other.getIRIString());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/simple/src/main/java/org/apache/commons/rdf/simple/LiteralImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/LiteralImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/LiteralImpl.java
index 38ada61..3cca4c6 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/LiteralImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/LiteralImpl.java
@@ -60,7 +60,7 @@ final class LiteralImpl implements Literal, SimpleRDF.SimpleRDFTerm {
         }
         try {
             new Locale.Builder().setLanguageTag(languageTag);
-        } catch (IllformedLocaleException ex) {
+        } catch (final IllformedLocaleException ex) {
             throw new IllegalArgumentException("Invalid languageTag: " + languageTag, ex);
         }
 
@@ -85,7 +85,7 @@ final class LiteralImpl implements Literal, SimpleRDF.SimpleRDFTerm {
 
     @Override
     public String ntriplesString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append(QUOTE);
         // Escape special characters
         sb.append(getLexicalForm().replace("\\", "\\\\"). // escaped to \\
@@ -124,7 +124,7 @@ final class LiteralImpl implements Literal, SimpleRDF.SimpleRDFTerm {
         if (obj == null || !(obj instanceof Literal)) {
             return false;
         }
-        Literal literal = (Literal) obj;
+        final Literal literal = (Literal) obj;
         return getDatatype().equals(literal.getDatatype()) && getLexicalForm().equals(literal.getLexicalForm())
                 && getLanguageTag().equals(literal.getLanguageTag());
     }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/simple/src/main/java/org/apache/commons/rdf/simple/QuadImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/QuadImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/QuadImpl.java
index d62d17c..51bef69 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/QuadImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/QuadImpl.java
@@ -95,7 +95,7 @@ final class QuadImpl implements Quad {
         if (!(obj instanceof Quad)) {
             return false;
         }
-        Quad other = (Quad) obj;
+        final Quad other = (Quad) obj;
         return getGraphName().equals(other.getGraphName()) && getSubject().equals(other.getSubject())
                 && getPredicate().equals(other.getPredicate()) && getObject().equals(other.getObject());
     }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDF.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDF.java b/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDF.java
index e871079..6f6b2a5 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDF.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDF.java
@@ -79,7 +79,7 @@ public class SimpleRDF implements RDF {
 
     @Override
     public IRI createIRI(final String iri) {
-        IRI result = new IRIImpl(iri);
+        final IRI result = new IRIImpl(iri);
         // Reuse any IRI objects already created in Types
         return Types.get(result).orElse(result);
     }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/simple/src/main/java/org/apache/commons/rdf/simple/TripleImpl.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/TripleImpl.java b/simple/src/main/java/org/apache/commons/rdf/simple/TripleImpl.java
index dd1c152..ef527ce 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/TripleImpl.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/TripleImpl.java
@@ -83,7 +83,7 @@ final class TripleImpl implements Triple {
         if (!(obj instanceof Triple)) {
             return false;
         }
-        Triple other = (Triple) obj;
+        final Triple other = (Triple) obj;
         return getSubject().equals(other.getSubject()) && getPredicate().equals(other.getPredicate())
                 && getObject().equals(other.getObject());
     }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/56ddbdcf/simple/src/main/java/org/apache/commons/rdf/simple/Types.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/Types.java b/simple/src/main/java/org/apache/commons/rdf/simple/Types.java
index 986e1f1..308de71 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/Types.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/Types.java
@@ -240,7 +240,7 @@ public final class Types implements IRI, SimpleRDF.SimpleRDFTerm {
     private static final Set<IRI> ALL_TYPES;
 
     static {
-        Set<IRI> tempTypes = new LinkedHashSet<>();
+        final Set<IRI> tempTypes = new LinkedHashSet<>();
         tempTypes.add(RDF_HTML);
         tempTypes.add(RDF_LANGSTRING);
         tempTypes.add(RDF_PLAINLITERAL);
@@ -339,7 +339,7 @@ public final class Types implements IRI, SimpleRDF.SimpleRDFTerm {
         if (ALL_TYPES.contains(nextIRI)) {
             // If we know about this IRI, then look through our set to find the
             // object that matches and return it
-            for (IRI nextType : ALL_TYPES) {
+            for (final IRI nextType : ALL_TYPES) {
                 if (nextType.equals(nextIRI)) {
                     return Optional.of(nextType);
                 }


Mime
View raw message