This is an automated email from the ASF dual-hosted git repository. andy pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/jena.git
commit 65782506ad17a3ed78b880a809973474df651130 Author: Andy Seaborne <[email protected]> AuthorDate: Sun May 11 18:37:48 2025 +0100 Update fixing of warnings in javacc generated code --- jena-arq/Grammar/grammar | 21 +++++++-------- .../jena/sparql/lang/arq/javacc/TokenMgrError.java | 2 -- .../lang/sparql_12/javacc/JavaCharStream.java | 31 +++++++++++----------- .../lang/sparql_12/javacc/TokenMgrError.java | 2 -- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/jena-arq/Grammar/grammar b/jena-arq/Grammar/grammar index 993a7f028b..f05f4bef6e 100755 --- a/jena-arq/Grammar/grammar +++ b/jena-arq/Grammar/grammar @@ -60,23 +60,22 @@ function grammar ## mv F $F ## JavaCharStream -- SimpleCharStream is OK. - echo "---- Fixing Java warnings in JavaCharStream..." F="$DIR/JavaCharStream.java" if [ -e "$F" ] then - perl -0777 -pe 's/public\nclass JavaCharStream/\@SuppressWarnings("all")\npublic\nclass JavaCharStream/' < $F > F - ##sed -e 's/^public$/@SuppressWarnings("all")\npublic/' < $F > F + echo "---- Fixing Javadoc warnings in JavaCharStream..." + perl -0777 -pe 's!/\*\* (Constructor|Reinitialise).!/\* $1!sg' < $F > F mv F $F fi - ## TokenMgrError - echo "---- Fixing Java warnings in TokenMgrError" - F="$DIR/TokenMgrError.java" - if [ -e "$F" ] - then - sed -e 's/public class TokenMgrError/\n@SuppressWarnings("all")\npublic class TokenMgrError/' < $F > F - mv F $F - fi +## ## TokenMgrError +## echo "---- Fixing Java warnings in TokenMgrError" +## F="$DIR/TokenMgrError.java" +## if [ -e "$F" ] +## then +## sed -e 's/public class TokenMgrError/\n@SuppressWarnings("all")\npublic class TokenMgrError/' < $F > F +## mv F $F +## fi ## -- In the parser itself echo "---- Fixing Java warnings in ${CLASS} ..." diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/javacc/TokenMgrError.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/javacc/TokenMgrError.java index 239864b985..1b45fa1bd1 100644 --- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/javacc/TokenMgrError.java +++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/javacc/TokenMgrError.java @@ -3,8 +3,6 @@ package org.apache.jena.sparql.lang.arq.javacc ; /** Token Manager Error. */ - -@SuppressWarnings("all") public class TokenMgrError extends Error { diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_12/javacc/JavaCharStream.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_12/javacc/JavaCharStream.java index e706e9ce83..e0e07b46f2 100644 --- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_12/javacc/JavaCharStream.java +++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_12/javacc/JavaCharStream.java @@ -7,7 +7,6 @@ package org.apache.jena.sparql.lang.sparql_12.javacc ; * contain only ASCII characters (with java-like unicode escape processing). */ -@SuppressWarnings("all") public class JavaCharStream { @@ -401,7 +400,7 @@ class JavaCharStream bufpos += bufsize; } -/** Constructor. +/* Constructor * @param dstream the underlying data source. * @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. @@ -421,7 +420,7 @@ class JavaCharStream nextCharBuf = new char[4096]; } -/** Constructor. +/* Constructor * @param dstream the underlying data source. * @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. @@ -432,7 +431,7 @@ class JavaCharStream this(dstream, startline, startcolumn, 4096); } -/** Constructor. +/* Constructor * @param dstream the underlying data source. * @param startline line number of the first character of the stream, mostly for error messages. */ @@ -473,14 +472,14 @@ class JavaCharStream { ReInit(dstream, 1, 1, 4096); } -/** Constructor. */ +/* Constructor */ public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException { this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); } -/** Constructor. +/* Constructor * @param dstream the underlying data source. * @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. @@ -492,7 +491,7 @@ class JavaCharStream this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); } -/** Constructor. +/* Constructor * @param dstream the underlying data source. * @param encoding the character encoding of the data stream. * @param startline line number of the first character of the stream, mostly for error messages. @@ -505,7 +504,7 @@ class JavaCharStream this(dstream, encoding, startline, startcolumn, 4096); } -/** Constructor. +/* Constructor * @param dstream the underlying data source. * @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. @@ -516,7 +515,7 @@ class JavaCharStream this(dstream, startline, startcolumn, 4096); } -/** Constructor. +/* Constructor * @param dstream the underlying data source. * @param encoding the character encoding of the data stream. * @throws UnsupportedEncodingException encoding is invalid or unsupported. @@ -526,7 +525,7 @@ class JavaCharStream this(dstream, encoding, 1, 1, 4096); } - /** Constructor. + /* Constructor * @param dstream the underlying data source. */ public JavaCharStream(java.io.InputStream dstream) @@ -534,7 +533,7 @@ class JavaCharStream this(dstream, 1, 1, 4096); } -/** Reinitialise. +/* Reinitialise * @param dstream the underlying data source. * @param encoding the character encoding of the data stream. * @param startline line number of the first character of the stream, mostly for error messages. @@ -547,7 +546,7 @@ class JavaCharStream ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); } -/** Reinitialise. +/* Reinitialise * @param dstream the underlying data source. * @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. @@ -558,7 +557,7 @@ class JavaCharStream { ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); } -/** Reinitialise. +/* Reinitialise * @param dstream the underlying data source. * @param encoding the character encoding of the data stream. * @param startline line number of the first character of the stream, mostly for error messages. @@ -570,7 +569,7 @@ class JavaCharStream { ReInit(dstream, encoding, startline, startcolumn, 4096); } -/** Reinitialise. +/* Reinitialise * @param dstream the underlying data source. * @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. @@ -580,7 +579,7 @@ class JavaCharStream { ReInit(dstream, startline, startcolumn, 4096); } -/** Reinitialise. +/* Reinitialise * @param dstream the underlying data source. * @param encoding the character encoding of the data stream. * @throws UnsupportedEncodingException encoding is invalid or unsupported. @@ -590,7 +589,7 @@ class JavaCharStream ReInit(dstream, encoding, 1, 1, 4096); } -/** Reinitialise. +/* Reinitialise * @param dstream the underlying data source. */ public void ReInit(java.io.InputStream dstream) diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_12/javacc/TokenMgrError.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_12/javacc/TokenMgrError.java index 415595f10c..7dee69decf 100644 --- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_12/javacc/TokenMgrError.java +++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_12/javacc/TokenMgrError.java @@ -3,8 +3,6 @@ package org.apache.jena.sparql.lang.sparql_12.javacc ; /** Token Manager Error. */ - -@SuppressWarnings("all") public class TokenMgrError extends Error {
