Skip to content

Commit

Permalink
cleanup build warnings (#13591)
Browse files Browse the repository at this point in the history
* Cleanup build warnings

---------

Co-authored-by: Mattias Reichel <[email protected]>
  • Loading branch information
jamesfredley and matrei authored Aug 22, 2024
1 parent 821b927 commit 0cd1821
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ subprojects { project ->
testImplementation "org.junit.platform:junit-platform-runner:1.10.2"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.2"

compileOnly 'com.github.spotbugs:spotbugs-annotations:4.8.6'

if (project.name != "grails-docs") {
// Logging
api "org.slf4j:slf4j-api:$slf4jVersion"
Expand Down
4 changes: 2 additions & 2 deletions gradle/integration-test.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ dependencies {
task integrationTest(type: Test) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
reports.html.enabled = false
reports.html.getRequired().set(false)
}

// Make sure 'check' task calls integration test
check.dependsOn integrationTest

// Merge test reports
task mergeTestReports(type: TestReport) {
destinationDir = file("$buildDir/reports/tests")
destinationDirectory = file("$buildDir/reports/tests")

// These must point to the binary test results directory generated by a Test task instance.
// If Test task instances are specified directly, this task would depend on them and run them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class GrailsConsole implements ConsoleLogger {
public static final String HISTORYFILE = ".grails_history";
public static final String STACKTRACE_FILTERED_MESSAGE = " (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)";
public static final String STACKTRACE_MESSAGE = " (Use --stacktrace to see the full trace)";
public static final Character SECURE_MASK_CHAR = new Character('*');
public static final Character SECURE_MASK_CHAR = Character.valueOf('*');
private PrintStream originalSystemOut;
private PrintStream originalSystemErr;
private StringBuilder maxIndicatorString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,21 +377,21 @@ public void testIsAssignableOrConvertibleFrom() {

@Test
public void testIsPropertyGetter() throws Exception {
assertTrue(GrailsClassUtils.isPropertyGetter(ClassHavingPropertyGetters.class.getDeclaredMethod("getName", null)));
assertFalse(GrailsClassUtils.isPropertyGetter(ClassHavingPropertyGetters.class.getDeclaredMethod("setName", null)));
assertFalse(GrailsClassUtils.isPropertyGetter(ClassHavingPropertyGetters.class.getDeclaredMethod("getSurname", null)));
assertFalse(GrailsClassUtils.isPropertyGetter(ClassHavingPropertyGetters.class.getDeclaredMethod("getNewYear", null)));
assertTrue(GrailsClassUtils.isPropertyGetter(ClassHavingPropertyGetters.class.getDeclaredMethod("getName")));
assertFalse(GrailsClassUtils.isPropertyGetter(ClassHavingPropertyGetters.class.getDeclaredMethod("setName")));
assertFalse(GrailsClassUtils.isPropertyGetter(ClassHavingPropertyGetters.class.getDeclaredMethod("getSurname")));
assertFalse(GrailsClassUtils.isPropertyGetter(ClassHavingPropertyGetters.class.getDeclaredMethod("getNewYear")));
assertFalse(GrailsClassUtils.isPropertyGetter(ClassHavingPropertyGetters.class.getDeclaredMethod("getFilename", String.class)));
assertFalse(GrailsClassUtils.isPropertyGetter(ClassHavingPropertyGetters.class.getDeclaredMethod("getTitle", null)));
assertFalse(GrailsClassUtils.isPropertyGetter(ClassHavingPropertyGetters.class.getDeclaredMethod("getTitle")));
}

@Test
@Issue("https://github.com/grails/grails-core/issues/10343")
public void testPropertiesBeginningWithSingleLowerCaseLetter() throws Exception {
assertTrue(GrailsClassUtils.isPropertyGetter(SomeGroovyClass.class.getDeclaredMethod("getaString", null)));
assertTrue(GrailsClassUtils.isPropertyGetter(SomeGroovyClass.class.getDeclaredMethod("isaBoolean", null)));
assertTrue(GrailsClassUtils.isPropertyGetter(SomeGroovyClass.class.getDeclaredMethod("getS", null)));
assertTrue(GrailsClassUtils.isPropertyGetter(SomeGroovyClass.class.getDeclaredMethod("isB", null)));
assertTrue(GrailsClassUtils.isPropertyGetter(SomeGroovyClass.class.getDeclaredMethod("getaString")));
assertTrue(GrailsClassUtils.isPropertyGetter(SomeGroovyClass.class.getDeclaredMethod("isaBoolean")));
assertTrue(GrailsClassUtils.isPropertyGetter(SomeGroovyClass.class.getDeclaredMethod("getS")));
assertTrue(GrailsClassUtils.isPropertyGetter(SomeGroovyClass.class.getDeclaredMethod("isB")));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void putValue(String name, Object value) {
*/

/**
* @see jakarta.servlet.http.HttpSession#removeValue(java.lang.String)
* @see jakarta.servlet.http.HttpSession
* @deprecated
*/
/*
Expand All @@ -184,6 +184,7 @@ public void removeValue(String name) {
/* (non-Javadoc)
* @see jakarta.servlet.http.HttpSession#invalidate()
*/
@Deprecated
public void invalidate() {
createSessionIfNecessary();
synchronized (this) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ final private Object JsonNumber() throws ParseException {
// See if the number fits in an integer, or long
// Use BigInteger only if it is big enough.
if (intpart.length() < 10) {
n = new Integer(intpart);
n = Integer.valueOf(intpart);
} else if (intpart.length() < 19) {
n = new Long(intpart);
n = Long.valueOf(intpart);
} else {
n = new java.math.BigInteger(intpart);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public static void cleanupIncludeRequestAttributes(HttpServletRequest request, M
}

/**
* Expose the current request URI and paths as {@link javax.servlet.http.HttpServletRequest}
* Expose the current request URI and paths as {@link jakarta.servlet.http.HttpServletRequest}
* attributes under the keys defined in the Servlet 2.4 specification,
* for containers that implement 2.3 or an earlier version of the Servlet API:
* <code>javax.servlet.forward.request_uri</code>,
Expand Down

0 comments on commit 0cd1821

Please sign in to comment.