Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-ByteAccumulator

This commit is contained in:
Lachlan Roberts 2020-12-15 16:49:23 +11:00
commit 41cffa0bc4
53 changed files with 214 additions and 467 deletions

29
Jenkinsfile vendored
View File

@ -12,8 +12,7 @@ pipeline {
steps {
container('jetty-build') {
timeout( time: 240, unit: 'MINUTES' ) {
mavenBuild( "jdk8", "clean install", "maven3",
[[parserName: 'Maven'], [parserName: 'Java']])
mavenBuild( "jdk8", "clean install", "maven3")
// Collect up the jacoco execution results (only on main build)
jacoco inclusionPattern: '**/org/eclipse/jetty/**/*.class',
exclusionPattern: '' +
@ -32,6 +31,7 @@ pipeline {
execPattern: '**/target/jacoco.exec',
classPattern: '**/target/classes',
sourcePattern: '**/src/main/java'
recordIssues id: "jdk8", name: "Static Analysis jdk8", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]
}
}
}
@ -42,8 +42,8 @@ pipeline {
steps {
container( 'jetty-build' ) {
timeout( time: 240, unit: 'MINUTES' ) {
mavenBuild( "jdk11", "clean install -Djacoco.skip=true", "maven3",
[[parserName: 'Maven'], [parserName: 'Java']])
mavenBuild( "jdk11", "clean install -Djacoco.skip=true -Perrorprone", "maven3")
recordIssues id: "jdk11", name: "Static Analysis jdk11", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser(), errorProne()]
}
}
}
@ -54,8 +54,8 @@ pipeline {
steps {
container( 'jetty-build' ) {
timeout( time: 240, unit: 'MINUTES' ) {
mavenBuild( "jdk15", "clean install -Djacoco.skip=true", "maven3",
[[parserName: 'Maven'], [parserName: 'Java']])
mavenBuild( "jdk15", "clean install -Djacoco.skip=true", "maven3")
recordIssues id: "jdk15", name: "Static Analysis jdk15", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]
}
}
}
@ -65,10 +65,11 @@ pipeline {
agent { node { label 'linux' } }
steps {
container( 'jetty-build' ) {
timeout( time: 60, unit: 'MINUTES' ) {
timeout( time: 120, unit: 'MINUTES' ) {
mavenBuild( "jdk11",
"install javadoc:javadoc javadoc:aggregate-jar -DskipTests -Dpmd.skip=true -Dcheckstyle.skip=true",
"maven3", [[parserName: 'Maven'], [parserName: 'JavaDoc'], [parserName: 'Java']])
"maven3")
recordIssues id: "javadoc", enabledForFailure: true, tools: [javaDoc()]
}
}
}
@ -78,9 +79,8 @@ pipeline {
agent { node { label 'linux' } }
steps {
container( 'jetty-build' ) {
timeout( time: 60, unit: 'MINUTES' ) {
mavenBuild( "jdk8", "-Pcompact3 clean install -DskipTests", "maven3",
[[parserName: 'Maven'], [parserName: 'Java']])
timeout( time: 120, unit: 'MINUTES' ) {
mavenBuild( "jdk8", "-Pcompact3 clean install -DskipTests", "maven3")
}
}
}
@ -130,7 +130,7 @@ def slackNotif() {
* @param cmdline the command line in "<profiles> <goals> <properties>"`format.
* @param consoleParsers array of console parsers to run
*/
def mavenBuild(jdk, cmdline, mvnName, consoleParsers) {
def mavenBuild(jdk, cmdline, mvnName) {
script {
try {
withEnv(["JAVA_HOME=${ tool "$jdk" }",
@ -138,16 +138,13 @@ def mavenBuild(jdk, cmdline, mvnName, consoleParsers) {
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
configFileProvider(
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -Djetty.testtracker.log=true $cmdline -Dunix.socket.tmp=/tmp/unixsocket"
sh "mvn --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e -Djetty.testtracker.log=true $cmdline -Dunix.socket.tmp=/tmp/unixsocket"
}
}
}
finally
{
junit testResults: '**/target/surefire-reports/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true
if(consoleParsers!=null){
warnings consoleParsers: consoleParsers
}
}
}
}

View File

@ -14,6 +14,7 @@
<properties>
<sonar.skip>true</sonar.skip>
<spotbugs.skip>true</spotbugs.skip>
</properties>
<build>
@ -26,14 +27,6 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<!-- No Point running Findbugs on example projects -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -9,6 +9,7 @@
<name>Jetty :: ALPN :: Client</name>
<properties>
<bundle-symbolic-name>${project.groupId}.alpn.client</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.alpn.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
@ -36,13 +37,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.alpn.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -9,6 +9,7 @@
<name>Jetty :: ALPN :: Server</name>
<properties>
<bundle-symbolic-name>${project.groupId}.alpn.server</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.alpn.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
@ -18,13 +19,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.alpn.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>

View File

@ -10,6 +10,7 @@
<description>Annotation support for deploying servlets in jetty.</description>
<properties>
<bundle-symbolic-name>${project.groupId}.annotations</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.annotations.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
@ -24,13 +25,6 @@
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.annotations.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -11,16 +11,10 @@
<properties>
<bundle-symbolic-name>${project.groupId}.client</bundle-symbolic-name>
<jetty.test.policy.loc>target/test-policy</jetty.test.policy.loc>
<spotbugs.onlyAnalyze>org.eclipse.client.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.client.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>

View File

@ -10,16 +10,10 @@
<description>Asynchronous API</description>
<properties>
<bundle-symbolic-name>${project.groupId}.continuation</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.continuation.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.continuation.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -10,18 +10,8 @@
<description>Jetty deployers</description>
<properties>
<bundle-symbolic-name>${project.groupId}.deploy</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.deploy.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.deploy.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>

View File

@ -12,6 +12,7 @@
<properties>
<assembly-directory>${basedir}/target/distribution</assembly-directory>
<home-directory>${basedir}/target/home</home-directory>
<spotbugs.skip>true</spotbugs.skip>
</properties>
<build>
@ -384,14 +385,6 @@
<skip>true</skip>
</configuration>
</plugin>
<!-- No point performing Findbugs in assembly project -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -14,6 +14,7 @@
<assembly-directory>${basedir}/target/jetty-home</assembly-directory>
<source-assembly-directory>${basedir}/target/jetty-home-sources</source-assembly-directory>
<jetty-setuid-version>1.0.4</jetty-setuid-version>
<spotbugs.skip>true</spotbugs.skip>
</properties>
<build>
@ -538,14 +539,6 @@
<skip>true</skip>
</configuration>
</plugin>
<!-- No point performing Findbugs in assembly project -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -9,6 +9,7 @@
<name>Jetty :: Http Service Provider Interface</name>
<properties>
<bundle-symbolic-name>${project.groupId}.http.spi</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.http.spi.*</spotbugs.onlyAnalyze>
</properties>
<dependencies>
<dependency>
@ -37,13 +38,6 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.http.spi.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>

View File

@ -10,6 +10,7 @@
<name>Jetty :: Http Utility</name>
<properties>
<bundle-symbolic-name>${project.groupId}.http</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.http.*</spotbugs.onlyAnalyze>
</properties>
<dependencies>
<dependency>
@ -58,13 +59,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.http.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>

View File

@ -134,6 +134,8 @@ public class HTTP2Client extends ContainerLifeCycle
private int maxFrameLength = Frame.DEFAULT_MAX_LENGTH;
private int maxConcurrentPushedStreams = 32;
private int maxSettingsKeys = SettingsFrame.DEFAULT_MAX_KEYS;
private int maxDynamicTableSize = 4096;
private int maxHeaderBlockFragment = 0;
private FlowControlStrategy.Factory flowControlStrategyFactory = () -> new BufferingFlowControlStrategy(0.5F);
@Override
@ -372,6 +374,28 @@ public class HTTP2Client extends ContainerLifeCycle
this.maxSettingsKeys = maxSettingsKeys;
}
@ManagedAttribute("The HPACK dynamic table maximum size")
public int getMaxDynamicTableSize()
{
return maxDynamicTableSize;
}
public void setMaxDynamicTableSize(int maxDynamicTableSize)
{
this.maxDynamicTableSize = maxDynamicTableSize;
}
@ManagedAttribute("The max size of header block fragments")
public int getMaxHeaderBlockFragment()
{
return maxHeaderBlockFragment;
}
public void setMaxHeaderBlockFragment(int maxHeaderBlockFragment)
{
this.maxHeaderBlockFragment = maxHeaderBlockFragment;
}
public void connect(InetSocketAddress address, Session.Listener listener, Promise<Session> promise)
{
connect(null, address, listener, promise);

View File

@ -63,7 +63,7 @@ public class HTTP2ClientConnectionFactory implements ClientConnectionFactory
@SuppressWarnings("unchecked")
Promise<Session> promise = (Promise<Session>)context.get(SESSION_PROMISE_CONTEXT_KEY);
Generator generator = new Generator(byteBufferPool);
Generator generator = new Generator(byteBufferPool, client.getMaxDynamicTableSize(), client.getMaxHeaderBlockFragment());
FlowControlStrategy flowControl = client.getFlowControlStrategyFactory().newFlowControlStrategy();
HTTP2ClientSession session = new HTTP2ClientSession(scheduler, endPoint, generator, listener, flowControl);
session.setMaxRemoteStreams(client.getMaxConcurrentPushedStreams());

View File

@ -10,6 +10,7 @@
<name>Jetty :: IO Utility</name>
<properties>
<bundle-symbolic-name>${project.groupId}.io</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.io.*</spotbugs.onlyAnalyze>
</properties>
<dependencies>
<dependency>
@ -23,15 +24,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.io.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -24,6 +24,7 @@ import java.util.Deque;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;
import org.eclipse.jetty.util.BufferUtil;
@ -158,7 +159,7 @@ public interface ByteBufferPool
private final int _capacity;
private final int _maxSize;
private final AtomicInteger _size;
private long _lastUpdate = System.nanoTime();
private final AtomicLong _lastUpdate = new AtomicLong(System.nanoTime());
public Bucket(ByteBufferPool pool, int capacity, int maxSize)
{
@ -196,7 +197,7 @@ public interface ByteBufferPool
public void release(ByteBuffer buffer)
{
_lastUpdate = System.nanoTime();
_lastUpdate.lazySet(System.nanoTime());
BufferUtil.clear(buffer);
if (_size == null)
queueOffer(buffer);
@ -251,7 +252,7 @@ public interface ByteBufferPool
long getLastUpdate()
{
return _lastUpdate;
return _lastUpdate.get();
}
@Override

View File

@ -12,6 +12,7 @@
<bundle-symbolic-name>${project.groupId}.jaas</bundle-symbolic-name>
<!-- 2.0.0.AM25 is breaking surefire -->
<apacheds.version>2.0.0-M24</apacheds.version>
<spotbugs.onlyAnalyze>org.eclipse.jetty.jaas.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
@ -21,13 +22,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.jaas.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -12,17 +12,11 @@
<properties>
<bundle-symbolic-name>${project.groupId}.security.jaspi</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.jaspi.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.jaspi.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>

View File

@ -12,17 +12,11 @@
<properties>
<bundle-symbolic-name>${project.groupId}.jmh</bundle-symbolic-name>
<spotbugs.skip>true</spotbugs.skip>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>

View File

@ -10,18 +10,8 @@
<description>JMX management artifact for jetty.</description>
<properties>
<bundle-symbolic-name>${project.groupId}.jmx</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.jmx.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.jmx.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>

View File

@ -42,6 +42,7 @@ import javax.management.remote.rmi.RMIConnectorServer;
import javax.rmi.ssl.SslRMIClientSocketFactory;
import org.eclipse.jetty.util.HostPort;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.component.AbstractLifeCycle;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@ -243,7 +244,15 @@ public class ConnectorServer extends AbstractLifeCycle
if (_sslContextFactory == null)
{
ServerSocket server = new ServerSocket();
server.bind(new InetSocketAddress(address, port));
try
{
server.bind(new InetSocketAddress(address, port));
}
catch (Throwable e)
{
IO.close(server);
throw e;
}
return server;
}
else

View File

@ -10,6 +10,7 @@
<description>JNDI spi impl for java namespace.</description>
<properties>
<bundle-symbolic-name>${project.groupId}.jndi</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.jndi.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
@ -40,13 +41,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.jndi.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -12,17 +12,11 @@
<properties>
<bundle-symbolic-name>${project.groupId}.openid</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.security.openid.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.security.openid.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>

View File

@ -10,6 +10,7 @@
<description>Jetty OSGi Boot JSP bundle</description>
<properties>
<bundle-symbolic-name>${project.groupId}.boot.jsp</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.osgi.boot.jasper.*,org.eclipse.jetty.osgi.boot.jsp.*</spotbugs.onlyAnalyze>
</properties>
<dependencies>
<dependency>
@ -125,13 +126,6 @@
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.osgi.boot.jasper.*,org.eclipse.jetty.osgi.boot.jsp.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -11,6 +11,7 @@
<description>Jetty OSGi Boot-Warurl bundle</description>
<properties>
<bundle-symbolic-name>${project.groupId}.boot.warurl</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.osgi.boot.warurl.*</spotbugs.onlyAnalyze>
</properties>
<dependencies>
<dependency>
@ -36,13 +37,6 @@
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.osgi.boot.warurl.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -10,6 +10,7 @@
<description>Jetty OSGi Boot bundle</description>
<properties>
<bundle-symbolic-name>${project.groupId}.boot</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.osgi.boot.*</spotbugs.onlyAnalyze>
</properties>
<dependencies>
<dependency>
@ -99,13 +100,6 @@
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.osgi.boot.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -10,6 +10,7 @@
<description>Jetty OSGi HttpService bundle</description>
<properties>
<bundle-symbolic-name>${project.groupId}.httpservice</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.osgi.httpservice.*</spotbugs.onlyAnalyze>
</properties>
<dependencies>
<dependency>
@ -70,13 +71,6 @@
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.osgi.httpservice.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -10,6 +10,7 @@
<description>Jetty JavaEE style services</description>
<properties>
<bundle-symbolic-name>${project.groupId}.plus</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.plus.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
@ -46,13 +47,6 @@
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.plus.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -10,18 +10,8 @@
<description>Jetty Proxy</description>
<properties>
<bundle-symbolic-name>${project.groupId}.proxy</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.proxy.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.proxy.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>

View File

@ -10,18 +10,8 @@
<description>Jetty Rewrite Handler</description>
<properties>
<bundle-symbolic-name>${project.groupId}.rewrite</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.rewrite.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.rewrite.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>

View File

@ -11,6 +11,8 @@
<properties>
<assembly-directory>target/distribution</assembly-directory>
<bundle-symbolic-name>${project.groupId}.runner</bundle-symbolic-name>
<!-- too many external dependencies to fix... :) -->
<spotbugs.skip>true</spotbugs.skip>
</properties>
<build>
@ -61,14 +63,6 @@
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.neo4j.build.plugins</groupId>
<artifactId>clirr-maven-plugin</artifactId>
<configuration>
<!-- Clirr fails with "org.apache.tools.ant.Task not found" on this project -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>

View File

@ -10,16 +10,10 @@
<description>Jetty security infrastructure</description>
<properties>
<bundle-symbolic-name>${project.groupId}.security</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.security.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.security.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>

View File

@ -163,7 +163,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
if (pathSpec == null || "".equals(pathSpec.trim()) || constraintMappings == null || constraintMappings.size() == 0)
return Collections.emptyList();
List<ConstraintMapping> mappings = new ArrayList<ConstraintMapping>();
List<ConstraintMapping> mappings = new ArrayList<>();
for (ConstraintMapping mapping : constraintMappings)
{
if (pathSpec.equals(mapping.getPathSpec()))
@ -187,7 +187,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
if (pathSpec == null || "".equals(pathSpec.trim()) || constraintMappings == null || constraintMappings.size() == 0)
return Collections.emptyList();
List<ConstraintMapping> mappings = new ArrayList<ConstraintMapping>();
List<ConstraintMapping> mappings = new ArrayList<>();
for (ConstraintMapping mapping : constraintMappings)
{
//Remove the matching mappings by only copying in non-matching mappings
@ -209,10 +209,10 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
*/
public static List<ConstraintMapping> createConstraintsWithMappingsForPath(String name, String pathSpec, ServletSecurityElement securityElement)
{
List<ConstraintMapping> mappings = new ArrayList<ConstraintMapping>();
List<ConstraintMapping> mappings = new ArrayList<>();
//Create a constraint that will describe the default case (ie if not overridden by specific HttpMethodConstraints)
Constraint httpConstraint = null;
Constraint httpConstraint;
ConstraintMapping httpConstraintMapping = null;
if (securityElement.getEmptyRoleSemantic() != EmptyRoleSemantic.PERMIT ||
@ -229,7 +229,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
}
//See Spec 13.4.1.2 p127
List<String> methodOmissions = new ArrayList<String>();
List<String> methodOmissions = new ArrayList<>();
//make constraint mappings for this url for each of the HttpMethodConstraintElements
Collection<HttpMethodConstraintElement> methodConstraintElements = securityElement.getHttpMethodConstraints();
@ -254,7 +254,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
//See spec 13.4.1.2 p127 - add an omission for every method name to the default constraint
//UNLESS the default constraint contains all default values. In that case, we won't add it. See Servlet Spec 3.1 pg 129
if (methodOmissions.size() > 0 && httpConstraintMapping != null)
httpConstraintMapping.setMethodOmissions(methodOmissions.toArray(new String[methodOmissions.size()]));
httpConstraintMapping.setMethodOmissions(methodOmissions.toArray(new String[0]));
return mappings;
}
@ -435,9 +435,10 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
protected void processConstraintMapping(ConstraintMapping mapping)
{
Map<String, RoleInfo> mappings = _constraintMap.get(mapping.getPathSpec());
if (mappings == null)
{
mappings = new HashMap<String, RoleInfo>();
mappings = new HashMap<>();
_constraintMap.put(mapping.getPathSpec(), mappings);
}
RoleInfo allMethodsRoleInfo = mappings.get(ALL_METHODS);
@ -588,7 +589,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
if (roleInfo == null)
{
//No specific http-method names matched
List<RoleInfo> applicableConstraints = new ArrayList<RoleInfo>();
List<RoleInfo> applicableConstraints = new ArrayList<>();
//Get info for constraint that matches all methods if it exists
RoleInfo all = mappings.get(ALL_METHODS);
@ -778,11 +779,11 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
if (_denyUncoveredMethods)
return Collections.emptySet();
Set<String> uncoveredPaths = new HashSet<String>();
for (String path : _constraintMap.keySet())
Set<String> uncoveredPaths = new HashSet<>();
for (Entry<String,Map<String, RoleInfo>> entry : _constraintMap.entrySet())
{
Map<String, RoleInfo> methodMappings = _constraintMap.get(path);
Map<String, RoleInfo> methodMappings = entry.getValue();
//Each key is either:
// : an exact method name
// : * which means that the constraint applies to every method
@ -790,7 +791,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
if (methodMappings.get(ALL_METHODS) != null)
continue; //can't be any uncovered methods for this url path
boolean hasOmissions = omissionsExist(path, methodMappings);
boolean hasOmissions = omissionsExist(entry.getKey(), methodMappings);
for (String method : methodMappings.keySet())
{
@ -800,7 +801,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
for (String m : omittedMethods)
{
if (!methodMappings.containsKey(m))
uncoveredPaths.add(path);
uncoveredPaths.add(entry.getKey());
}
}
else
@ -808,7 +809,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
//an exact method name
if (!hasOmissions)
//an http-method does not have http-method-omission to cover the other method names
uncoveredPaths.add(path);
uncoveredPaths.add(entry.getKey());
}
}
}
@ -849,7 +850,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
return Collections.emptySet();
String[] strings = omission.split("\\.");
Set<String> methods = new HashSet<String>();
Set<String> methods = new HashSet<>();
for (int i = 0; i < strings.length - 1; i++)
{
methods.add(strings[i]);

View File

@ -10,6 +10,7 @@
<description>The core jetty server artifact.</description>
<properties>
<bundle-symbolic-name>${project.groupId}.server</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.server.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
@ -25,13 +26,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.server.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -20,7 +20,6 @@ package org.eclipse.jetty.server;
import java.io.Closeable;
import java.io.IOException;
import java.net.BindException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
@ -41,6 +40,7 @@ import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.ManagedSelector;
import org.eclipse.jetty.io.SelectorManager;
import org.eclipse.jetty.io.SocketChannelEndPoint;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.Name;
@ -336,16 +336,16 @@ public class ServerConnector extends AbstractNetworkConnector
if (serverChannel == null)
{
serverChannel = ServerSocketChannel.open();
InetSocketAddress bindAddress = getHost() == null ? new InetSocketAddress(getPort()) : new InetSocketAddress(getHost(), getPort());
serverChannel.socket().setReuseAddress(getReuseAddress());
serverChannel = ServerSocketChannel.open();
try
{
serverChannel.socket().setReuseAddress(getReuseAddress());
serverChannel.socket().bind(bindAddress, getAcceptQueueSize());
}
catch (BindException e)
catch (Throwable e)
{
IO.close(serverChannel);
throw new IOException("Failed to bind to " + bindAddress, e);
}
}

View File

@ -271,8 +271,16 @@ public class ShutdownMonitor
try
{
ServerSocket serverSocket = new ServerSocket();
serverSocket.setReuseAddress(true);
serverSocket.bind(new InetSocketAddress(InetAddress.getByName(host), port));
try
{
serverSocket.setReuseAddress(true);
serverSocket.bind(new InetSocketAddress(InetAddress.getByName(host), port));
}
catch (Throwable e)
{
IO.close(serverSocket);
throw e;
}
if (port == 0)
{
port = serverSocket.getLocalPort();

View File

@ -11,6 +11,7 @@
<description>Jetty Servlet Container</description>
<properties>
<bundle-symbolic-name>${project.groupId}.servlet</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
@ -26,13 +27,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.servlet.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -11,18 +11,8 @@
<description>Utility Servlets from Jetty</description>
<properties>
<bundle-symbolic-name>${project.groupId}.servlets</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.servlets.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.servlets.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>

View File

@ -10,6 +10,7 @@
<description>The start utility</description>
<properties>
<bundle-symbolic-name>${project.groupId}.start</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.start.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
@ -23,13 +24,6 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.start.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>

View File

@ -71,13 +71,10 @@ public class Licensing
System.err.printf(" + contains software not covered by the Eclipse Public License!%n");
System.err.printf(" + has not been audited for compliance with its license%n");
for (String key : licenseMap.keySet())
for (Map.Entry<String, List<String>> entry : licenseMap.entrySet())
{
System.err.printf("%n Module: %s%n", key);
for (String line : licenseMap.get(key))
{
System.err.printf(" + %s%n", line);
}
System.err.printf("%n Module: %s%n", entry.getKey());
entry.getValue().forEach(line -> System.err.printf(" + %s%n", line));
}
boolean licenseAck = false;

View File

@ -10,6 +10,7 @@
<description>Jetty UnixSocket</description>
<properties>
<bundle-symbolic-name>${project.groupId}.unixsocket</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.unixsocket.*</spotbugs.onlyAnalyze>
</properties>
<dependencies>
<dependency>
@ -41,13 +42,6 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.unixsocket.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>

View File

@ -10,18 +10,8 @@
<description>JSON/Ajax Utility classes for Jetty</description>
<properties>
<bundle-symbolic-name>${project.groupId}.util.ajax</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.util.ajax.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.util.ajax.*</onlyAnalyze>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>

View File

@ -10,6 +10,7 @@
<description>Utility classes for Jetty</description>
<properties>
<bundle-symbolic-name>${project.groupId}.util</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.util.*</spotbugs.onlyAnalyze>
</properties>
<build>
<resources>
@ -19,13 +20,6 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.util.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>

View File

@ -181,8 +181,8 @@ public class Scanner extends AbstractLifeCycle
if (rootIncludesExcludes != null && !rootIncludesExcludes.isEmpty())
{
//accepted if not explicitly excluded and either is explicitly included or there are no explicit inclusions
Boolean result = rootIncludesExcludes.test(dir);
if (Boolean.TRUE == result)
boolean result = rootIncludesExcludes.test(dir);
if (result)
accepted = true;
}
else
@ -215,8 +215,8 @@ public class Scanner extends AbstractLifeCycle
if (rootIncludesExcludes != null && !rootIncludesExcludes.isEmpty())
{
//accepted if not explicitly excluded and either is explicitly included or there are no explicit inclusions
Boolean result = rootIncludesExcludes.test(file);
if (Boolean.TRUE == result)
boolean result = rootIncludesExcludes.test(file);
if (result)
accepted = true;
}
else if (_filter == null || _filter.accept(f.getParentFile(), f.getName()))
@ -663,11 +663,12 @@ public class Scanner extends AbstractLifeCycle
public synchronized void scanFiles()
{
_currentScan.clear();
for (Path p : _scannables.keySet())
for (Entry<Path, IncludeExcludeSet<PathMatcher, Path>> entry : _scannables.entrySet())
{
Path p = entry.getKey();
try
{
Files.walkFileTree(p, EnumSet.allOf(FileVisitOption.class),_scanDepth, new Visitor(p, _scannables.get(p), _currentScan));
Files.walkFileTree(p, EnumSet.allOf(FileVisitOption.class),_scanDepth, new Visitor(p, entry.getValue(), _currentScan));
}
catch (IOException e)
{

View File

@ -10,6 +10,7 @@
<description>Jetty web application support</description>
<properties>
<bundle-symbolic-name>${project.groupId}.webapp</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.webapp.*</spotbugs.onlyAnalyze>
</properties>
<build>
<resources>
@ -26,13 +27,6 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.webapp.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>

View File

@ -71,16 +71,9 @@ public class FragmentConfiguration extends AbstractConfiguration
Map<Resource, Resource> frags = (Map<Resource, Resource>)context.getAttribute(FRAGMENT_RESOURCES);
if (frags != null)
{
for (Resource key : frags.keySet())
for (Map.Entry<Resource, Resource> entry : frags.entrySet())
{
if (key.isDirectory()) //tolerate the case where the library is a directory, not a jar. useful for OSGi for example
{
metaData.addFragment(key, frags.get(key));
}
else //the standard case: a jar most likely inside WEB-INF/lib
{
metaData.addFragment(key, frags.get(key));
}
metaData.addFragment(entry.getKey(), entry.getValue());
}
}
}

View File

@ -44,20 +44,20 @@ public class MetaData
public static final String ORDERED_LIBS = "javax.servlet.context.orderedLibs";
public static final Resource NON_FRAG_RESOURCE = EmptyResource.INSTANCE;
protected Map<String, OriginInfo> _origins = new HashMap<String, OriginInfo>();
protected Map<String, OriginInfo> _origins = new HashMap<>();
protected WebDescriptor _webDefaultsRoot;
protected WebDescriptor _webXmlRoot;
protected final List<WebDescriptor> _webOverrideRoots = new ArrayList<WebDescriptor>();
protected final List<WebDescriptor> _webOverrideRoots = new ArrayList<>();
protected boolean _metaDataComplete;
protected final List<DescriptorProcessor> _descriptorProcessors = new ArrayList<DescriptorProcessor>();
protected final List<FragmentDescriptor> _webFragmentRoots = new ArrayList<FragmentDescriptor>();
protected final Map<String, FragmentDescriptor> _webFragmentNameMap = new HashMap<String, FragmentDescriptor>();
protected final Map<Resource, FragmentDescriptor> _webFragmentResourceMap = new HashMap<Resource, FragmentDescriptor>();
protected final Map<Resource, List<DiscoveredAnnotation>> _annotations = new HashMap<Resource, List<DiscoveredAnnotation>>();
protected final List<Resource> _webInfClasses = new ArrayList<Resource>();
protected final List<Resource> _webInfJars = new ArrayList<Resource>();
protected final List<Resource> _orderedContainerResources = new ArrayList<Resource>();
protected final List<Resource> _orderedWebInfResources = new ArrayList<Resource>();
protected final List<DescriptorProcessor> _descriptorProcessors = new ArrayList<>();
protected final List<FragmentDescriptor> _webFragmentRoots = new ArrayList<>();
protected final Map<String, FragmentDescriptor> _webFragmentNameMap = new HashMap<>();
protected final Map<Resource, FragmentDescriptor> _webFragmentResourceMap = new HashMap<>();
protected final Map<Resource, List<DiscoveredAnnotation>> _annotations = new HashMap<>();
protected final List<Resource> _webInfClasses = new ArrayList<>();
protected final List<Resource> _webInfJars = new ArrayList<>();
protected final List<Resource> _orderedContainerResources = new ArrayList<>();
protected final List<Resource> _orderedWebInfResources = new ArrayList<>();
protected Ordering _ordering;//can be set to RelativeOrdering by web-default.xml, web.xml, web-override.xml
protected boolean _allowDuplicateFragmentNames = false;
protected boolean _validateXml = false;
@ -333,12 +333,8 @@ public class MetaData
if (resource == null || !_webInfJars.contains(resource))
resource = EmptyResource.INSTANCE;
List<DiscoveredAnnotation> list = _annotations.get(resource);
if (list == null)
{
list = new ArrayList<DiscoveredAnnotation>();
_annotations.put(resource, list);
}
List<DiscoveredAnnotation> list =
_annotations.computeIfAbsent(resource, k -> new ArrayList<>());
list.add(annotation);
}
@ -378,7 +374,7 @@ public class MetaData
if (getOrdering() != null)
{
orderedWebInfJars = getOrderedWebInfJars();
List<String> orderedLibs = new ArrayList<String>();
List<String> orderedLibs = new ArrayList<>();
for (Resource webInfJar : orderedWebInfJars)
{
//get just the name of the jar file
@ -545,10 +541,10 @@ public class MetaData
return null;
Resource jar = null;
for (Resource r : _webFragmentResourceMap.keySet())
for (Map.Entry<Resource, FragmentDescriptor> entry : _webFragmentResourceMap.entrySet())
{
if (_webFragmentResourceMap.get(r).equals(f))
jar = r;
if (entry.getValue().equals(f))
jar = entry.getKey();
}
return jar;
}

View File

@ -21,15 +21,11 @@
<module>javax-websocket-client-impl</module>
<module>javax-websocket-server-impl</module>
</modules>
<properties>
<spotbugs.onlyAnalyze>org.eclipse.jetty.websocket.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.websocket.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>

View File

@ -10,16 +10,10 @@
<description>The jetty xml utilities.</description>
<properties>
<bundle-symbolic-name>${project.groupId}.xml</bundle-symbolic-name>
<spotbugs.onlyAnalyze>org.eclipse.jetty.xml.*</spotbugs.onlyAnalyze>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<onlyAnalyze>org.eclipse.jetty.xml.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>

View File

@ -59,7 +59,7 @@ public class XmlAppendable
{
_out = out;
_indent = indent;
_out.append("<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>\n");
_out.append("<?xml version=\"1.0\" encoding=\"").append(encoding).append("\"?>\n");
}
public XmlAppendable openTag(String tag, Map<String, String> attributes) throws IOException
@ -153,11 +153,10 @@ public class XmlAppendable
private void attributes(Map<String, String> attributes) throws IOException
{
for (String k : attributes.keySet())
for (Map.Entry<String, String> entry : attributes.entrySet())
{
String v = attributes.get(k);
_out.append(' ').append(k).append("=\"");
content(v);
_out.append(' ').append(entry.getKey()).append("=\"");
content(entry.getValue());
_out.append('"');
}
}

View File

@ -1884,10 +1884,9 @@ public class XmlConfiguration
if (properties.size() > 0)
{
Map<String, String> props = new HashMap<>();
for (Object key : properties.keySet())
{
props.put(key.toString(), String.valueOf(properties.get(key)));
}
properties.entrySet().stream()
.forEach(objectObjectEntry -> props.put(objectObjectEntry.getKey().toString(),
String.valueOf(objectObjectEntry.getValue())));
configuration.getProperties().putAll(props);
}

116
pom.xml
View File

@ -58,6 +58,8 @@
<maven.install.plugin.version>3.0.0-M1</maven.install.plugin.version>
<maven.deploy.plugin.version>3.0.0-M1</maven.deploy.plugin.version>
<pmd.verbose>true</pmd.verbose>
<!-- testing -->
<it.debug>false</it.debug>
<jetty.test.version>5.5</jetty.test.version>
@ -262,7 +264,8 @@
<goal>check</goal>
</goals>
<configuration>
<verbose>true</verbose>
<verbose>${pmd.verbose}</verbose>
<printFailingErrors>${pmd.verbose}</printFailingErrors>
</configuration>
</execution>
</executions>
@ -785,27 +788,11 @@
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5</version>
<configuration>
<findbugsXmlOutput>true</findbugsXmlOutput>
<xmlOutput>true</xmlOutput>
<effort>Max</effort>
<onlyAnalyze>org.eclipse.jetty.*</onlyAnalyze>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
@ -978,7 +965,7 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>h2spec-maven-plugin</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</plugin>
</plugins>
</pluginManagement>
@ -1213,27 +1200,18 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<showWarnings>true</showWarnings>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<compilerArgs>
<arg>-XepAllErrorsAsWarnings</arg>
<arg>-Xep:OperatorPrecedence:OFF</arg>
<compilerArgs combine.children="append">
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne -XepAllErrorsAsWarnings</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.4.0</version>
</path>
</annotationProcessorPaths>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.8.8</version>
</dependency>
<!-- override plexus-compiler-javac-errorprone's dependency on
Error Prone with the latest version -->
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.4.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
@ -1280,34 +1258,6 @@
</plugins>
</build>
</profile>
<profile>
<id>jdk8</id>
<activation>
<jdk>[1.8,1.9)</jdk>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
<version>2.8</version>
<configuration>
<htmlOutputFile>clirr-report.html</htmlOutputFile>
<xmlOutputFile>${project.build.directory}/clirr-report.xml</xmlOutputFile>
<failOnError>true</failOnError>
<failOnWarning>true</failOnWarning>
<failOnInfo>false</failOnInfo>
<logResults>true</logResults>
<minSeverity>info</minSeverity>
<comparisonVersion>9.4.6.v20170531</comparisonVersion>
<ignoreMaintenenceVersions>false</ignoreMaintenenceVersions>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>jdk11</id>
<activation>
@ -1426,6 +1376,14 @@
<properties>
<settingsPath>${env.GLOBAL_MVN_SETTINGS}</settingsPath>
<surefire.rerunFailingTestsCount>3</surefire.rerunFailingTestsCount>
<spotbugs.failOnError>false</spotbugs.failOnError>
<!-- Defines a SpotBugs threshold. Use "Low" to discover low-priority bugs -->
<spotbugs.threshold>Medium</spotbugs.threshold>
<!-- Defines a SpotBugs effort. Use "Max" to maximize the scan depth -->
<spotbugs.effort>Default</spotbugs.effort>
<spotbugs.skip>false</spotbugs.skip>
<spotbugs.onlyAnalyze>org.eclipse.jetty.*</spotbugs.onlyAnalyze>
<pmd.verbose>false</pmd.verbose>
</properties>
<modules>
<module>aggregates/jetty-all</module>
@ -1433,6 +1391,11 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.1.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@ -1443,6 +1406,29 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<executions>
<execution>
<id>spotbugs</id>
<goals>
<goal>check</goal>
</goals>
<phase>verify</phase>
<configuration>
<skip>${spotbugs.skip}</skip>
<failOnError>${spotbugs.failOnError}</failOnError>
<xmlOutput>true</xmlOutput>
<spotbugsXmlOutput>false</spotbugsXmlOutput>
<effort>${spotbugs.effort}</effort>
<threshold>${spotbugs.threshold}</threshold>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>

View File

@ -11,6 +11,9 @@
<artifactId>tests-parent</artifactId>
<name>Jetty Tests :: Parent</name>
<packaging>pom</packaging>
<properties>
<spotbugs.skip>true</spotbugs.skip>
</properties>
<build>
<pluginManagement>
<plugins>
@ -38,22 +41,6 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<!-- No Point running Findbugs on testing projects -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
<configuration>
<!-- No point running clirr on test projects -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>