Skip to content

Commit

Permalink
Merge pull request apache#1658 from afs/shex-clean
Browse files Browse the repository at this point in the history
jena-shex clean-up.
  • Loading branch information
afs authored Dec 1, 2022
2 parents e188c35 + 633d7dc commit 4e890d3
Show file tree
Hide file tree
Showing 22 changed files with 72 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class JavaCharStream
{
/** Whether parser is static. */

@SuppressWarnings("all")
public static final boolean staticFlag = false;

Expand Down Expand Up @@ -65,7 +65,7 @@ static final int hexval(char c) throws java.io.IOException {
}

/* Position in buffer. */

@SuppressWarnings("all")
public int bufpos = -1;
int bufsize;
Expand All @@ -90,10 +90,10 @@ static final int hexval(char c) throws java.io.IOException {
protected int tabSize = 1;
protected boolean trackLineColumn = true;


@SuppressWarnings("all")
public void setTabSize(int i) { tabSize = i; }

@SuppressWarnings("all")
public int getTabSize() { return tabSize; }

Expand Down Expand Up @@ -185,7 +185,7 @@ protected char ReadByte() throws java.io.IOException
}

/* @return starting character for token. */

@SuppressWarnings("all")
public char BeginToken() throws java.io.IOException
{
Expand Down Expand Up @@ -267,7 +267,7 @@ else if (prevCharIsCR)
}

/* Read a character. */

@SuppressWarnings("all")
public char readChar() throws java.io.IOException
{
Expand Down Expand Up @@ -367,7 +367,7 @@ public char readChar() throws java.io.IOException
* @see #getEndColumn
*/
@Deprecated

@SuppressWarnings("all")
public int getColumn() {
return bufcolumn[bufpos];
Expand All @@ -379,7 +379,7 @@ public int getColumn() {
* @return the line number.
*/
@Deprecated

@SuppressWarnings("all")
public int getLine() {
return bufline[bufpos];
Expand All @@ -388,7 +388,7 @@ public int getLine() {
/** Get end column.
* @return the end column or -1
*/

@SuppressWarnings("all")
public int getEndColumn() {
return bufcolumn[bufpos];
Expand All @@ -397,29 +397,29 @@ public int getEndColumn() {
/** Get end line.
* @return the end line number or -1
*/

@SuppressWarnings("all")
public int getEndLine() {
return bufline[bufpos];
}

/** Get the beginning column.
* @return column of token start */

@SuppressWarnings("all")
public int getBeginColumn() {
return bufcolumn[tokenBegin];
}

/** @return line number of token start */

@SuppressWarnings("all")
public int getBeginLine() {
return bufline[tokenBegin];
}

/** Retreat. */

@SuppressWarnings("all")
public void backup(int amount) {

Expand All @@ -434,7 +434,7 @@ public void backup(int amount) {
* @param startcolumn column number of the first character of the stream.
* @param buffersize size of the buffer
*/

@SuppressWarnings("all")
public JavaCharStream(java.io.Reader dstream,
int startline, int startcolumn, int buffersize)
Expand All @@ -455,7 +455,7 @@ public JavaCharStream(java.io.Reader dstream,
* @param startline line number of the first character of the stream, mostly for error messages.
* @param startcolumn column number of the first character of the stream.
*/

@SuppressWarnings("all")
public JavaCharStream(java.io.Reader dstream,
int startline, int startcolumn)
Expand All @@ -465,16 +465,15 @@ public JavaCharStream(java.io.Reader dstream,

/** Constructor.
* @param dstream the underlying data source.
* @param startline line number of the first character of the stream, mostly for error messages.
*/

@SuppressWarnings("all")
public JavaCharStream(java.io.Reader dstream)
{
this(dstream, 1, 1, 4096);
}
/* Reinitialise. */

@SuppressWarnings("all")
public void ReInit(java.io.Reader dstream,
int startline, int startcolumn, int buffersize)
Expand All @@ -497,7 +496,7 @@ public void ReInit(java.io.Reader dstream,
}

/* Reinitialise. */

@SuppressWarnings("all")
public void ReInit(java.io.Reader dstream,
int startline, int startcolumn)
Expand All @@ -506,14 +505,14 @@ public void ReInit(java.io.Reader dstream,
}

/* Reinitialise. */

@SuppressWarnings("all")
public void ReInit(java.io.Reader dstream)
{
ReInit(dstream, 1, 1, 4096);
}
/** Constructor. */

@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
Expand All @@ -527,7 +526,7 @@ public JavaCharStream(java.io.InputStream dstream, String encoding, int startlin
* @param startcolumn column number of the first character of the stream.
* @param buffersize size of the buffer
*/

@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, int startline,
int startcolumn, int buffersize)
Expand All @@ -542,7 +541,7 @@ public JavaCharStream(java.io.InputStream dstream, int startline,
* @param startcolumn column number of the first character of the stream.
* @throws UnsupportedEncodingException encoding is invalid or unsupported.
*/

@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
int startcolumn) throws java.io.UnsupportedEncodingException
Expand All @@ -555,7 +554,7 @@ public JavaCharStream(java.io.InputStream dstream, String encoding, int startlin
* @param startline line number of the first character of the stream, mostly for error messages.
* @param startcolumn column number of the first character of the stream.
*/

@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, int startline,
int startcolumn)
Expand All @@ -568,7 +567,7 @@ public JavaCharStream(java.io.InputStream dstream, int startline,
* @param encoding the character encoding of the data stream.
* @throws UnsupportedEncodingException encoding is invalid or unsupported.
*/

@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
{
Expand All @@ -578,7 +577,7 @@ public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.
/** Constructor.
* @param dstream the underlying data source.
*/

@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream)
{
Expand All @@ -592,7 +591,7 @@ public JavaCharStream(java.io.InputStream dstream)
* @param startcolumn column number of the first character of the stream.
* @param buffersize size of the buffer
*/

@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
Expand All @@ -606,7 +605,7 @@ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
* @param startcolumn column number of the first character of the stream.
* @param buffersize size of the buffer
*/

@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, int startline,
int startcolumn, int buffersize)
Expand All @@ -620,7 +619,7 @@ public void ReInit(java.io.InputStream dstream, int startline,
* @param startcolumn column number of the first character of the stream.
* @throws UnsupportedEncodingException encoding is invalid or unsupported.
*/

@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
int startcolumn) throws java.io.UnsupportedEncodingException
Expand All @@ -632,7 +631,7 @@ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
* @param startline line number of the first character of the stream, mostly for error messages.
* @param startcolumn column number of the first character of the stream.
*/

@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, int startline,
int startcolumn)
Expand All @@ -644,7 +643,7 @@ public void ReInit(java.io.InputStream dstream, int startline,
* @param encoding the character encoding of the data stream.
* @throws UnsupportedEncodingException encoding is invalid or unsupported.
*/

@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
{
Expand All @@ -654,7 +653,7 @@ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.
/** Reinitialise.
* @param dstream the underlying data source.
*/

@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream)
{
Expand All @@ -663,7 +662,7 @@ public void ReInit(java.io.InputStream dstream)

/** Get the token timage.
* @return token image as String */

@SuppressWarnings("all")
public String GetImage()
{
Expand All @@ -677,7 +676,7 @@ public String GetImage()
/** Get the suffix as an array of characters.
* @param len the length of the array to return.
* @return suffix */

@SuppressWarnings("all")
public char[] GetSuffix(int len)
{
Expand All @@ -696,7 +695,7 @@ public char[] GetSuffix(int len)
}

/** Set buffers back to null when finished. */

@SuppressWarnings("all")
public void Done()
{
Expand All @@ -712,7 +711,7 @@ public void Done()
* @param newLine the new line number.
* @param newCol the new column number.
*/

@SuppressWarnings("all")
public void adjustBeginLineColumn(int newLine, int newCol)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.apache.jena.query.* ;
import org.apache.jena.rdf.model.* ;
import org.apache.jena.shared.PropertyNotFoundException;
import org.apache.jena.sparql.engine.ExecutionContext;
import org.apache.jena.sparql.util.NotUniqueException ;
import org.apache.jena.sparql.util.PropertyRequiredException ;
import org.apache.jena.sparql.util.QueryExecUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,8 @@ private static List<List<Set<Triple>>> partition(Collection<Triple> triples,
// if ( triples.stream().noneMatch(t->predicateToTripleExprs.containsKey(t.getPredicate())) )
// return null;


// Start. One empty partition
List<Set<Triple>> emptyPartial = emptyPartition(tripleExprs);


List<List<Set<Triple>>> partials = new ArrayList<>();
partials.add(emptyPartial);

Expand Down Expand Up @@ -178,5 +175,4 @@ private static List<Set<Triple>> emptyPartition(List<TripleExpression> tripleExp
}
return partition;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static ShapeExpression create(List<ShapeExpression> acc) {
List<ShapeExpression> shapeExpressions;

private ShapeExprAND(List<ShapeExpression> expressions) {
super(null);
super();
this.shapeExpressions = expressions;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class ShapeExprDot extends ShapeExpression {

public ShapeExprDot() {
super(null);
super();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public class ShapeExprExternal extends ShapeExpression {

public ShapeExprExternal() {
super(null);
super();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class ShapeExprFalse extends ShapeExpression {

public ShapeExprFalse() {
super(null);
super();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ShapeExprNOT extends ShapeExpression {
private final ShapeExpression other;

public ShapeExprNOT(ShapeExpression shapeExpression) {
super(null);
super();
this.other = shapeExpression;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class ShapeExprNone extends ShapeExpression {
public static ShapeExpression get() { return instance ; }

private ShapeExprNone() {
super(null);
super();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static ShapeExpression create(List<ShapeExpression> acc) {
private List<ShapeExpression> shapeExpressions;

private ShapeExprOR(List<ShapeExpression> expressions) {
super(null);
super();
this.shapeExpressions = expressions;
}

Expand Down
Loading

0 comments on commit 4e890d3

Please sign in to comment.