jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/3] jena git commit: JENA-380 : Remove warnings
Date Sat, 23 May 2015 14:34:46 GMT
JENA-380 : Remove warnings

Javadoc errors
Unnecessary semicolons
Unthrown exceptions




Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/1e2ea5e1
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/1e2ea5e1
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/1e2ea5e1

Branch: refs/heads/master
Commit: 1e2ea5e1e78b8ca581fbbedcd7f3321fefc19fd9
Parents: 9618da6
Author: Andy Seaborne <andy@apache.org>
Authored: Sat May 23 15:15:40 2015 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Sat May 23 15:15:40 2015 +0100

----------------------------------------------------------------------
 .../jena/assembler/test/TestAssemblerGroup.java | 18 ++++++-----
 .../apache/jena/graph/GraphContractTest.java    | 20 +++++-------
 .../AbstractGraphProducer.java                  |  7 +++--
 .../AbstractInfModelProducer.java               |  2 +-
 .../AbstractModelProducer.java                  |  5 +--
 .../AbstractRecordingListener.java              |  2 +-
 .../testing_framework/IIteratorProducer.java    |  8 ++---
 .../jena/testing_framework/ModelHelper.java     | 12 ++------
 .../jena/testing_framework/TestFileData.java    | 10 +++---
 .../jena/testing_framework/TestUtils.java       |  4 +--
 .../testing_framework/manifest/Manifest.java    | 32 ++++++++++----------
 .../manifest/ManifestItemHandler.java           |  7 ++---
 12 files changed, 58 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblerGroup.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblerGroup.java
b/jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblerGroup.java
index 8b38e5a..f0df74c 100644
--- a/jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblerGroup.java
+++ b/jena-core/src/test/java/org/apache/jena/assembler/test/TestAssemblerGroup.java
@@ -18,15 +18,19 @@
 
 package org.apache.jena.assembler.test;
 
-import java.util.Map;
-
-import org.apache.jena.assembler.* ;
-import org.apache.jena.assembler.assemblers.* ;
-import org.apache.jena.assembler.assemblers.AssemblerGroup.ExpandingAssemblerGroup;
-import org.apache.jena.assembler.exceptions.* ;
+import org.apache.jena.assembler.Assembler ;
+import org.apache.jena.assembler.JA ;
+import org.apache.jena.assembler.Mode ;
+import org.apache.jena.assembler.assemblers.AssemblerBase ;
+import org.apache.jena.assembler.assemblers.AssemblerGroup ;
+import org.apache.jena.assembler.assemblers.AssemblerGroup.ExpandingAssemblerGroup ;
+import org.apache.jena.assembler.assemblers.InfModelAssembler ;
+import org.apache.jena.assembler.exceptions.NoSpecificTypeException ;
 import org.apache.jena.graph.Graph ;
 import org.apache.jena.mem.GraphMemBase ;
-import org.apache.jena.rdf.model.* ;
+import org.apache.jena.rdf.model.InfModel ;
+import org.apache.jena.rdf.model.Model ;
+import org.apache.jena.rdf.model.Resource ;
 import org.apache.jena.vocabulary.RDFS ;
 
 public class TestAssemblerGroup extends AssemblerTestBase

http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/graph/GraphContractTest.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/graph/GraphContractTest.java b/jena-core/src/test/java/org/apache/jena/graph/GraphContractTest.java
index bf4ccf2..d724e6b 100644
--- a/jena-core/src/test/java/org/apache/jena/graph/GraphContractTest.java
+++ b/jena-core/src/test/java/org/apache/jena/graph/GraphContractTest.java
@@ -1213,11 +1213,11 @@ public class GraphContractTest<T extends Graph> extends
 	/**
 	 * testIsomorphism from file data
 	 * 
-	 * @throws FileNotFoundException
+	 * @throws URISyntaxException
+	 * @throws MalformedURLException 
 	 */
 	@ContractTest
