Reduce warnings reported by Eclipse

Closes gh-43269
This commit is contained in:
Andy Wilkinson
2024-11-22 14:42:48 +00:00
parent cf1dadf2e7
commit bb3651b7d1
17 changed files with 148 additions and 117 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -381,7 +381,7 @@ public abstract class AbstractApplicationContextRunner<SELF extends AbstractAppl
}
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "resource" })
private A createAssertableContext(boolean refresh) {
ResolvableType resolvableType = ResolvableType.forClass(AbstractApplicationContextRunner.class, getClass());
Class<A> assertType = (Class<A>) resolvableType.resolveGeneric(1);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@ import static org.mockito.Mockito.mock;
class AssertableApplicationContextTests {
@Test
@SuppressWarnings("resource")
void getShouldReturnProxy() {
AssertableApplicationContext context = AssertableApplicationContext
.get(() -> mock(ConfigurableApplicationContext.class));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@ import static org.mockito.Mockito.mock;
class AssertableReactiveWebApplicationContextTests {
@Test
@SuppressWarnings("resource")
void getShouldReturnProxy() {
AssertableReactiveWebApplicationContext context = AssertableReactiveWebApplicationContext
.get(() -> mock(ConfigurableReactiveWebApplicationContext.class));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@ import static org.mockito.Mockito.mock;
class AssertableWebApplicationContextTests {
@Test
@SuppressWarnings("resource")
void getShouldReturnProxy() {
AssertableWebApplicationContext context = AssertableWebApplicationContext
.get(() -> mock(ConfigurableWebApplicationContext.class));