commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [2/7] incubator-commonsrdf git commit: Add final modifier to method parameters.
Date Fri, 11 Nov 2016 22:50:48 GMT
http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/756cbe02/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java
b/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java
index f5c476b..676f284 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDFTermFactory.java
@@ -42,7 +42,7 @@ public class SimpleRDFTermFactory implements RDFTermFactory {
     }
 
     @Override
-    public BlankNode createBlankNode(String name) {
+    public BlankNode createBlankNode(final String name) {
         return factory.createBlankNode(name);
     }
 
@@ -52,27 +52,27 @@ public class SimpleRDFTermFactory implements RDFTermFactory {
     }
 
     @Override
-    public IRI createIRI(String iri) {
+    public IRI createIRI(final String iri) {
         return factory.createIRI(iri);
     }
 
     @Override
-    public Literal createLiteral(String literal) {
+    public Literal createLiteral(final String literal) {
         return factory.createLiteral(literal);
     }
 
     @Override
-    public Literal createLiteral(String literal, IRI dataType) {
+    public Literal createLiteral(final String literal, final IRI dataType) {
         return factory.createLiteral(literal, dataType);
     }
 
     @Override
-    public Literal createLiteral(String literal, String language) {
+    public Literal createLiteral(final String literal, final String language) {
         return factory.createLiteral(literal, language);
     }
 
     @Override
-    public Triple createTriple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
+    public Triple createTriple(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm
object) {
         return factory.createTriple(subject, predicate, object);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/756cbe02/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 35ce1cc..dd1c152 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
@@ -46,7 +46,7 @@ final class TripleImpl implements Triple {
      * @param object
      *            object of triple
      */
-    public TripleImpl(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
+    public TripleImpl(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object)
{
         this.subject = Objects.requireNonNull(subject);
         this.predicate = Objects.requireNonNull(predicate);
         this.object = Objects.requireNonNull(object);
@@ -79,7 +79,7 @@ final class TripleImpl implements Triple {
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if (!(obj instanceof Triple)) {
             return false;
         }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/756cbe02/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 cf4d2e1..986e1f1 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
@@ -287,7 +287,7 @@ public final class Types implements IRI, SimpleRDF.SimpleRDFTerm {
 
     private final IRI field;
 
-    private Types(String field) {
+    private Types(final String field) {
         this.field = new IRIImpl(field);
     }
 
@@ -302,7 +302,7 @@ public final class Types implements IRI, SimpleRDF.SimpleRDFTerm {
     }
 
     @Override
-    public boolean equals(Object other) {
+    public boolean equals(final Object other) {
         return this.field.equals(other);
     }
 
@@ -335,7 +335,7 @@ public final class Types implements IRI, SimpleRDF.SimpleRDFTerm {
      * @return An {@link Optional} containing the IRI from this collection or
      *         {@link Optional#empty()} if it is not present here.
      */
-    public static Optional<IRI> get(IRI nextIRI) {
+    public static Optional<IRI> get(final IRI nextIRI) {
         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

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/756cbe02/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java
b/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java
index 584bff3..9576b4a 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java
@@ -230,14 +230,14 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
     }
 
     @Override
-    public T rdfTermFactory(RDF rdfTermFactory) {
+    public T rdfTermFactory(final RDF rdfTermFactory) {
         AbstractRDFParser<T> c = clone();
         c.rdfTermFactory = Optional.ofNullable(rdfTermFactory);
         return c.asT();
     }
 
     @Override
-    public T contentType(RDFSyntax rdfSyntax) throws IllegalArgumentException {
+    public T contentType(final RDFSyntax rdfSyntax) throws IllegalArgumentException {
         AbstractRDFParser<T> c = clone();
         c.contentTypeSyntax = Optional.ofNullable(rdfSyntax);
         c.contentType = c.contentTypeSyntax.map(syntax -> syntax.mediaType);
@@ -245,7 +245,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
     }
 
     @Override
-    public T contentType(String contentType) throws IllegalArgumentException {
+    public T contentType(final String contentType) throws IllegalArgumentException {
         AbstractRDFParser<T> c = clone();
         c.contentType = Optional.ofNullable(contentType);
         c.contentTypeSyntax = c.contentType.flatMap(RDFSyntax::byMediaType);
@@ -253,7 +253,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
     }
 
     @Override
-    public T base(IRI base) {
+    public T base(final IRI base) {
         AbstractRDFParser<T> c = clone();
         c.base = Optional.ofNullable(base);
         c.base.ifPresent(i -> checkIsAbsolute(i));
@@ -261,12 +261,12 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
     }
 
     @Override
-    public T base(String base) throws IllegalArgumentException {
+    public T base(final String base) throws IllegalArgumentException {
         return base(internalRdfTermFactory.createIRI(base));
     }
 
     @Override
-    public T source(InputStream inputStream) {
+    public T source(final InputStream inputStream) {
         AbstractRDFParser<T> c = clone();
         c.resetSource();
         c.sourceInputStream = Optional.ofNullable(inputStream);
@@ -274,7 +274,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
     }
 
     @Override
-    public T source(Path file) {
+    public T source(final Path file) {
         AbstractRDFParser<T> c = clone();
         c.resetSource();
         c.sourceFile = Optional.ofNullable(file);
@@ -282,7 +282,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
     }
 
     @Override
-    public T source(IRI iri) {
+    public T source(final IRI iri) {
         AbstractRDFParser<T> c = clone();
         c.resetSource();
         c.sourceIri = Optional.ofNullable(iri);
@@ -291,7 +291,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
     }
 
     @Override
-    public T source(String iri) throws IllegalArgumentException {
+    public T source(final String iri) throws IllegalArgumentException {
         AbstractRDFParser<T> c = clone();
         c.resetSource();
         c.sourceIri = Optional.ofNullable(iri).map(internalRdfTermFactory::createIRI);
@@ -309,7 +309,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
      * @throws IllegalArgumentException
      *             If the IRI is not absolute
      */
-    protected void checkIsAbsolute(IRI iri) throws IllegalArgumentException {
+    protected void checkIsAbsolute(final IRI iri) throws IllegalArgumentException {
         if (!URI.create(iri.getIRIString()).isAbsolute()) {
             throw new IllegalArgumentException("IRI is not absolute: " + iri);
         }
@@ -484,7 +484,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
      *         {@link RDFSyntax#fileExtension}, otherwise
      *         {@link Optional#empty()}.
      */
-    protected static Optional<RDFSyntax> guessRDFSyntax(Path path) {
+    protected static Optional<RDFSyntax> guessRDFSyntax(final Path path) {
         return fileExtension(path).flatMap(RDFSyntax::byFileExtension);
     }
 
@@ -501,7 +501,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
      * @return File extension (including the leading <code>.</code>, or
      *         {@link Optional#empty()} if the path has no extension
      */
-    private static Optional<String> fileExtension(Path path) {
+    private static Optional<String> fileExtension(final Path path) {
         Path fileName = path.getFileName();
         if (fileName == null) {
             return Optional.empty();
@@ -540,7 +540,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
     }
 
     @Override
-    public T target(Consumer<Quad> consumer) {
+    public T target(final Consumer<Quad> consumer) {
         AbstractRDFParser<T> c = clone();
         c.resetTarget();
         c.target = consumer;
@@ -548,7 +548,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
     }
 
     @Override
-    public T target(Dataset dataset) {
+    public T target(final Dataset dataset) {
         @SuppressWarnings({ "rawtypes", "unchecked" })
         AbstractRDFParser<T> c = (AbstractRDFParser) RDFParser.super.target(dataset);
         c.resetTarget();
@@ -557,7 +557,7 @@ public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>>
implemen
     }
 
     @Override
-    public T target(Graph graph) {
+    public T target(final Graph graph) {
         @SuppressWarnings({ "rawtypes", "unchecked" }) // super calls our
                                                        // .clone()
         AbstractRDFParser<T> c = (AbstractRDFParser) RDFParser.super.target(graph);

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/756cbe02/simple/src/main/java/org/apache/commons/rdf/simple/experimental/RDFParseException.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/org/apache/commons/rdf/simple/experimental/RDFParseException.java
b/simple/src/main/java/org/apache/commons/rdf/simple/experimental/RDFParseException.java
index c88642b..16bdbc9 100644
--- a/simple/src/main/java/org/apache/commons/rdf/simple/experimental/RDFParseException.java
+++ b/simple/src/main/java/org/apache/commons/rdf/simple/experimental/RDFParseException.java
@@ -24,22 +24,22 @@ public class RDFParseException extends Exception {
     private static final long serialVersionUID = 5427752643780702976L;
     private final RDFParser builder;
 
-    public RDFParseException(RDFParser builder) {
+    public RDFParseException(final RDFParser builder) {
         super();
         this.builder = builder;
     }
 
-    public RDFParseException(RDFParser builder, String message, Throwable cause) {
+    public RDFParseException(final RDFParser builder, final String message, final Throwable
cause) {
         super(message, cause);
         this.builder = builder;
     }
 
-    public RDFParseException(RDFParser builder, String message) {
+    public RDFParseException(final RDFParser builder, final String message) {
         super(message);
         this.builder = builder;
     }
 
-    public RDFParseException(RDFParser builder, Throwable cause) {
+    public RDFParseException(final RDFParser builder, final Throwable cause) {
         super(cause);
         this.builder = builder;
     }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/756cbe02/simple/src/test/java/org/apache/commons/rdf/simple/BlankNodeImplTest.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/BlankNodeImplTest.java b/simple/src/test/java/org/apache/commons/rdf/simple/BlankNodeImplTest.java
index 677fb75..aa2359a 100644
--- a/simple/src/test/java/org/apache/commons/rdf/simple/BlankNodeImplTest.java
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/BlankNodeImplTest.java
@@ -36,7 +36,7 @@ public class BlankNodeImplTest extends AbstractBlankNodeTest {
     }
 
     @Override
-    protected BlankNode getBlankNode(String identifier) {
+    protected BlankNode getBlankNode(final String identifier) {
         return new BlankNodeImpl(SALT, identifier);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/756cbe02/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java b/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
index 3badaf7..add7d75 100644
--- a/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
@@ -99,7 +99,7 @@ public class TestWritingGraph {
         assertEquals(count, TRIPLES);
     }
 
-    public static String tripleAsString(Triple t) {
+    public static String tripleAsString(final Triple t) {
         return t.getSubject().ntriplesString() + " " + t.getPredicate().ntriplesString()
+ " "
                 + t.getObject().ntriplesString() + " .";
     }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/756cbe02/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
b/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
index d3b62b9..222d820 100644
--- a/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java
@@ -79,7 +79,7 @@ public class AbstractRDFParserTest {
         assertFalse(AbstractRDFParser.guessRDFSyntax(testXml).isPresent());
     }
 
-    private void checkGraph(Graph g) throws Exception {
+    private void checkGraph(final Graph g) throws Exception {
         assertTrue(g.size() > 0);
         IRI greeting = factory.createIRI("http://example.com/greeting");
         // Should only have parsed once!
@@ -166,7 +166,7 @@ public class AbstractRDFParserTest {
         assertEquals("\"application/n-triples\"", firstPredicate(g, "contentType"));
     }
 
-    private String firstPredicate(Graph g, String pred) {
+    private String firstPredicate(final Graph g, final String pred) {
         return g.stream(null, factory.createIRI("http://example.com/" + pred), null).map(Triple::getObject)
                 .map(RDFTerm::ntriplesString).findAny().orElse(null);
     }


Mime
View raw message