This commit is contained in:
Phillip Webb
2018-02-26 10:23:23 -08:00
parent 306c79f0de
commit 29c3be3590
27 changed files with 69 additions and 67 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.
@@ -95,13 +95,13 @@ public class MetadataStore {
}
private FileObject getMetadataResource() throws IOException {
return this.environment.getFiler()
.getResource(StandardLocation.CLASS_OUTPUT, "", METADATA_PATH);
return this.environment.getFiler().getResource(StandardLocation.CLASS_OUTPUT, "",
METADATA_PATH);
}
private FileObject createMetadataResource() throws IOException {
return this.environment.getFiler()
.createResource(StandardLocation.CLASS_OUTPUT, "", METADATA_PATH);
return this.environment.getFiler().createResource(StandardLocation.CLASS_OUTPUT,
"", METADATA_PATH);
}
private InputStream getAdditionalMetadataStream() throws IOException {

View File

@@ -140,9 +140,8 @@ final class JavaPluginAction implements PluginApplicationAction {
}
private void configureAdditionalMetadataLocations(Project project) {
project.afterEvaluate((evaluated) ->
evaluated.getTasks().withType(JavaCompile.class,
this::configureAdditionalMetadataLocations));
project.afterEvaluate((evaluated) -> evaluated.getTasks()
.withType(JavaCompile.class, this::configureAdditionalMetadataLocations));
}
private void configureAdditionalMetadataLocations(JavaCompile compile) {

View File

@@ -247,8 +247,8 @@ public class JarWriter implements LoaderClassesWriter, AutoCloseable {
}
/**
* Perform the actual write of a {@link JarEntry}. All other write methods
* delegate to this one.
* Perform the actual write of a {@link JarEntry}. All other write methods delegate to
* this one.
* @param entry the entry to write
* @param entryWriter the entry writer or {@code null} if there is no content
* @param unpackHandler handles possible unpacking for the entry

View File

@@ -208,8 +208,7 @@ public class RepackagerTests {
repackager.setLayout(new Layouts.None());
repackager.repackage(file, NO_LIBRARIES);
Manifest actualManifest = getManifest(file);
assertThat(actualManifest.getMainAttributes().getValue("Main-Class"))
.isNull();
assertThat(actualManifest.getMainAttributes().getValue("Main-Class")).isNull();
assertThat(hasLauncherClasses(file)).isFalse();
}

View File

@@ -108,7 +108,7 @@ public class JarFile extends java.util.jar.JarFile {
private JarFile(RandomAccessDataFile rootFile, String pathFromRoot,
RandomAccessData data, JarEntryFilter filter, JarFileType type)
throws IOException {
throws IOException {
super(rootFile.getFile());
this.rootFile = rootFile;
this.pathFromRoot = pathFromRoot;

View File

@@ -185,12 +185,13 @@ public abstract class SystemPropertyUtils {
}
if (propVal == null) {
// Try with underscores.
propVal = System.getenv(key.replace('.', '_'));
String name = key.replace('.', '_');
propVal = System.getenv(name);
}
if (propVal == null) {
// Try uppercase with underscores as well.
propVal = System.getenv(key.toUpperCase(Locale.ENGLISH)
.replace('.', '_'));
String name = key.toUpperCase(Locale.ENGLISH).replace('.', '_');
propVal = System.getenv(name);
}
if (propVal != null) {
return propVal;