Polish
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user