Consistent formatting

This commit is contained in:
Juergen Hoeller
2016-03-24 19:54:28 +01:00
parent 2ea7fcde3e
commit 0891fbaf97
14 changed files with 40 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 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.
@@ -204,7 +204,7 @@ public class FieldRetrievingFactoryBean
// instance field
return this.fieldObject.get(this.targetObject);
}
else{
else {
// class field
return this.fieldObject.get(null);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 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.
@@ -36,20 +36,21 @@ import org.springframework.beans.factory.parsing.ReaderEventListener;
*/
public class CollectingReaderEventListener implements ReaderEventListener {
private final List defaults = new LinkedList();
private final List<DefaultsDefinition> defaults = new LinkedList<>();
private final Map componentDefinitions = new LinkedHashMap<>(8);
private final Map<String, ComponentDefinition> componentDefinitions = new LinkedHashMap<>(8);
private final Map aliasMap = new LinkedHashMap<>(8);
private final Map<String, List<AliasDefinition>> aliasMap = new LinkedHashMap<>(8);
private final List<ImportDefinition> imports = new LinkedList<>();
private final List imports = new LinkedList();
@Override
public void defaultsRegistered(DefaultsDefinition defaultsDefinition) {
this.defaults.add(defaultsDefinition);
}
public List getDefaults() {
public List<DefaultsDefinition> getDefaults() {
return Collections.unmodifiableList(this.defaults);
}
@@ -59,27 +60,27 @@ public class CollectingReaderEventListener implements ReaderEventListener {
}
public ComponentDefinition getComponentDefinition(String name) {
return (ComponentDefinition) this.componentDefinitions.get(name);
return this.componentDefinitions.get(name);
}
public ComponentDefinition[] getComponentDefinitions() {
Collection collection = this.componentDefinitions.values();
return (ComponentDefinition[]) collection.toArray(new ComponentDefinition[collection.size()]);
Collection<ComponentDefinition> collection = this.componentDefinitions.values();
return collection.toArray(new ComponentDefinition[collection.size()]);
}
@Override
public void aliasRegistered(AliasDefinition aliasDefinition) {
List aliases = (List) this.aliasMap.get(aliasDefinition.getBeanName());
if(aliases == null) {
aliases = new ArrayList();
List<AliasDefinition> aliases = this.aliasMap.get(aliasDefinition.getBeanName());
if (aliases == null) {
aliases = new ArrayList<>();
this.aliasMap.put(aliasDefinition.getBeanName(), aliases);
}
aliases.add(aliasDefinition);
}
public List getAliases(String beanName) {
List aliases = (List) this.aliasMap.get(beanName);
return aliases == null ? null : Collections.unmodifiableList(aliases);
public List<AliasDefinition> getAliases(String beanName) {
List<AliasDefinition> aliases = this.aliasMap.get(beanName);
return (aliases != null ? Collections.unmodifiableList(aliases) : null);
}
@Override
@@ -87,7 +88,7 @@ public class CollectingReaderEventListener implements ReaderEventListener {
this.imports.add(importDefinition);
}
public List getImports() {
public List<ImportDefinition> getImports() {
return Collections.unmodifiableList(this.imports);
}