Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
OLPMO authored and snicoll committed Aug 28, 2019
1 parent 2726540 commit 7ee3656
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ AutoConfigurationClass get(String className) {
}

Set<String> getClassesRequestedAfter(String className) {
Set<String> classesRequestedAfter = new LinkedHashSet<>();
classesRequestedAfter.addAll(get(className).getAfter());
Set<String> setOfClassesRequestedAfter = get(className).getAfter();
Set<String> classesRequestedAfter = new LinkedHashSet<>(setOfClassesRequestedAfter);
this.classes.forEach((name, autoConfigurationClass) -> {
if (autoConfigurationClass.getBefore().contains(className)) {
classesRequestedAfter.add(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec

@Override
public Set<Object> determineImports(AnnotationMetadata metadata) {
Set<String> result = new LinkedHashSet<>();
result.addAll(getCandidateConfigurations(metadata, null));
List<String> candidateConfigurations = getCandidateConfigurations(metadata, null);
Set<String> result = new LinkedHashSet<>(candidateConfigurations);
result.removeAll(getExclusions(metadata, null));
return Collections.unmodifiableSet(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,7 @@ private static Set<String> addAll(Set<String> result, String[] additional) {
return result;
}
result = (result != null) ? result : new LinkedHashSet<>();
for (String addition : additional) {
result.add(addition);
}
Collections.addAll(result, additional);
return result;
}

Expand Down Expand Up @@ -454,9 +452,7 @@ else if (value instanceof String) {
}

private void merge(Set<String> result, String... additional) {
for (String addition : additional) {
result.add(addition);
}
Collections.addAll(result, additional);
}

private Set<Class<?>> resolveWhenPossible(Set<String> classNames) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ private boolean isUsingGroovyAllJar() {
try {
ProtectionDomain domain = MarkupTemplateEngine.class.getProtectionDomain();
CodeSource codeSource = domain.getCodeSource();
if (codeSource != null && codeSource.getLocation().toString().contains("-all")) {
return true;
}
return false;
return codeSource != null && codeSource.getLocation().toString().contains("-all");
}
catch (Exception ex) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.springframework.boot.autoconfigure.jmx;

import java.util.Hashtable;
import java.util.Map;

import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
Expand Down Expand Up @@ -57,8 +58,8 @@ public void setEnsureUniqueRuntimeObjectNames(boolean ensureUniqueRuntimeObjectN
@Override
public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException {
ObjectName name = super.getObjectName(managedBean, beanKey);
Hashtable<String, String> properties = new Hashtable<>();
properties.putAll(name.getKeyPropertyList());
Map<String, String> keyPropertyList = name.getKeyPropertyList();
Hashtable<String, String> properties = new Hashtable<>(keyPropertyList);
if (this.ensureUniqueRuntimeObjectNames) {
properties.put("identity", ObjectUtils.getIdentityHexString(managedBean));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ private boolean isInitializingDatabase(DataSource dataSource) {
: "none");
Map<String, Object> hibernate = this.hibernateProperties.determineHibernateProperties(
this.jpaProperties.getProperties(), new HibernateSettings().ddlAuto(defaultDdlAuto));
if (hibernate.containsKey("hibernate.hbm2ddl.auto")) {
return true;
}
return false;
return hibernate.containsKey("hibernate.hbm2ddl.auto");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Properties;
Expand Down Expand Up @@ -192,9 +193,7 @@ private String merge(Class<?>[] value, String[] name) {
for (Class<?> type : value) {
items.add(type.getName());
}
for (String type : name) {
items.add(type);
}
Collections.addAll(items, name);
return StringUtils.collectionToCommaDelimitedString(items);
}

Expand Down

0 comments on commit 7ee3656

Please sign in to comment.