Skip to content

Commit

Permalink
Fixed JPMS declarations.
Browse files Browse the repository at this point in the history
Some require transitive was missing, and has been added.
In other cases, making a field private (e.g. for log instances) made the warning go away.
In another case, removed explicit dependency on websocket core exception, as it was not necessary.

Clean up the POMs for jetty-eeN-annotations, that had unnecessary dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
  • Loading branch information
sbordet committed May 23, 2024
1 parent 456fd80 commit 36cdc12
Show file tree
Hide file tree
Showing 30 changed files with 30 additions and 69 deletions.
2 changes: 1 addition & 1 deletion jetty-core/jetty-deploy/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
requires java.xml;
requires org.eclipse.jetty.xml;
requires org.eclipse.jetty.server;
requires transitive org.eclipse.jetty.server;
requires org.slf4j;

// Only required if using JMX.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import java.util.Map;

import org.eclipse.jetty.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Cookie parser
Expand All @@ -31,9 +29,8 @@
@Deprecated (forRemoval = true)
public class CookieCache implements CookieParser.Handler, ComplianceViolation.Listener
{
protected static final Logger LOG = LoggerFactory.getLogger(CookieCache.class);
protected final List<String> _rawFields = new ArrayList<>();
protected List<HttpCookie> _cookieList;
private final List<String> _rawFields = new ArrayList<>();
private List<HttpCookie> _cookieList;
private final CookieParser _parser;
private List<ComplianceViolation.Event> _violations;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@Deprecated
public class CookieCutter implements CookieParser
{
protected static final Logger LOG = LoggerFactory.getLogger(CookieCutter.class);
private static final Logger LOG = LoggerFactory.getLogger(CookieCutter.class);

private final CookieParser.Handler _handler;
private final CookieCompliance _complianceMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
*/
public class HttpParser
{
public static final Logger LOG = LoggerFactory.getLogger(HttpParser.class);
private static final Logger LOG = LoggerFactory.getLogger(HttpParser.class);
public static final int INITIAL_URI_LENGTH = 256;
private static final int MAX_CHUNK_LENGTH = Integer.MAX_VALUE / 16 - 16;
private static final String UNMATCHED_VALUE = "\u0000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import java.util.Locale;

import org.eclipse.jetty.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.eclipse.jetty.http.CookieCompliance.Violation.ATTRIBUTES;
import static org.eclipse.jetty.http.CookieCompliance.Violation.ATTRIBUTE_VALUES;
Expand All @@ -34,8 +32,6 @@
*/
public class RFC6265CookieParser implements CookieParser
{
protected static final Logger LOG = LoggerFactory.getLogger(RFC6265CookieParser.class);

private final CookieParser.Handler _handler;
private final CookieCompliance _complianceMode;
private final ComplianceViolation.Listener _complianceListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
public abstract class SelectorManager extends ContainerLifeCycle implements Dumpable
{
public static final int DEFAULT_CONNECT_TIMEOUT = 15000;
protected static final Logger LOG = LoggerFactory.getLogger(SelectorManager.class);
private static final Logger LOG = LoggerFactory.getLogger(SelectorManager.class);

private final Executor executor;
private final Scheduler scheduler;
Expand Down
4 changes: 2 additions & 2 deletions jetty-core/jetty-plus/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

module org.eclipse.jetty.plus
{
requires org.eclipse.jetty.security;
requires transitive org.eclipse.jetty.security;
requires org.eclipse.jetty.util;
requires org.slf4j;

requires transitive java.naming;
// Only required if using DataSourceLoginService.
requires static java.sql;
requires static transitive java.sql;

exports org.eclipse.jetty.plus.annotation;
exports org.eclipse.jetty.plus.jndi;
Expand Down
2 changes: 1 addition & 1 deletion jetty-core/jetty-security/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
requires transitive org.eclipse.jetty.util;
requires transitive org.slf4j;
requires static java.security.jgss;
requires static java.sql;
requires static transitive java.sql;

exports org.eclipse.jetty.security;
exports org.eclipse.jetty.security.authentication;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public static Stream<int[]> contentLengths()
@MethodSource("contentLengths")
public void testHttp11MultipleContentLength(int[] clen) throws Exception
{
HttpParser.LOG.info("badMessage: 400 Bad messages EXPECTED...");
LOG.info("badMessage: 400 Bad messages EXPECTED...");
StringBuilder request = new StringBuilder();
request.append("POST / HTTP/1.1\r\n");
request.append("Host: local\r\n");
Expand Down Expand Up @@ -298,7 +298,7 @@ public static Stream<Arguments> http11ContentLengthAndChunkedData()
@MethodSource("http11ContentLengthAndChunkedData")
public void testHttp11ContentLengthAndChunk(int[] contentLengths) throws Exception
{
HttpParser.LOG.info("badMessage: 400 Bad messages EXPECTED...");
LOG.info("badMessage: 400 Bad messages EXPECTED...");

StringBuilder request = new StringBuilder();
request.append("POST / HTTP/1.1\r\n");
Expand Down Expand Up @@ -405,7 +405,7 @@ public static Stream<Arguments> http11TransferEncodingInvalidChunked()
@MethodSource("http11TransferEncodingInvalidChunked")
public void testHttp11TransferEncodingInvalidChunked(List<String> tokens) throws Exception
{
HttpParser.LOG.info("badMessage: 400 Bad messages EXPECTED...");
LOG.info("badMessage: 400 Bad messages EXPECTED...");
StringBuilder request = new StringBuilder();
request.append("POST / HTTP/1.1\r\n");
request.append("Host: local\r\n");
Expand Down
2 changes: 1 addition & 1 deletion jetty-core/jetty-session/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
requires transitive org.slf4j;

// Only required if using DatabaseAdaptor/JDBCSessionDataStore.
requires static java.sql;
requires static transitive java.sql;
requires static java.naming;

exports org.eclipse.jetty.session;
Expand Down
2 changes: 1 addition & 1 deletion jetty-core/jetty-util/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
module org.eclipse.jetty.util
{
// Standard Jetty Logging now.
requires org.slf4j;
requires transitive org.slf4j;

// Required by SSL code (for X509).
requires transitive java.naming;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/
public class Utf8StringBuilder implements CharsetStringBuilder
{
protected static final Logger LOG = LoggerFactory.getLogger(Utf8StringBuilder.class);
private static final Logger LOG = LoggerFactory.getLogger(Utf8StringBuilder.class);
public static final char REPLACEMENT = '�';
private static final int UTF8_ACCEPT = 0;
private static final int UTF8_REJECT = 12;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
*/
public class AWTLeakPreventer extends AbstractLeakPreventer
{

@Override
public void prevent(ClassLoader loader)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
public abstract class AbstractLeakPreventer extends AbstractLifeCycle
{
protected static final Logger LOG = LoggerFactory.getLogger(AbstractLeakPreventer.class);
static final Logger LOG = LoggerFactory.getLogger(AbstractLeakPreventer.class);

public abstract void prevent(ClassLoader loader);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
public class AppContextLeakPreventer extends AbstractLeakPreventer
{

@Override
public void prevent(ClassLoader loader)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
public class DriverManagerLeakPreventer extends AbstractLeakPreventer
{

@Override
public void prevent(ClassLoader loader)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public void addMapping(PathSpec pathSpec, WebSocketCreator creator)
* @see #upgrade(WebSocketCreator, Request, Response, Callback)
*/
@Override
public boolean handle(Request request, Response response, Callback callback) throws WebSocketException
public boolean handle(Request request, Response response, Callback callback)
{
return mappings.upgrade(request, response, callback, configuration);
}
Expand All @@ -346,7 +346,7 @@ public boolean handle(Request request, Response response, Callback callback) thr
* @throws WebSocketException there is an error during the upgrade
* @see #handle(Request, Response, Callback)
*/
public boolean upgrade(WebSocketCreator creator, Request request, Response response, Callback callback) throws WebSocketException
public boolean upgrade(WebSocketCreator creator, Request request, Response response, Callback callback)
{
var coreCreator = newWebSocketCreator(creator);
WebSocketNegotiator negotiator = WebSocketNegotiator.from(coreCreator, factory);
Expand Down
15 changes: 0 additions & 15 deletions jetty-ee10/jetty-ee10-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
module org.eclipse.jetty.ee10.apache.jsp
{
requires java.xml;
requires jakarta.servlet;
requires transitive jakarta.servlet;
requires org.eclipse.jetty.util;
requires org.mortbay.apache.jasper;
requires transitive org.mortbay.apache.jasper;
requires org.slf4j;

exports org.eclipse.jetty.ee10.apache.jsp;
Expand Down
2 changes: 1 addition & 1 deletion jetty-ee10/jetty-ee10-jndi/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
requires transitive java.naming;

// Only required if using MailSessionReference.
requires static jakarta.mail;
requires static transitive jakarta.mail;

exports org.eclipse.jetty.ee10.jndi.factories;
}
4 changes: 2 additions & 2 deletions jetty-ee10/jetty-ee10-plus/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

module org.eclipse.jetty.ee10.plus
{
requires org.eclipse.jetty.plus;
requires transitive org.eclipse.jetty.plus;
requires org.slf4j;

requires transitive org.eclipse.jetty.ee10.webapp;

// Only required if using Transaction.
requires static jakarta.transaction;
requires static transitive jakarta.transaction;

exports org.eclipse.jetty.ee10.plus.jndi;
exports org.eclipse.jetty.ee10.plus.webapp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import javax.naming.NamingException;

import jakarta.transaction.UserTransaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Transaction
Expand All @@ -26,8 +24,6 @@
*/
public class Transaction extends org.eclipse.jetty.plus.jndi.Transaction
{
private static final Logger LOG = LoggerFactory.getLogger(Transaction.class);

/**
* @param scope the scope, usually an environment like ee9, ee10
* @param userTransaction the UserTransaction
Expand Down
2 changes: 1 addition & 1 deletion jetty-ee10/jetty-ee10-proxy/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

module org.eclipse.jetty.ee10.proxy
{
requires jakarta.servlet;
requires transitive jakarta.servlet;
requires transitive org.eclipse.jetty.client;
requires transitive org.eclipse.jetty.server;
requires transitive org.slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
requires static org.eclipse.jetty.http;
requires static org.eclipse.jetty.server;
// Only required if using CrossOriginFilter, DoSFilter, etc.
requires static org.eclipse.jetty.util;
requires static transitive org.eclipse.jetty.util;

exports org.eclipse.jetty.ee10.servlets;
}
5 changes: 0 additions & 5 deletions jetty-ee8/jetty-ee8-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions jetty-ee9/jetty-ee9-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions jetty-ee9/jetty-ee9-apache-jsp/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
module org.eclipse.jetty.ee9.apache.jsp
{
requires java.xml;
requires jetty.servlet.api;
requires transitive jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.mortbay.apache.jasper;
requires transitive org.mortbay.apache.jasper;
requires org.slf4j;

exports org.eclipse.jetty.ee9.apache.jsp;
Expand Down
2 changes: 1 addition & 1 deletion jetty-ee9/jetty-ee9-jndi/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
requires transitive java.naming;

// Only required if using MailSessionReference.
requires static jakarta.mail;
requires static transitive jakarta.mail;

exports org.eclipse.jetty.ee9.jndi.factories;
}
2 changes: 1 addition & 1 deletion jetty-ee9/jetty-ee9-plus/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
requires transitive org.eclipse.jetty.plus;

// Only required if using Transaction.
requires static jakarta.transaction;
requires static transitive jakarta.transaction;

exports org.eclipse.jetty.ee9.plus.jndi;
exports org.eclipse.jetty.ee9.plus.webapp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
requires static org.eclipse.jetty.http;
requires static org.eclipse.jetty.server;
// Only required if using CrossOriginFilter, DoSFilter, etc.
requires static org.eclipse.jetty.util;
requires static transitive org.eclipse.jetty.util;
// Only required if using DataRateLimitedServlet
requires static org.eclipse.jetty.ee9.nested;

Expand Down

0 comments on commit 36cdc12

Please sign in to comment.