Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #4240 - Cleanup various bits #4244

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public BeanArchiveBuilder handle(String beanArchiveReference) {
indexURL = "shrinkwrap://cloud.piranha.modular.classes/META-INF/jandex.idx";
} else {
try {
@SuppressWarnings("deprecation")
URL url = new URL(beanArchiveReference);
String protocol = url.getProtocol();
if (!protocol.equals("shrinkwrap")) {
Expand Down
4 changes: 2 additions & 2 deletions micro/core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
requires cloud.piranha.http.webapp;
requires cloud.piranha.resource.shrinkwrap;
requires jakarta.annotation;
requires jakarta.cdi;
requires jakarta.security;
requires transitive jakarta.cdi;
requires transitive jakarta.security;
requires java.logging;
requires java.naming;
requires java.xml;
Expand Down
1 change: 1 addition & 0 deletions multi/src/main/java/cloud/piranha/multi/MultiPiranha.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ private boolean isStarted() {
/**
* Run method.
*/
@SuppressWarnings("unchecked")
@Override
public void run() {
long startTime = System.currentTimeMillis();
Expand Down
2 changes: 2 additions & 0 deletions multi/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@
requires cloud.piranha.feature.webapps;
requires java.logging;
requires java.naming;
requires transitive cloud.piranha.core.api;
requires transitive jakarta.servlet;
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public byte[] getBytes() {
* @param url the url in string form.
* @return the URL, or null if not found.
*/
@SuppressWarnings("deprecation")
@Override
public URL getResource(String url) {
String location = getLocationFromUrl(url);
Expand Down Expand Up @@ -150,6 +151,7 @@ private String getLocationFromUrl(String url) {

// Relative URL: [bytes://][root][location] eg bytes://root/WEB-INF/web.xml
try {
@SuppressWarnings("deprecation")
URL bytesURL = new URL(url.substring(url.indexOf(BYTES_PROTOCOL)));

String hostName = bytesURL.getHost();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public String getName() {
/**
* {@return the resource}
*/
@SuppressWarnings("deprecation")
@Override
public URL getResource(String location) {
URL result = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public JarResource(File jarFile) {
/**
* {@return the resource}
*/
@SuppressWarnings("deprecation")
@Override
public URL getResource(String location) {
URL result = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public PrefixJarResource(JarFile jarFile, String prefix) {
}
}

@SuppressWarnings("deprecation")
@Override
public URL getResource(String location) {
URL result = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public ShrinkWrapResource(Archive<?> archive) {
archiveStreamHandler = new ArchiveURLStreamHandler(this.archive);
}

@SuppressWarnings("deprecation")
@Override
public URL getResource(String url) {
String location = getLocationFromUrl(url);
Expand Down Expand Up @@ -221,6 +222,7 @@ private String getLocationFromUrl(String url) {

// Relative URL: [shrinkwrap://][jar name][location]
try {
@SuppressWarnings("deprecation")
URL archiveURL = new URL(url.substring(url.indexOf(SHRINKWRAP_PROTOCOL)));

String archiveName = archiveURL.getHost();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public PiranhaConfiguration getConfiguration() {
/**
* Run method.
*/
@SuppressWarnings("unchecked")
@Override
public void run() {
long startTime = System.currentTimeMillis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
*/
package cloud.piranha.single;

import cloud.piranha.single.SinglePiranha;
import cloud.piranha.single.SinglePiranhaBuilder;
import java.net.ConnectException;
import java.net.Socket;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
*/
package cloud.piranha.single;

import cloud.piranha.single.SinglePiranha;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNotNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
exports cloud.piranha.spring.starter.embedded;
opens cloud.piranha.spring.starter.embedded;
requires cloud.piranha.embedded;
requires cloud.piranha.http.api;
requires cloud.piranha.http.impl;
requires cloud.piranha.http.webapp;
requires spring.boot;
requires transitive cloud.piranha.http.api;
requires transitive spring.boot;
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ void testAuthenticated() throws Exception {

assertEquals(302, response.getStatus(), "Should redirect");

@SuppressWarnings("deprecation")
URL redirectUrl = new URL(response.getHeader("Location"));
request = new EmbeddedRequestBuilder()
.servletPath(redirectUrl.getPath())
Expand Down
1 change: 0 additions & 1 deletion test/micro/snoop/src/main/java/snoop/SnoopServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public class SnoopServlet extends HttpServlet {
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@SuppressWarnings({"deprecation"})
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
Expand Down
Loading