Polish
This commit is contained in:
committed by
Andy Wilkinson
parent
bcbf7b5511
commit
bfa291f671
@@ -76,7 +76,7 @@ public class JavaCompilerFieldValuesParser implements FieldValuesParser {
|
||||
WRAPPER_TYPES = Collections.unmodifiableMap(types);
|
||||
}
|
||||
|
||||
private static final Map<Class<?>, Object> DEFAULT_TYPE_VALUES;
|
||||
private static final Map<Class<?>, Object> defaultTypeValues;
|
||||
|
||||
static {
|
||||
Map<Class<?>, Object> values = new HashMap<Class<?>, Object>();
|
||||
@@ -85,16 +85,16 @@ public class JavaCompilerFieldValuesParser implements FieldValuesParser {
|
||||
values.put(Short.class, (short) 0);
|
||||
values.put(Integer.class, 0);
|
||||
values.put(Long.class, (long) 0);
|
||||
DEFAULT_TYPE_VALUES = Collections.unmodifiableMap(values);
|
||||
defaultTypeValues = Collections.unmodifiableMap(values);
|
||||
}
|
||||
|
||||
private static final Map<String, Object> WELL_KNOWN_STATIC_FINALS;
|
||||
private static final Map<String, Object> wellKnownStaticFinals;
|
||||
|
||||
static {
|
||||
Map<String, Object> values = new HashMap<String, Object>();
|
||||
values.put("Boolean.TRUE", true);
|
||||
values.put("Boolean.FALSE", false);
|
||||
WELL_KNOWN_STATIC_FINALS = Collections.unmodifiableMap(values);
|
||||
wellKnownStaticFinals = Collections.unmodifiableMap(values);
|
||||
}
|
||||
|
||||
private final Map<String, Object> fieldValues = new HashMap<String, Object>();
|
||||
@@ -115,7 +115,7 @@ public class JavaCompilerFieldValuesParser implements FieldValuesParser {
|
||||
private Object getValue(VariableTree variable) throws Exception {
|
||||
ExpressionTree initializer = variable.getInitializer();
|
||||
Class<?> wrapperType = WRAPPER_TYPES.get(variable.getType());
|
||||
Object defaultValue = DEFAULT_TYPE_VALUES.get(wrapperType);
|
||||
Object defaultValue = defaultTypeValues.get(wrapperType);
|
||||
if (initializer != null) {
|
||||
return getValue(initializer, defaultValue);
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public class JavaCompilerFieldValuesParser implements FieldValuesParser {
|
||||
return this.staticFinals.get(expression.toString());
|
||||
}
|
||||
if (expression.getKind().equals("MEMBER_SELECT")) {
|
||||
return WELL_KNOWN_STATIC_FINALS.get(expression.toString());
|
||||
return wellKnownStaticFinals.get(expression.toString());
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public final class Layouts {
|
||||
*/
|
||||
public static class War implements Layout {
|
||||
|
||||
private static final Map<LibraryScope, String> SCOPE_DESTINATIONS;
|
||||
private static final Map<LibraryScope, String> scopeDestinations;
|
||||
|
||||
static {
|
||||
Map<LibraryScope, String> map = new HashMap<LibraryScope, String>();
|
||||
@@ -131,7 +131,7 @@ public final class Layouts {
|
||||
map.put(LibraryScope.CUSTOM, "WEB-INF/lib/");
|
||||
map.put(LibraryScope.RUNTIME, "WEB-INF/lib/");
|
||||
map.put(LibraryScope.PROVIDED, "WEB-INF/lib-provided/");
|
||||
SCOPE_DESTINATIONS = Collections.unmodifiableMap(map);
|
||||
scopeDestinations = Collections.unmodifiableMap(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -141,7 +141,7 @@ public final class Layouts {
|
||||
|
||||
@Override
|
||||
public String getLibraryDestination(String libraryName, LibraryScope scope) {
|
||||
return SCOPE_DESTINATIONS.get(scope);
|
||||
return scopeDestinations.get(scope);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 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.
|
||||
@@ -42,15 +42,15 @@ import org.springframework.boot.loader.tools.LibraryScope;
|
||||
*/
|
||||
public class ArtifactsLibraries implements Libraries {
|
||||
|
||||
private static final Map<String, LibraryScope> SCOPES;
|
||||
private static final Map<String, LibraryScope> scopes;
|
||||
|
||||
static {
|
||||
Map<String, LibraryScope> scopes = new HashMap<String, LibraryScope>();
|
||||
scopes.put(Artifact.SCOPE_COMPILE, LibraryScope.COMPILE);
|
||||
scopes.put(Artifact.SCOPE_RUNTIME, LibraryScope.RUNTIME);
|
||||
scopes.put(Artifact.SCOPE_PROVIDED, LibraryScope.PROVIDED);
|
||||
scopes.put(Artifact.SCOPE_SYSTEM, LibraryScope.PROVIDED);
|
||||
SCOPES = Collections.unmodifiableMap(scopes);
|
||||
Map<String, LibraryScope> libraryScopes = new HashMap<String, LibraryScope>();
|
||||
libraryScopes.put(Artifact.SCOPE_COMPILE, LibraryScope.COMPILE);
|
||||
libraryScopes.put(Artifact.SCOPE_RUNTIME, LibraryScope.RUNTIME);
|
||||
libraryScopes.put(Artifact.SCOPE_PROVIDED, LibraryScope.PROVIDED);
|
||||
libraryScopes.put(Artifact.SCOPE_SYSTEM, LibraryScope.PROVIDED);
|
||||
scopes = Collections.unmodifiableMap(libraryScopes);
|
||||
}
|
||||
|
||||
private final Set<Artifact> artifacts;
|
||||
@@ -70,7 +70,7 @@ public class ArtifactsLibraries implements Libraries {
|
||||
public void doWithLibraries(LibraryCallback callback) throws IOException {
|
||||
Set<String> duplicates = getDuplicates(this.artifacts);
|
||||
for (Artifact artifact : this.artifacts) {
|
||||
LibraryScope scope = SCOPES.get(artifact.getScope());
|
||||
LibraryScope scope = scopes.get(artifact.getScope());
|
||||
if (scope != null && artifact.getFile() != null) {
|
||||
String name = getFileName(artifact);
|
||||
if (duplicates.contains(name)) {
|
||||
|
||||
Reference in New Issue
Block a user