diff --git a/arquillian/managed/src/main/java/cloud/piranha/arquillian/managed/ManagedPiranhaContainer.java b/arquillian/managed/src/main/java/cloud/piranha/arquillian/managed/ManagedPiranhaContainer.java index e127470cf..0d079a3af 100644 --- a/arquillian/managed/src/main/java/cloud/piranha/arquillian/managed/ManagedPiranhaContainer.java +++ b/arquillian/managed/src/main/java/cloud/piranha/arquillian/managed/ManagedPiranhaContainer.java @@ -108,11 +108,13 @@ public void setup(ManagedPiranhaContainerConfiguration configuration) { this.configuration = configuration; } + @SuppressWarnings("exports") @Override public ProtocolDescription getDefaultProtocol() { return new ProtocolDescription(configuration.getProtocol()); } + @SuppressWarnings("exports") @Override public ProtocolMetaData deploy(Archive archive) throws DeploymentException { LOGGER.log(INFO, "Deploying " + archive.getName()); @@ -300,6 +302,7 @@ private String convertGroupIdToPath(String groupId) { * @return the URL. * @throws IOException when an I/O error occurs. */ + @SuppressWarnings("deprecation") private URL createMavenCentralArtifactUrl(String groupId, String artifactId, String version, String type) throws IOException { return new URL("https://repo1.maven.org/maven2/" + createArtifactPath(groupId, artifactId, version, type)); } diff --git a/arquillian/managed/src/main/java/cloud/piranha/arquillian/managed/ManagedPiranhaContainerExtension.java b/arquillian/managed/src/main/java/cloud/piranha/arquillian/managed/ManagedPiranhaContainerExtension.java index 910d3400c..f82b8f4d0 100644 --- a/arquillian/managed/src/main/java/cloud/piranha/arquillian/managed/ManagedPiranhaContainerExtension.java +++ b/arquillian/managed/src/main/java/cloud/piranha/arquillian/managed/ManagedPiranhaContainerExtension.java @@ -43,6 +43,7 @@ public class ManagedPiranhaContainerExtension implements LoadableExtension { public ManagedPiranhaContainerExtension() { } + @SuppressWarnings("exports") @Override public void register(ExtensionBuilder extensionBuilder) { extensionBuilder.service(DeployableContainer.class, ManagedPiranhaContainer.class); diff --git a/core/impl/src/main/java/cloud/piranha/core/impl/CookieParser.java b/core/impl/src/main/java/cloud/piranha/core/impl/CookieParser.java index 8a4587d76..775ee5cb2 100644 --- a/core/impl/src/main/java/cloud/piranha/core/impl/CookieParser.java +++ b/core/impl/src/main/java/cloud/piranha/core/impl/CookieParser.java @@ -80,7 +80,7 @@ private static Cookie[] parseNetscape(String cookiesValue) { return cookieList.toArray(new Cookie[0]); } - @SuppressWarnings({"deprecation", "removal"}) + @SuppressWarnings({"removal"}) private static Cookie[] parseRFC2109(String cookiesValue) { List cookieList = new ArrayList<>(); String[] cookieCandidates = cookiesValue.split("[;,]"); diff --git a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultAnnotationManager.java b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultAnnotationManager.java index 819c1b91a..d4a95bb15 100644 --- a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultAnnotationManager.java +++ b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultAnnotationManager.java @@ -59,6 +59,7 @@ public void addAnnotatedClass(Class annotationClass, Class classes.add(clazz); annotatedClasses.put(annotationClass, classes); } else { + @SuppressWarnings({ "rawtypes", "unchecked" }) HashSet> classes = (HashSet) annotatedClasses.get(annotationClass); classes.add(clazz); } @@ -108,6 +109,7 @@ public Set> getAnnotatedClass(Class annotationCla return annotatedClasses.getOrDefault(annotationClass, Collections.emptySet()); } + @SuppressWarnings("unchecked") @Override public Set> getAnnotatedClasses(Class[] annotationClasses) { HashSet> result = new HashSet<>(); diff --git a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultModuleFinder.java b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultModuleFinder.java index 3eb5f2183..afbee51c8 100644 --- a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultModuleFinder.java +++ b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultModuleFinder.java @@ -200,6 +200,7 @@ private void addProviders(ModuleDescriptor.Builder builder, Resource resource) { InputStream inputStream = resource.getResourceAsStream(providerFile); if (inputStream == null) continue; + @SuppressWarnings("resource") List providerList = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)) .lines() .filter(x -> !x.startsWith("#")) diff --git a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultNamedRequestDispatcher.java b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultNamedRequestDispatcher.java index 5f97df4fb..92fada5dc 100644 --- a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultNamedRequestDispatcher.java +++ b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultNamedRequestDispatcher.java @@ -111,7 +111,6 @@ public void include(ServletRequest servletRequest, ServletResponse servletRespon throws ServletException, IOException { WebApplicationRequest request = unwrap(servletRequest); - WebApplicationResponse response = unwrap(servletResponse); /* - JAVADOC, Servlet:SPEC:192 * diff --git a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultPushBuilder.java b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultPushBuilder.java index 65dc96157..3e9877bd5 100644 --- a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultPushBuilder.java +++ b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultPushBuilder.java @@ -63,6 +63,7 @@ public class DefaultPushBuilder implements PushBuilder { /** * Stores the web application request. */ + @SuppressWarnings("unused") private final WebApplicationRequest request; /** diff --git a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationBuilder.java b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationBuilder.java index f4464f76b..b27aaee4f 100644 --- a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationBuilder.java +++ b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationBuilder.java @@ -98,6 +98,7 @@ public DefaultWebApplicationBuilder() { * * @return the web application. */ + @SuppressWarnings("unchecked") public DefaultWebApplication build() { DefaultWebApplication webApplication = new DefaultWebApplication(); for (Resource resource : resources) { diff --git a/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebConnectionTest.java b/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebConnectionTest.java index be48baa9f..2f4d0b7c5 100644 --- a/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebConnectionTest.java +++ b/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebConnectionTest.java @@ -57,6 +57,7 @@ void testClose() throws Exception { @Test void testGetInputStream() throws Exception { DefaultWebApplicationRequest request = new DefaultWebApplicationRequest(); + @SuppressWarnings("resource") DefaultWebConnection connection = new DefaultWebConnection(request, null); assertNotNull(connection.getInputStream()); } @@ -67,6 +68,7 @@ void testGetInputStream() throws Exception { @Test void testGetOutputStream() throws Exception { DefaultWebApplicationResponse response = new DefaultWebApplicationResponse(); + @SuppressWarnings("resource") DefaultWebConnection connection = new DefaultWebConnection(null, response); assertNotNull(connection.getOutputStream()); } diff --git a/core/impl/src/test/java/cloud/piranha/core/impl/HttpSessionTest.java b/core/impl/src/test/java/cloud/piranha/core/impl/HttpSessionTest.java index 0413717e0..e876a54cd 100644 --- a/core/impl/src/test/java/cloud/piranha/core/impl/HttpSessionTest.java +++ b/core/impl/src/test/java/cloud/piranha/core/impl/HttpSessionTest.java @@ -1341,6 +1341,7 @@ void testSetSessionTimeoutWithMultipleTimeouts() { */ @Test void testSetSessionTrackingModesWithEmptyHashSet() { + @SuppressWarnings({ "rawtypes", "unchecked" }) WebApplication webApplication = new DefaultWebApplicationBuilder() .sessionTrackingModes(new HashSet()) .build(); diff --git a/core/impl/src/test/java/cloud/piranha/core/impl/TestHttpServerRequest.java b/core/impl/src/test/java/cloud/piranha/core/impl/TestHttpServerRequest.java index afa54ac1f..ba63628b9 100644 --- a/core/impl/src/test/java/cloud/piranha/core/impl/TestHttpServerRequest.java +++ b/core/impl/src/test/java/cloud/piranha/core/impl/TestHttpServerRequest.java @@ -88,6 +88,7 @@ public boolean isSecure() { /** * Stores the query string. */ + @SuppressWarnings("unused") private String queryString; /**