-	public void testIsomorphismFile() throws URISyntaxException,
-			MalformedURLException {
+	public void testIsomorphismFile() throws URISyntaxException, MalformedURLException {
 		testIsomorphismXMLFile(1, true);
 		testIsomorphismXMLFile(2, true);
 		testIsomorphismXMLFile(3, true);
@@ -1229,28 +1229,22 @@ public class GraphContractTest<T extends Graph> extends
 
 	}
 
-	private void testIsomorphismNTripleFile(int i, boolean result)
-			throws URISyntaxException, MalformedURLException {
+	private void testIsomorphismNTripleFile(int i, boolean result) {
 		testIsomorphismFile(i, "N-TRIPLE", "nt", result);
 	}
 
-	private void testIsomorphismXMLFile(int i, boolean result)
-			throws URISyntaxException, MalformedURLException {
+	private void testIsomorphismXMLFile(int i, boolean result) {
 		testIsomorphismFile(i, "RDF/XML", "rdf", result);
-
 	}
 
-	private InputStream getInputStream(int n, int n2, String suffix)
-			throws URISyntaxException, MalformedURLException {
+	private InputStream getInputStream(int n, int n2, String suffix) {
 		String urlStr = String.format("regression/testModelEquals/%s-%s.%s", n,
 				n2, suffix);
 		return GraphContractTest.class.getClassLoader().getResourceAsStream(
 				urlStr);
 	}
 
-	private void testIsomorphismFile(int n, String lang, String suffix,
-			boolean result) throws URISyntaxException, MalformedURLException {
-
+	private void testIsomorphismFile(int n, String lang, String suffix, boolean result) {
 		Graph g1 = getProducer().newInstance();
 		Graph g2 = getProducer().newInstance();
 		Model m1 = ModelFactory.createModelForGraph(g1);

http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractGraphProducer.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractGraphProducer.java
b/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractGraphProducer.java
index 29cf9f0..480811a 100644
--- a/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractGraphProducer.java
+++ b/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractGraphProducer.java
@@ -66,7 +66,7 @@ public abstract class AbstractGraphProducer<T extends Graph> implements
 	 *            The graph that is closed
 	 */
 	protected void afterClose(Graph g) {
-	};
+	}
 
 	@Override
 	final public void cleanUp() {
@@ -86,7 +86,7 @@ public abstract class AbstractGraphProducer<T extends Graph> implements
 	 * 
 	 * @param g
 	 *            The graph we are looking for.
-	 * @return
+	 * @return   Graph[]
 	 */
 	public abstract Graph[] getDependsOn(Graph g);
 
@@ -97,7 +97,8 @@ public abstract class AbstractGraphProducer<T extends Graph> implements
 	 * 
 	 * @param g
 	 *            The graph we are looking for.
-	 * @return
+	 * @return   
+	 *            Graph[]
 	 */
 	public abstract Graph[] getNotDependsOn(Graph g);
 

http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractInfModelProducer.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractInfModelProducer.java
b/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractInfModelProducer.java
index 898503d..b8d3a5c 100644
--- a/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractInfModelProducer.java
+++ b/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractInfModelProducer.java
@@ -48,7 +48,7 @@ public abstract class AbstractInfModelProducer<T extends InfModel>
extends
 	/**
 	 * Returns the model that was used in the reasoner.bind() call.
 	 * 
-	 * @return
+	 * @return Model
 	 */
 	abstract public Model getBoundModel();
 

http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractModelProducer.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractModelProducer.java
b/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractModelProducer.java
index 882e9d3..d111b40 100644
--- a/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractModelProducer.java
+++ b/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractModelProducer.java
@@ -72,9 +72,10 @@ public abstract class AbstractModelProducer<T extends Model> implements
 	 *            The graph that is closed
 	 */
 	protected void afterClose(T g) {
-	};
+	}
 
-	@Override
+	@SuppressWarnings("unchecked")
+    @Override
 	final public void cleanUp() {
 		for (Model m : modelList) {
 			if (!m.isClosed()) {

http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractRecordingListener.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractRecordingListener.java
b/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractRecordingListener.java
index e9e26a1..09a55e9 100644
--- a/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractRecordingListener.java
+++ b/jena-core/src/test/java/org/apache/jena/testing_framework/AbstractRecordingListener.java
@@ -184,7 +184,7 @@ public class AbstractRecordingListener {
 	public final Iterator<Object> from(Object start) {
 		Iterator<Object> iter = history.iterator();
 		while (iter.hasNext() && !iter.next().equals(start))
-			; // loop
+		{}
 		return iter;
 	}
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/testing_framework/IIteratorProducer.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/testing_framework/IIteratorProducer.java
b/jena-core/src/test/java/org/apache/jena/testing_framework/IIteratorProducer.java
index 8e17cec..5d9af00 100644
--- a/jena-core/src/test/java/org/apache/jena/testing_framework/IIteratorProducer.java
+++ b/jena-core/src/test/java/org/apache/jena/testing_framework/IIteratorProducer.java
@@ -27,7 +27,7 @@ public interface IIteratorProducer<T> {
 	/**
 	 * Get a new instance of the iterator.
 	 * 
-	 * @return
+	 * @return ExtendedIterator
 	 */
 	public ExtendedIterator<T> newInstance();
 
@@ -39,14 +39,14 @@ public interface IIteratorProducer<T> {
 	/**
 	 * The list of items found in the iterator. Does not have to be in order.
 	 * 
-	 * @return
+	 * @return List
 	 */
 	public List<T> getList();
 
 	/**
 	 * True if delete is supported by the iterator
 	 * 
-	 * @return
+	 * @return boolean
 	 */
 	public boolean supportsDelete();
 
@@ -54,7 +54,7 @@ public interface IIteratorProducer<T> {
 	 * True if this is an iterator on a copy so that delete works but getting a
 	 * new copy for the iterator test will return the original list.
 	 * 
-	 * @return
+	 * @return boolean
 	 */
 	public boolean isCopy();
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/testing_framework/ModelHelper.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/testing_framework/ModelHelper.java b/jena-core/src/test/java/org/apache/jena/testing_framework/ModelHelper.java
index 2f35203..2972986 100644
--- a/jena-core/src/test/java/org/apache/jena/testing_framework/ModelHelper.java
+++ b/jena-core/src/test/java/org/apache/jena/testing_framework/ModelHelper.java
@@ -140,8 +140,6 @@ public class ModelHelper extends GraphHelper {
 	/**
 	 * Create an array of Statements parsed from a semi-separated string.
 	 * 
-	 * @param lockModel
-	 *            a model to serve as a statement factory
 	 * @param facts
 	 *            a sequence of semicolon-separated "S P O" facts
 	 * @return a Statement[] of the (S P O) statements from the string
@@ -214,7 +212,7 @@ public class ModelHelper extends GraphHelper {
 	 * does all insertions in a transaction.
 	 * 
 	 * @param facts
-	 * @return
+	 * @return Model
 	 */
 	public static Model memModel(String facts) {
 		Model model = ModelFactory.createMemModelMaker().createFreshModel();
@@ -248,11 +246,7 @@ public class ModelHelper extends GraphHelper {
 	 * Creates a model with extended prefixes and initialises it with statements
 	 * parsed from the statement iterator.
 	 * 
-	 * does all insertions in a transaction.
-	 * 
-	 * @param facts
-	 *            a string in semicolon-separated "S P O" format
-	 * @return a model containing those facts
+	 * Does all insertions in a transaction.
 	 */
 	public static Model modelWithStatements(
 			IProducer<? extends Model> producer, final StmtIterator it) {
@@ -283,8 +277,6 @@ public class ModelHelper extends GraphHelper {
 	 *            the model value that is expected
 	 * @param got
 	 *            the model value to check
-	 * @exception if
-	 *                the models are not isomorphic
 	 */
 	public static void assertIsoModels(String title, Model wanted, Model got) {
 		if (wanted.isIsomorphicWith(got) == false) {

http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/testing_framework/TestFileData.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/testing_framework/TestFileData.java b/jena-core/src/test/java/org/apache/jena/testing_framework/TestFileData.java
index d839c82..da72e42 100644
--- a/jena-core/src/test/java/org/apache/jena/testing_framework/TestFileData.java
+++ b/jena-core/src/test/java/org/apache/jena/testing_framework/TestFileData.java
@@ -321,11 +321,11 @@ public class TestFileData {
 			throws IOException {
 		File f = File.createTempFile("tfd", extension);
 		f.deleteOnExit();
-		FileOutputStream fos = new FileOutputStream(f);
-		// fos.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>".getBytes());
-		// fos.write(System.getProperty("line.separator").getBytes());
-		fos.write(data.getBytes());
-		fos.close();
+		try (FileOutputStream fos = new FileOutputStream(f); ) {
+		    // fos.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>".getBytes());
+		    // fos.write(System.getProperty("line.separator").getBytes());
+		    fos.write(data.getBytes());
+		}
 		return f.toURI().toURL().toExternalForm();
 	}
 

http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/testing_framework/TestUtils.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/testing_framework/TestUtils.java b/jena-core/src/test/java/org/apache/jena/testing_framework/TestUtils.java
index 78d4bab..e862c9f 100644
--- a/jena-core/src/test/java/org/apache/jena/testing_framework/TestUtils.java
+++ b/jena-core/src/test/java/org/apache/jena/testing_framework/TestUtils.java
@@ -39,14 +39,14 @@ import org.apache.jena.util.iterator.ExtendedIterator;
 import org.apache.jena.util.iterator.WrappedIterator;
 
 /**
- * Foo basis for Jena test cases which provides assertFalse and assertDiffer.
+ * Basis for Jena test cases which provides assertFalse and assertDiffer.
  * Often the logic of the names is clearer than using a negation.
  */
 public class TestUtils {
 	// do not instantiate
 	protected TestUtils() {
 		throw new UnsupportedOperationException("Do not instantiate TestUtils");
-	};
+	}
 
 	/**
 	 * assert that the two objects must be unequal according to .equals().

http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/testing_framework/manifest/Manifest.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/testing_framework/manifest/Manifest.java
b/jena-core/src/test/java/org/apache/jena/testing_framework/manifest/Manifest.java
index 79d2fce..9ff4354 100644
--- a/jena-core/src/test/java/org/apache/jena/testing_framework/manifest/Manifest.java
+++ b/jena-core/src/test/java/org/apache/jena/testing_framework/manifest/Manifest.java
@@ -18,26 +18,26 @@
 
 package org.apache.jena.testing_framework.manifest;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.jena.n3.IRIResolver;
-import org.apache.jena.rdf.model.*;
-import org.apache.jena.util.FileManager;
-import org.apache.jena.vocabulary.RDF;
-import org.apache.jena.vocabulary.RDFS;
-import org.apache.jena.vocabulary.TestManifest;
-import org.apache.jena.vocabulary.TestManifestX;
+import java.util.ArrayList ;
+import java.util.Collection ;
+import java.util.Iterator ;
+import java.util.List ;
+
+import org.apache.jena.n3.IRIResolver ;
+import org.apache.jena.rdf.model.* ;
+import org.apache.jena.util.FileManager ;
+import org.apache.jena.vocabulary.RDF ;
+import org.apache.jena.vocabulary.RDFS ;
+import org.apache.jena.vocabulary.TestManifest ;
+import org.apache.jena.vocabulary.TestManifestX ;
+import org.slf4j.Logger ;
+import org.slf4j.LoggerFactory ;
 
 /**
  * A test manifest for a single manifest file.
  */
 
+@SuppressWarnings("deprecation")
 public class Manifest {
 	// This class does not know about JUnit.
 	private static Logger log = LoggerFactory.getLogger(Manifest.class);
@@ -47,7 +47,7 @@ public class Manifest {
 	private List<String> includedFiles = new ArrayList<String>();
 	private Resource manifestRes = null;
 
-	public Manifest(String fn) {
+    public Manifest(String fn) {
 		log.debug("Manifest = " + fn);
 		filename = IRIResolver.resolveGlobal(fn);
 		log.debug("         = " + filename);

http://git-wip-us.apache.org/repos/asf/jena/blob/1e2ea5e1/jena-core/src/test/java/org/apache/jena/testing_framework/manifest/ManifestItemHandler.java
----------------------------------------------------------------------
diff --git a/jena-core/src/test/java/org/apache/jena/testing_framework/manifest/ManifestItemHandler.java
b/jena-core/src/test/java/org/apache/jena/testing_framework/manifest/ManifestItemHandler.java
index 08ce69f..f322867 100644
--- a/jena-core/src/test/java/org/apache/jena/testing_framework/manifest/ManifestItemHandler.java
+++ b/jena-core/src/test/java/org/apache/jena/testing_framework/manifest/ManifestItemHandler.java
@@ -18,16 +18,13 @@
 
 package org.apache.jena.testing_framework.manifest;
 
-import java.util.List;
+import java.util.List ;
 
-import org.junit.runner.Runner;
-import org.junit.runners.model.InitializationError;
+import org.junit.runner.Runner ;
 
 public interface ManifestItemHandler {
 	/**
 	 * Handle an item in a manifest
-	 * 
-	 * @throws InitializationError
 	 */
 	public void processManifestItem(ManifestItem item);
 


Mime
View raw message