Merge branch '2.0.x'

This commit is contained in:
Phillip Webb
2018-07-28 01:35:43 +01:00
360 changed files with 1434 additions and 1439 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.
@@ -109,8 +109,8 @@ public class DefaultLaunchScript implements LaunchScript {
}
}
else {
value = (defaultValue != null ? defaultValue.substring(1)
: matcher.group(0));
value = (defaultValue != null) ? defaultValue.substring(1)
: matcher.group(0);
}
matcher.appendReplacement(expanded, value.replace("$", "\\$"));
}

View File

@@ -160,8 +160,8 @@ public class JarWriter implements LoaderClassesWriter, AutoCloseable {
/**
* Writes an entry. The {@code inputStream} is closed once the entry has been written
* @param entryName The name of the entry
* @param inputStream The stream from which the entry's data can be read
* @param entryName the name of the entry
* @param inputStream the stream from which the entry's data can be read
* @throws IOException if the write fails
*/
@Override
@@ -363,7 +363,7 @@ public class JarWriter implements LoaderClassesWriter, AutoCloseable {
@Override
public int read() throws IOException {
int read = (this.headerStream != null ? this.headerStream.read() : -1);
int read = (this.headerStream != null) ? this.headerStream.read() : -1;
if (read != -1) {
this.position++;
if (this.position >= this.headerLength) {
@@ -381,8 +381,8 @@ public class JarWriter implements LoaderClassesWriter, AutoCloseable {
@Override
public int read(byte[] b, int off, int len) throws IOException {
int read = (this.headerStream != null ? this.headerStream.read(b, off, len)
: -1);
int read = (this.headerStream != null) ? this.headerStream.read(b, off, len)
: -1;
if (read <= 0) {
return readRemainder(b, off, len);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.
@@ -63,7 +63,7 @@ public class Library {
* @param unpackRequired if the library needs to be unpacked before it can be used
*/
public Library(String name, File file, LibraryScope scope, boolean unpackRequired) {
this.name = (name != null ? name : file.getName());
this.name = (name != null) ? name : file.getName();
this.file = file;
this.scope = scope;
this.unpackRequired = unpackRequired;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.
@@ -248,7 +248,7 @@ public abstract class MainClassFinder {
private static List<JarEntry> getClassEntries(JarFile source,
String classesLocation) {
classesLocation = (classesLocation != null ? classesLocation : "");
classesLocation = (classesLocation != null) ? classesLocation : "";
Enumeration<JarEntry> sourceEntries = source.entries();
List<JarEntry> classEntries = new ArrayList<>();
while (sourceEntries.hasMoreElements()) {
@@ -384,16 +384,6 @@ public abstract class MainClassFinder {
return this.annotationNames;
}
@Override
public String toString() {
return this.name;
}
@Override
public int hashCode() {
return this.name.hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
@@ -412,6 +402,16 @@ public abstract class MainClassFinder {
return true;
}
@Override
public int hashCode() {
return this.name.hashCode();
}
@Override
public String toString() {
return this.name;
}
}
/**