From 26ca8ce297aa6628d467ecf76dba1155bb967bd8 Mon Sep 17 00:00:00 2001 From: ajs6f Date: Sat, 8 Oct 2016 16:05:32 -0400 Subject: [PATCH] Minor cleanup, removing dead code --- .../arq/querybuilder/handlers/PrologHandler.java | 2 +- .../arq/querybuilder/handlers/SelectHandler.java | 2 +- .../jena/arq/querybuilder/handlers/WhereHandler.java | 2 +- .../arq/querybuilder/rewriters/ExprRewriter.java | 2 +- .../org/apache/jena/arq/AbstractRegexpBasedTest.java | 12 ++++++------ .../arq/querybuilder/clauses/AbstractClauseTest.java | 8 ++++---- .../querybuilder/handlers/AbstractHandlerTest.java | 6 +++--- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/PrologHandler.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/PrologHandler.java index 0a5b1b94637..fe3dcfc9064 100644 --- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/PrologHandler.java +++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/PrologHandler.java @@ -52,7 +52,7 @@ public PrologHandler(Query query) { * @param x The prefix name * @return The prefix name with the trialing ':' removed. */ - private String canonicalPfx(String x) { + private static String canonicalPfx(String x) { if (x.endsWith(":")) return x.substring(0, x.length() - 1); return x; diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/SelectHandler.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/SelectHandler.java index a42f305f6b4..4013096a586 100644 --- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/SelectHandler.java +++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/SelectHandler.java @@ -120,7 +120,7 @@ public void addVar(String expression, Var var) { * @throws QueryParseException * on error */ - private Expr parseExpr(String s) throws QueryParseException { + private static Expr parseExpr(String s) throws QueryParseException { try { ARQParser parser = new ARQParser(new StringReader("SELECT " + s)); parser.setQuery(new Query()); diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/WhereHandler.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/WhereHandler.java index 83cd469d4dc..b5303c6045e 100644 --- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/WhereHandler.java +++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/handlers/WhereHandler.java @@ -138,7 +138,7 @@ private ElementGroup getClause() { * @param t * The trip to test. */ - private void testTriple(Triple t) { + private static void testTriple(Triple t) { // verify Triple is valid boolean validSubject = t.getSubject().isURI() || t.getSubject().isBlank() || t.getSubject().isVariable() || t.getSubject().equals(Node.ANY); diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/ExprRewriter.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/ExprRewriter.java index ba148c43da3..2487c9b7db6 100644 --- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/ExprRewriter.java +++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/rewriters/ExprRewriter.java @@ -81,7 +81,7 @@ public void visit(ExprFunctionN func) { push(retval); } - private void setExprList(ExprFunctionN n, ExprList exprList) { + private static void setExprList(ExprFunctionN n, ExprList exprList) { try { Field f = ExprFunctionN.class.getDeclaredField("args"); f.setAccessible(true); diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/AbstractRegexpBasedTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/AbstractRegexpBasedTest.java index 57b1f775aea..da932558406 100644 --- a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/AbstractRegexpBasedTest.java +++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/AbstractRegexpBasedTest.java @@ -62,7 +62,7 @@ protected static String uri(String s) { /** Regex for rdf:type as a URI or the abbreviation 'a' */ protected static String regexRDFtype = "("+uri("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")+"|a)" ; - protected final String var(String s) { + protected final static String var(String s) { return "\\?" + s; } @@ -70,12 +70,12 @@ protected final String var(String s) { * RDF 1.0 : use ^^xsd:string form. * RDF 1.1 : use untyped form. */ - protected final String presentStringType() { + protected final static String presentStringType() { return JenaRuntime.isRDF11 ? "" : "\\^\\^\\" ; } - protected final void assertNotContainsRegex(String expected, String lst) { + protected final static void assertNotContainsRegex(String expected, String lst) { Pattern patt = Pattern.compile(expected, Pattern.DOTALL); @@ -84,7 +84,7 @@ protected final void assertNotContainsRegex(String expected, String lst) { } } - protected final void assertContainsRegex(String expected, String entry) { + protected final static void assertContainsRegex(String expected, String entry) { Pattern patt = Pattern.compile(expected, Pattern.DOTALL); if (patt.matcher(entry).find()) { @@ -93,7 +93,7 @@ protected final void assertContainsRegex(String expected, String entry) { fail(String.format("%s not found in %s", expected, entry)); } - protected final void assertNotContainsRegex(String expected, String[] lst) { + protected final static void assertNotContainsRegex(String expected, String[] lst) { Pattern patt = Pattern.compile(expected, Pattern.DOTALL); for (String s : lst) { @@ -104,7 +104,7 @@ protected final void assertNotContainsRegex(String expected, String[] lst) { } } - protected final void assertContainsRegex(String expected, String[] lst) { + protected final static void assertContainsRegex(String expected, String[] lst) { Pattern patt = Pattern.compile(expected, Pattern.DOTALL|Pattern.CASE_INSENSITIVE); for (String s : lst) { if (patt.matcher(s).find()) { diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/clauses/AbstractClauseTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/clauses/AbstractClauseTest.java index 7b3ed947eec..e54eb3694f2 100644 --- a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/clauses/AbstractClauseTest.java +++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/clauses/AbstractClauseTest.java @@ -30,11 +30,11 @@ public abstract class AbstractClauseTest extends AbstractRegexpBasedTest { - protected final String[] byLine(AbstractQueryBuilder builder) { + protected final static String[] byLine(AbstractQueryBuilder builder) { return builder.buildString().split("\n"); } - protected final Query getQuery(AbstractQueryBuilder builder) + protected final static Query getQuery(AbstractQueryBuilder builder) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { Field f = AbstractQueryBuilder.class.getDeclaredField("query"); @@ -42,13 +42,13 @@ protected final Query getQuery(AbstractQueryBuilder builder) return (Query) f.get(builder); } - protected final void assertContains(String expected, String[] lst) { + protected final static void assertContains(String expected, String[] lst) { List s = Arrays.asList(lst); assertTrue(String.format("%s not found in %s", expected, s), s.contains(expected)); } - protected final void assertNotContains(String expected, String[] lst) { + protected final static void assertNotContains(String expected, String[] lst) { List s = Arrays.asList(lst); assertFalse(String.format("%s found in %s", expected, s), s.contains(expected)); diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/handlers/AbstractHandlerTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/handlers/AbstractHandlerTest.java index 64cd39c5410..e2b08946493 100644 --- a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/handlers/AbstractHandlerTest.java +++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/handlers/AbstractHandlerTest.java @@ -25,17 +25,17 @@ public abstract class AbstractHandlerTest extends AbstractRegexpBasedTest { - protected final String[] byLine(String s) { + protected final static String[] byLine(String s) { return s.split("\n"); } - protected final void assertContains(String expected, String[] lst) { + protected final static void assertContains(String expected, String[] lst) { List s = Arrays.asList(lst); assertTrue(String.format("%s not found in %s", expected, s), s.contains(expected)); } - protected final void assertNotContains(String expected, String[] lst) { + protected final static void assertNotContains(String expected, String[] lst) { List s = Arrays.asList(lst); assertFalse(String.format("%s found in %s", expected, s), s.contains(expected));