cleanup-and-merge-tests: fix warnings, set gradlew permissions, enable unchecked warnings in maven

This commit is contained in:
Sean Leary 2023-12-30 16:30:19 -06:00
parent d7819a4fa2
commit 5ddb8c3d35
8 changed files with 17 additions and 6 deletions

0
gradlew vendored Normal file → Executable file
View File

View File

@ -104,6 +104,9 @@
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
<compilerArgs>
<arg>-Xlint:unchecked</arg>
</compilerArgs>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>

View File

@ -1359,7 +1359,8 @@ public class JSONArray implements Iterable<Object> {
* The subscript. * The subscript.
* @param value * @param value
* The Map value. * The Map value.
* @return this. * @return
* reference to self
* @throws JSONException * @throws JSONException
* If the index is negative or if the value is an invalid * If the index is negative or if the value is an invalid
* number. * number.
@ -1381,7 +1382,7 @@ public class JSONArray implements Iterable<Object> {
* The Map value. * The Map value.
* @param jsonParserConfiguration * @param jsonParserConfiguration
* Configuration object for the JSON parser * Configuration object for the JSON parser
* @return * @return reference to self
* @throws JSONException * @throws JSONException
* If the index is negative or if the value is an invalid * If the index is negative or if the value is an invalid
* number. * number.

View File

@ -55,11 +55,13 @@ public class JSONMLParserConfiguration extends ParserConfiguration {
); );
} }
@SuppressWarnings("unchecked")
@Override @Override
public JSONMLParserConfiguration withKeepStrings(final boolean newVal) { public JSONMLParserConfiguration withKeepStrings(final boolean newVal) {
return super.withKeepStrings(newVal); return super.withKeepStrings(newVal);
} }
@SuppressWarnings("unchecked")
@Override @Override
public JSONMLParserConfiguration withMaxNestingDepth(int maxNestingDepth) { public JSONMLParserConfiguration withMaxNestingDepth(int maxNestingDepth) {
return super.withMaxNestingDepth(maxNestingDepth); return super.withMaxNestingDepth(maxNestingDepth);

View File

@ -17,6 +17,7 @@ public class JSONParserConfiguration extends ParserConfiguration {
return new JSONParserConfiguration(); return new JSONParserConfiguration();
} }
@SuppressWarnings("unchecked")
@Override @Override
public JSONParserConfiguration withMaxNestingDepth(final int maxNestingDepth) { public JSONParserConfiguration withMaxNestingDepth(final int maxNestingDepth) {
return super.withMaxNestingDepth(maxNestingDepth); return super.withMaxNestingDepth(maxNestingDepth);

View File

@ -75,6 +75,7 @@ public class ParserConfiguration {
* *
* @return The existing configuration will not be modified. A new configuration is returned. * @return The existing configuration will not be modified. A new configuration is returned.
*/ */
@SuppressWarnings("unchecked")
public <T extends ParserConfiguration> T withKeepStrings(final boolean newVal) { public <T extends ParserConfiguration> T withKeepStrings(final boolean newVal) {
T newConfig = (T)this.clone(); T newConfig = (T)this.clone();
newConfig.keepStrings = newVal; newConfig.keepStrings = newVal;
@ -101,6 +102,7 @@ public class ParserConfiguration {
* *
* @return The existing configuration will not be modified. A new configuration is returned. * @return The existing configuration will not be modified. A new configuration is returned.
*/ */
@SuppressWarnings("unchecked")
public <T extends ParserConfiguration> T withMaxNestingDepth(int maxNestingDepth) { public <T extends ParserConfiguration> T withMaxNestingDepth(int maxNestingDepth) {
T newConfig = (T)this.clone(); T newConfig = (T)this.clone();

View File

@ -192,6 +192,7 @@ public class XMLParserConfiguration extends ParserConfiguration {
* *
* @return The existing configuration will not be modified. A new configuration is returned. * @return The existing configuration will not be modified. A new configuration is returned.
*/ */
@SuppressWarnings("unchecked")
@Override @Override
public XMLParserConfiguration withKeepStrings(final boolean newVal) { public XMLParserConfiguration withKeepStrings(final boolean newVal) {
return super.withKeepStrings(newVal); return super.withKeepStrings(newVal);
@ -309,6 +310,7 @@ public class XMLParserConfiguration extends ParserConfiguration {
* @param maxNestingDepth the maximum nesting depth allowed to the XML parser * @param maxNestingDepth the maximum nesting depth allowed to the XML parser
* @return The existing configuration will not be modified. A new configuration is returned. * @return The existing configuration will not be modified. A new configuration is returned.
*/ */
@SuppressWarnings("unchecked")
@Override @Override
public XMLParserConfiguration withMaxNestingDepth(int maxNestingDepth) { public XMLParserConfiguration withMaxNestingDepth(int maxNestingDepth) {
return super.withMaxNestingDepth(maxNestingDepth); return super.withMaxNestingDepth(maxNestingDepth);
@ -316,7 +318,7 @@ public class XMLParserConfiguration extends ParserConfiguration {
/** /**
* To enable explicit end tag with empty value. * To enable explicit end tag with empty value.
* @param closeEmptyTag * @param closeEmptyTag new value for the closeEmptyTag property
* @return same instance of configuration with empty tag config updated * @return same instance of configuration with empty tag config updated
*/ */
public XMLParserConfiguration withCloseEmptyTag(boolean closeEmptyTag){ public XMLParserConfiguration withCloseEmptyTag(boolean closeEmptyTag){

View File

@ -12,7 +12,7 @@ import java.util.List;
*/ */
public class WeirdList { public class WeirdList {
/** */ /** */
private final List<Integer> list = new ArrayList(); private final List<Integer> list = new ArrayList<>();
/** /**
* @param vals * @param vals
@ -25,14 +25,14 @@ public class WeirdList {
* @return a copy of the list * @return a copy of the list
*/ */
public List<Integer> get() { public List<Integer> get() {
return new ArrayList(this.list); return new ArrayList<>(this.list);
} }
/** /**
* @return a copy of the list * @return a copy of the list
*/ */
public List<Integer> getALL() { public List<Integer> getALL() {
return new ArrayList(this.list); return new ArrayList<>(this.list);
} }
/** /**