Upgrade to spring-javaformat 0.0.6

This commit is contained in:
Phillip Webb
2018-08-28 15:22:36 -07:00
parent 17de1571f5
commit 9543fcf44d
290 changed files with 1021 additions and 1014 deletions

View File

@@ -95,7 +95,7 @@ public class DefaultLaunchScript implements LaunchScript {
value = (String) properties.get(name);
}
else {
value = (value != null ? value.substring(1) : matcher.group(0));
value = (value != null) ? value.substring(1) : matcher.group(0);
}
matcher.appendReplacement(expanded, value.replace("$", "\\$"));
}

View File

@@ -157,8 +157,8 @@ public class JarWriter implements LoaderClassesWriter {
/**
* 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
@@ -340,7 +340,7 @@ public class JarWriter implements LoaderClassesWriter {
@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) {
@@ -358,8 +358,8 @@ public class JarWriter implements LoaderClassesWriter {
@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

@@ -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

@@ -312,7 +312,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<JarEntry>();
while (sourceEntries.hasMoreElements()) {
@@ -448,16 +448,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) {
@@ -476,6 +466,16 @@ public abstract class MainClassFinder {
return true;
}
@Override
public int hashCode() {
return this.name.hashCode();
}
@Override
public String toString() {
return this.name;
}
}
/**