Clean up warnings and remove unused code
This commit is contained in:
@@ -20,14 +20,17 @@ import java.lang.reflect.Method;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Brian Clozel
|
* @author Brian Clozel
|
||||||
|
* @since 6.0
|
||||||
*/
|
*/
|
||||||
public class SampleReflection {
|
public class SampleReflection {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public void sample() {
|
public void sample() {
|
||||||
String value = "Sample";
|
String value = "Sample";
|
||||||
Method[] methods = String.class.getMethods();
|
Method[] methods = String.class.getMethods();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public void multipleCalls() {
|
public void multipleCalls() {
|
||||||
String value = "Sample";
|
String value = "Sample";
|
||||||
Method[] methods = String.class.getMethods();
|
Method[] methods = String.class.getMethods();
|
||||||
|
|||||||
@@ -312,7 +312,6 @@ class InstrumentedMethodTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void classGetDeclaredMethodsShouldMatchIntrospectPublicMethodsHint() {
|
void classGetDeclaredMethodsShouldMatchIntrospectPublicMethodsHint() {
|
||||||
RecordedInvocation invocation = RecordedInvocation.of(InstrumentedMethod.CLASS_GETDECLAREDMETHODS).onInstance(String.class).build();
|
|
||||||
hints.reflection().registerType(String.class, typeHint -> typeHint.withMembers(MemberCategory.INTROSPECT_PUBLIC_METHODS));
|
hints.reflection().registerType(String.class, typeHint -> typeHint.withMembers(MemberCategory.INTROSPECT_PUBLIC_METHODS));
|
||||||
assertThatInvocationDoesNotMatch(InstrumentedMethod.CLASS_GETDECLAREDMETHODS, this.stringGetScaleMethod);
|
assertThatInvocationDoesNotMatch(InstrumentedMethod.CLASS_GETDECLAREDMETHODS, this.stringGetScaleMethod);
|
||||||
}
|
}
|
||||||
@@ -634,12 +633,6 @@ class InstrumentedMethodTests {
|
|||||||
assertThat(method.matcher(invocation)).rejects(this.hints);
|
assertThat(method.matcher(invocation)).rejects(this.hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class PrivateConstructor {
|
|
||||||
|
|
||||||
private PrivateConstructor() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static class PublicField {
|
static class PublicField {
|
||||||
|
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ public class PathPatternParser {
|
|||||||
*/
|
*/
|
||||||
public final static PathPatternParser defaultInstance = new PathPatternParser() {
|
public final static PathPatternParser defaultInstance = new PathPatternParser() {
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public void setMatchOptionalTrailingSeparator(boolean matchOptionalTrailingSeparator) {
|
public void setMatchOptionalTrailingSeparator(boolean matchOptionalTrailingSeparator) {
|
||||||
raiseError();
|
raiseError();
|
||||||
|
|||||||
@@ -185,10 +185,11 @@ public class RequestMappingReflectiveProcessorTests {
|
|||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
HttpEntity<Response> getHttpEntity() {
|
HttpEntity<Response> getHttpEntity() {
|
||||||
return new HttpEntity(new Response("response"));
|
return new HttpEntity<>(new Response("response"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
HttpEntity getRawHttpEntity() {
|
HttpEntity getRawHttpEntity() {
|
||||||
return new HttpEntity(new Response("response"));
|
return new HttpEntity(new Response("response"));
|
||||||
}
|
}
|
||||||
@@ -198,6 +199,7 @@ public class RequestMappingReflectiveProcessorTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
void postRawHttpEntity(HttpEntity entity) {
|
void postRawHttpEntity(HttpEntity entity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import org.springframework.core.NestedExceptionUtils;
|
|||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class NestedServletExceptionTests {
|
public class NestedServletExceptionTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user