Merge pull request #8526 from izeye:polish-20170307

* pr/8526:
  Polish
pull/8536/head
Stephane Nicoll 8 years ago
commit 407894e1df

@ -127,7 +127,7 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
* the case of {@link FactoryBean FactoryBeans}. Will include singletons but will not * the case of {@link FactoryBean FactoryBeans}. Will include singletons but will not
* cause early bean initialization. * cause early bean initialization.
* @param annotation the annotation to match (must not be {@code null}) * @param annotation the annotation to match (must not be {@code null})
* @return the names of beans (or objects created by FactoryBeans) annoated with the * @return the names of beans (or objects created by FactoryBeans) annotated with the
* given annotation, or an empty set if none * given annotation, or an empty set if none
*/ */
Set<String> getNamesForAnnotation(Class<? extends Annotation> annotation) { Set<String> getNamesForAnnotation(Class<? extends Annotation> annotation) {
@ -188,8 +188,8 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
} }
private void logIgnoredError(String message, String name, Exception ex) { private void logIgnoredError(String message, String name, Exception ex) {
if (BeanTypeRegistry.logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
BeanTypeRegistry.logger.debug("Ignoring " + message + " '" + name + "'", ex); logger.debug("Ignoring " + message + " '" + name + "'", ex);
} }
} }

@ -61,7 +61,7 @@ class OriginTrackedPropertiesLoader {
/** /**
* Load {@code .properties} data and return a map of {@code String} -> * Load {@code .properties} data and return a map of {@code String} ->
* {@link OriginTrackedValue}. * {@link OriginTrackedValue}.
* @param expandLists if list {@code name[]=a,b,c} shorcuts should be expanded * @param expandLists if list {@code name[]=a,b,c} shortcuts should be expanded
* @return the loaded properties * @return the loaded properties
* @throws IOException on read error * @throws IOException on read error
*/ */
@ -104,7 +104,7 @@ class OriginTrackedPropertiesLoader {
buffer.setLength(0); buffer.setLength(0);
boolean previousWhitespace = false; boolean previousWhitespace = false;
while (!reader.isEndOfLine()) { while (!reader.isEndOfLine()) {
if (reader.isPropertyDelimeter()) { if (reader.isPropertyDelimiter()) {
reader.read(); reader.read();
return buffer.toString(); return buffer.toString();
} }
@ -125,7 +125,7 @@ class OriginTrackedPropertiesLoader {
reader.read(); reader.read();
} }
Location location = reader.getLocation(); Location location = reader.getLocation();
while (!reader.isEndOfLine() && !(splitLists && reader.isListDelimeter())) { while (!reader.isEndOfLine() && !(splitLists && reader.isListDelimiter())) {
buffer.append(reader.getCharacter()); buffer.append(reader.getCharacter());
reader.read(); reader.read();
} }
@ -241,11 +241,11 @@ class OriginTrackedPropertiesLoader {
return this.character == -1 || (!this.escaped && this.character == '\n'); return this.character == -1 || (!this.escaped && this.character == '\n');
} }
public boolean isListDelimeter() { public boolean isListDelimiter() {
return !this.escaped && this.character == ','; return !this.escaped && this.character == ',';
} }
public boolean isPropertyDelimeter() { public boolean isPropertyDelimiter() {
return !this.escaped && (this.character == '=' || this.character == ':'); return !this.escaped && (this.character == '=' || this.character == ':');
} }

@ -21,7 +21,7 @@ import org.springframework.util.ObjectUtils;
/** /**
* {@link PropertyOrigin} for an item loaded from a text resource. Provides access to the * {@link PropertyOrigin} for an item loaded from a text resource. Provides access to the
* origina {@link Resource} that loaded the text and a {@link Location} within it. * original {@link Resource} that loaded the text and a {@link Location} within it.
* *
* @author Madhura Bhave * @author Madhura Bhave
* @author Phillip Webb * @author Phillip Webb

@ -103,7 +103,7 @@ public class TextResourcePropertyOriginTests {
} }
@Test @Test
public void locationEqualsAndHashcodeShouldUseLineAndColumn() throws Exception { public void locationEqualsAndHashCodeShouldUseLineAndColumn() throws Exception {
Location location1 = new Location(1, 2); Location location1 = new Location(1, 2);
Location location2 = new Location(1, 2); Location location2 = new Location(1, 2);
Location location3 = new Location(2, 2); Location location3 = new Location(2, 2);

Loading…
Cancel
Save