jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject [13/14] jena git commit: Further code review
Date Sun, 30 Oct 2016 18:36:25 GMT
Further code review


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

Branch: refs/heads/master
Commit: 9915310d7ab8f01c54053b9f228c769a73635bc9
Parents: d4d7baf
Author: ajs6f <ajs6f@virginia.edu>
Authored: Sun Oct 23 14:49:05 2016 -0400
Committer: ajs6f <ajs6f@virginia.edu>
Committed: Sun Oct 30 14:12:32 2016 -0400

----------------------------------------------------------------------
 .../apache/jena/arq/querybuilder/AbstractQueryBuilder.java   | 2 +-
 .../jena/arq/querybuilder/handlers/AggregationHandler.java   | 2 +-
 .../src/main/java/org/apache/jena/jdbc/JenaDriver.java       | 4 ++--
 .../java/org/apache/jena/jdbc/results/SelectResults.java     | 2 +-
 .../jena/permissions/graph/SecuredGraphEventManager.java     | 8 +++-----
 5 files changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/9915310d/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/AbstractQueryBuilder.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/AbstractQueryBuilder.java
b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/AbstractQueryBuilder.java
index bc1fc95..2e25990 100644
--- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/AbstractQueryBuilder.java
+++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/AbstractQueryBuilder.java
@@ -199,7 +199,7 @@ public abstract class AbstractQueryBuilder<T extends AbstractQueryBuilder<T>>
 	 */
 	protected AbstractQueryBuilder() {
 		query = new Query();
-		values = new HashMap<>();
+		values = new HashMap<Var, Node>();
 	}
 	
 	/**

http://git-wip-us.apache.org/repos/asf/jena/blob/9915310d/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/AggregationHandler.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/AggregationHandler.java
b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/AggregationHandler.java
index 208a800..f999ca8 100644
--- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/AggregationHandler.java
+++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/AggregationHandler.java
@@ -43,7 +43,7 @@ public class AggregationHandler implements Handler {
 	public AggregationHandler( Query query )
 	{
 		this.query = query;
-		aggMap = new HashMap<>();
+		aggMap = new HashMap<Var,ExprAggregator>();
 	}
 	
 	/**

http://git-wip-us.apache.org/repos/asf/jena/blob/9915310d/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/JenaDriver.java
----------------------------------------------------------------------
diff --git a/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/JenaDriver.java b/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/JenaDriver.java
index be13215..355babf 100644
--- a/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/JenaDriver.java
+++ b/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/JenaDriver.java
@@ -333,7 +333,7 @@ public abstract class JenaDriver implements Driver {
             if (ppObj != null) {
                 if (ppObj instanceof String) {
                     // Single instance to try and register
-                    preProcessors = new ArrayList<>();
+                    preProcessors = new ArrayList<String>();
                     preProcessors.add(ppObj.toString());
                 } else if (ppObj instanceof List<?>) {
                     // Multiple instances to try and register
@@ -438,7 +438,7 @@ public abstract class JenaDriver implements Driver {
 
                 if (ppObj instanceof String) {
                     // Single instance to try and register
-                    postProcessors = new ArrayList<>();
+                    postProcessors = new ArrayList<String>();
                     postProcessors.add(ppObj.toString());
                 } else if (ppObj instanceof List<?>) {
                     // Multiple instances to try and register

http://git-wip-us.apache.org/repos/asf/jena/blob/9915310d/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/SelectResults.java
----------------------------------------------------------------------
diff --git a/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/SelectResults.java
b/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/SelectResults.java
index e499523..f8512ad 100644
--- a/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/SelectResults.java
+++ b/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/SelectResults.java
@@ -64,7 +64,7 @@ public class SelectResults extends StreamedResults<Binding> {
         if (results == null)
             throw new SQLException("SPARQL Results cannot be null");
         this.innerResults = results;
-        this.columns = new ArrayList<>(this.innerResults.getResultVars());
+        this.columns = new ArrayList<String>(this.innerResults.getResultVars());
         this.metadata = statement.getJenaConnection().applyPostProcessors(new SelectResultsMetadata(this,
this.innerResults));
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/9915310d/jena-permissions/src/main/java/org/apache/jena/permissions/graph/SecuredGraphEventManager.java
----------------------------------------------------------------------
diff --git a/jena-permissions/src/main/java/org/apache/jena/permissions/graph/SecuredGraphEventManager.java
b/jena-permissions/src/main/java/org/apache/jena/permissions/graph/SecuredGraphEventManager.java
index 386b8ab..c7f3991 100644
--- a/jena-permissions/src/main/java/org/apache/jena/permissions/graph/SecuredGraphEventManager.java
+++ b/jena-permissions/src/main/java/org/apache/jena/permissions/graph/SecuredGraphEventManager.java
@@ -21,13 +21,13 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.Stack;
 
+import org.apache.jena.ext.com.google.common.collect.Sets;
 import org.apache.jena.graph.Graph;
 import org.apache.jena.graph.GraphEventManager;
 import org.apache.jena.graph.GraphListener;
@@ -378,10 +378,8 @@ public class SecuredGraphEventManager implements GraphEventManager {
 	private static Set<Action> ADD;
 
 	static {
-		SecuredGraphEventManager.ADD = new HashSet<>(
-				Arrays.asList(new Action[] { Action.Create, Action.Read }));
-		SecuredGraphEventManager.DELETE = new HashSet<>(
-				Arrays.asList(new Action[] { Action.Delete, Action.Read }));
+		SecuredGraphEventManager.ADD = Sets.newHashSet(Action.Create, Action.Read);
+		SecuredGraphEventManager.DELETE = Sets.newHashSet(Action.Delete, Action.Read);
 	}
 
 	public SecuredGraphEventManager(final SecuredGraph securedGraph,


Mime
View raw message