Skip to content

Commit 1e40bff

Browse files
committed
Polish
1 parent 7d80f0e commit 1e40bff

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/RepositoryConfigurationFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/DefaultRepositorySystemSessionAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-cli/src/test/resources/maven-settings/property-interpolation/.m2/settings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
44
http://maven.apache.org/xsd/settings-1.0.0.xsd">
5-
5+
66
<localRepository>${foo}/repository</localRepository>
77

8-
</settings>
8+
</settings>

spring-boot/src/main/java/org/springframework/boot/test/EnvironmentTestUtils.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,11 @@ private static int getSeparatorIndex(String pair) {
9292
int equalIndex = pair.indexOf("=");
9393
if (colonIndex == -1) {
9494
return equalIndex;
95-
} else if (equalIndex == -1) {
96-
return colonIndex;
9795
}
98-
else {
99-
return Math.min(colonIndex, equalIndex);
96+
if (equalIndex == -1) {
97+
return colonIndex;
10098
}
99+
return Math.min(colonIndex, equalIndex);
101100
}
102101

103102
}

spring-boot/src/test/java/org/springframework/boot/test/EnvironmentTestUtilsTests.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.util.Map;
2121

2222
import org.junit.Test;
23-
2423
import org.springframework.core.env.ConfigurableEnvironment;
2524
import org.springframework.core.env.MapPropertySource;
2625
import org.springframework.core.env.StandardEnvironment;
@@ -71,27 +70,29 @@ public void addSimplePairColonWithEqualInValue() {
7170
@Test
7271
public void addPairNoValue() {
7372
String propertyName = "my.foo+bar";
74-
assertFalse(environment.containsProperty(propertyName));
75-
EnvironmentTestUtils.addEnvironment(environment, propertyName);
76-
assertTrue(environment.containsProperty(propertyName));
77-
assertEquals("", environment.getProperty(propertyName));
73+
assertFalse(this.environment.containsProperty(propertyName));
74+
EnvironmentTestUtils.addEnvironment(this.environment, propertyName);
75+
assertTrue(this.environment.containsProperty(propertyName));
76+
assertEquals("", this.environment.getProperty(propertyName));
7877
}
7978

8079
private void testAddSimplePair(String key, String value, String delimiter) {
81-
assertFalse("Property '" + key + "' should not exist", environment.containsProperty(key));
82-
EnvironmentTestUtils.addEnvironment(environment, key + delimiter + value);
83-
assertEquals("Wrong value for property '" + key + "'", value, environment.getProperty(key));
80+
assertFalse("Property '" + key + "' should not exist",
81+
this.environment.containsProperty(key));
82+
EnvironmentTestUtils.addEnvironment(this.environment, key + delimiter + value);
83+
assertEquals("Wrong value for property '" + key + "'", value,
84+
this.environment.getProperty(key));
8485
}
8586

8687
@Test
8788
public void testConfigHasHigherPrecedence() {
8889
Map<String, Object> map = new HashMap<String, Object>();
8990
map.put("my.foo", "bar");
9091
MapPropertySource source = new MapPropertySource("sample", map);
91-
environment.getPropertySources().addFirst(source);
92-
assertEquals("bar", environment.getProperty("my.foo"));
93-
EnvironmentTestUtils.addEnvironment(environment, "my.foo=bar2");
94-
assertEquals("bar2", environment.getProperty("my.foo"));
92+
this.environment.getPropertySources().addFirst(source);
93+
assertEquals("bar", this.environment.getProperty("my.foo"));
94+
EnvironmentTestUtils.addEnvironment(this.environment, "my.foo=bar2");
95+
assertEquals("bar2", this.environment.getProperty("my.foo"));
9596
}
9697

9798
}

0 commit comments

Comments
 (0)