Skip to content

Commit

Permalink
Minor cleanup, removing dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Oct 30, 2016
1 parent 865aab6 commit 26ca8ce
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ 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;
}

/** Match the type of a xsd:string typed term.
* 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 ? "" : "\\^\\^\\<http://www.w3.org/2001/XMLSchema#string\\>" ;
}

protected final void assertNotContainsRegex(String expected, String lst) {
protected final static void assertNotContainsRegex(String expected, String lst) {

Pattern patt = Pattern.compile(expected, Pattern.DOTALL);

Expand All @@ -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()) {
Expand All @@ -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) {
Expand All @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@

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");
f.setAccessible(true);
return (Query) f.get(builder);
}

protected final void assertContains(String expected, String[] lst) {
protected final static void assertContains(String expected, String[] lst) {
List<String> 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<String> s = Arrays.asList(lst);
assertFalse(String.format("%s found in %s", expected, s),
s.contains(expected));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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<String> s = Arrays.asList(lst);
assertFalse(String.format("%s found in %s", expected, s),
s.contains(expected));
Expand Down

0 comments on commit 26ca8ce

Please sign in to comment.