Skip to content

Commit 9d6c38b

Browse files
committed
Consistent bracket alignment
1 parent 188e58c commit 9d6c38b

File tree

96 files changed

+521
-510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+521
-510
lines changed

buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ import org.gradle.api.artifacts.Configuration
2121
import org.gradle.api.artifacts.ProjectDependency;
2222
import org.gradle.api.artifacts.maven.Conf2ScopeMapping
2323
import org.gradle.api.plugins.MavenPlugin
24-
import org.gradle.api.tasks.*
2524
import org.gradle.plugins.ide.eclipse.EclipsePlugin
26-
import org.gradle.plugins.ide.eclipse.model.EclipseClasspath;
2725
import org.gradle.plugins.ide.idea.IdeaPlugin
2826
import org.gradle.api.invocation.*
2927

30-
3128
/**
3229
* Gradle plugin that allows projects to merged together. Primarily developed to
3330
* allow Spring to support multiple incompatible versions of third-party
@@ -76,13 +73,13 @@ class MergePlugin implements Plugin<Project> {
7673

7774
// Hook to perform the actual merge logic
7875
project.afterEvaluate{
79-
if(it.merge.into != null) {
76+
if (it.merge.into != null) {
8077
setup(it)
8178
}
8279
}
8380

8481
// Hook to build runtimeMerge dependencies
85-
if(!attachedProjectsEvaluated) {
82+
if (!attachedProjectsEvaluated) {
8683
project.gradle.projectsEvaluated{
8784
postProcessProjects(it)
8885
}
@@ -102,7 +99,7 @@ class MergePlugin implements Plugin<Project> {
10299
// invoking a task will invoke the task with the same name on 'into' project
103100
["sourcesJar", "jar", "javadocJar", "javadoc", "install", "artifactoryPublish"].each {
104101
def task = project.tasks.findByPath(it)
105-
if(task) {
102+
if (task) {
106103
task.enabled = false
107104
task.dependsOn(project.merge.into.tasks.findByPath(it))
108105
}
@@ -120,7 +117,7 @@ class MergePlugin implements Plugin<Project> {
120117
private void setupMaven(Project project) {
121118
project.configurations.each { configuration ->
122119
Conf2ScopeMapping mapping = project.conf2ScopeMappings.getMapping([configuration])
123-
if(mapping.scope) {
120+
if (mapping.scope) {
124121
Configuration intoConfiguration = project.merge.into.configurations.create(
125122
project.name + "-" + configuration.name)
126123
configuration.excludeRules.each {
@@ -131,7 +128,7 @@ class MergePlugin implements Plugin<Project> {
131128
configuration.dependencies.each {
132129
def intoCompile = project.merge.into.configurations.getByName("compile")
133130
// Protect against changing a compile scope dependency (SPR-10218)
134-
if(!intoCompile.dependencies.contains(it)) {
131+
if (!intoCompile.dependencies.contains(it)) {
135132
intoConfiguration.dependencies.add(it)
136133
}
137134
}

buildSrc/src/main/groovy/org/springframework/build/gradle/TestSourceSetDependenciesPlugin.groovy

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -21,7 +21,6 @@ import org.gradle.api.Project
2121
import org.gradle.api.artifacts.Configuration;
2222
import org.gradle.api.artifacts.ProjectDependency;
2323

24-
2524
/**
2625
* Gradle plugin that automatically updates testCompile dependencies to include
2726
* the test source sets of project dependencies.
@@ -43,9 +42,9 @@ class TestSourceSetDependenciesPlugin implements Plugin<Project> {
4342

4443
private void collectProjectDependencies(Set<ProjectDependency> projectDependencies,
4544
Project project) {
46-
for(def configurationName in ["compile", "optional", "provided", "testCompile"]) {
45+
for (def configurationName in ["compile", "optional", "provided", "testCompile"]) {
4746
Configuration configuration = project.getConfigurations().findByName(configurationName)
48-
if(configuration) {
47+
if (configuration) {
4948
configuration.dependencies.findAll { it instanceof ProjectDependency }.each {
5049
projectDependencies.add(it)
5150
collectProjectDependencies(projectDependencies, it.dependencyProject)

spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
215215
// is type-compatible. Note that we can't help if the target sets
216216
// a reference to itself in another returned object.
217217
retVal = proxy;
218-
} else if (retVal == null && returnType != Void.TYPE && returnType.isPrimitive()) {
219-
throw new AopInvocationException("Null return value from advice does not match primitive return type for: " + method);
218+
}
219+
else if (retVal == null && returnType != Void.TYPE && returnType.isPrimitive()) {
220+
throw new AopInvocationException(
221+
"Null return value from advice does not match primitive return type for: " + method);
220222
}
221223
return retVal;
222224
}

spring-aop/src/main/java/org/springframework/aop/interceptor/CustomizableTraceInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throw
258258
return returnValue;
259259
}
260260
catch (Throwable ex) {
261-
if(stopWatch.isRunning()) {
261+
if (stopWatch.isRunning()) {
262262
stopWatch.stop();
263263
}
264264
exitThroughException = true;
@@ -268,7 +268,7 @@ protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throw
268268
}
269269
finally {
270270
if (!exitThroughException) {
271-
if(stopWatch.isRunning()) {
271+
if (stopWatch.isRunning()) {
272272
stopWatch.stop();
273273
}
274274
writeToLog(logger,

spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AbstractDependencyInjectionAspect.aj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ public abstract aspect AbstractDependencyInjectionAspect {
4646
* Select join points in beans to be configured prior to construction?
4747
* By default, use post-construction injection matching the default in the Configurable annotation.
4848
*/
49-
public pointcut preConstructionConfiguration() : if(false);
49+
public pointcut preConstructionConfiguration() : if (false);
5050

5151
/**
5252
* Select the most-specific initialization join point
5353
* (most concrete class) for the initialization of an instance.
5454
*/
5555
@CodeGenerationHint(ifNameSuffix="6f1")
5656
public pointcut mostSpecificSubTypeConstruction() :
57-
if(thisJoinPoint.getSignature().getDeclaringType() == thisJoinPoint.getThis().getClass());
57+
if (thisJoinPoint.getSignature().getDeclaringType() == thisJoinPoint.getThis().getClass());
5858

5959
/**
6060
* Select least specific super type that is marked for DI (so that injection occurs only once with pre-construction inejection

spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/AnnotationBeanConfigurerAspect.aj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public aspect AnnotationBeanConfigurerAspect
7979
* An intermediary to match preConstructionConfiguration signature (that doesn't expose the annotation object)
8080
*/
8181
@CodeGenerationHint(ifNameSuffix="bb0")
82-
private pointcut preConstructionConfigurationSupport(Configurable c) : @this(c) && if(c.preConstruction());
82+
private pointcut preConstructionConfigurationSupport(Configurable c) : @this(c) && if (c.preConstruction());
8383

8484
/*
8585
* This declaration shouldn't be needed,

spring-aspects/src/main/java/org/springframework/cache/aspectj/JCacheCacheAspect.aj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public aspect JCacheCacheAspect extends JCacheAspectSupport {
5555
public Object invoke() {
5656
try {
5757
return proceed(cachedObject);
58-
} catch (Throwable ex) {
58+
}
59+
catch (Throwable ex) {
5960
throw new ThrowableWrapper(ex);
6061
}
6162
}
@@ -120,4 +121,4 @@ public aspect JCacheCacheAspect extends JCacheAspectSupport {
120121
}
121122
}
122123

123-
}
124+
}

spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ public TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws Bean
378378
if (pd.getReadMethod() != null || pd.getWriteMethod() != null) {
379379
return TypeDescriptor.nested(property(pd), tokens.keys.length);
380380
}
381-
} else {
381+
}
382+
else {
382383
if (pd.getReadMethod() != null || pd.getWriteMethod() != null) {
383384
return new TypeDescriptor(property(pd));
384385
}

spring-beans/src/main/java/org/springframework/beans/DirectFieldAccessor.java

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* {@link PropertyAccessor} implementation that directly accesses instance fields.
3535
* Allows for direct binding to fields instead of going through JavaBean setters.
3636
*
37-
* <p>Since 4.1 this implementation supports nested fields traversing.
37+
* <p>As of Spring 4.1, this implementation supports nested field traversal.
3838
*
3939
* <p>A DirectFieldAccessor's default for the "extractOldValueForEditor" setting
4040
* is "true", since a field can always be read without side effects.
@@ -188,7 +188,6 @@ private FieldAccessor doGetFieldAccessor(String propertyPath, Class<?> targetCla
188188

189189
/**
190190
* Create a root {@link FieldAccessor}.
191-
*
192191
* @param canonicalName the full expression for the field to access
193192
* @param actualName the name of the local (root) property
194193
* @param field the field accessing the property
@@ -212,13 +211,13 @@ private class FieldAccessor {
212211
private final Field field;
213212

214213
/**
215-
* Create a new instance.
214+
* Create a new FieldAccessor instance.
216215
* @param parent the parent accessor, if any
217216
* @param canonicalName the full expression for the field to access
218217
* @param actualName the name of the partial expression for this property
219218
* @param field the field accessing the property
220219
*/
221-
private FieldAccessor(FieldAccessor parent, String canonicalName, String actualName, Field field) {
220+
public FieldAccessor(FieldAccessor parent, String canonicalName, String actualName, Field field) {
222221
Assert.notNull(canonicalName, "Expression must no be null");
223222
Assert.notNull(field, "Field must no be null");
224223
this.parents = buildParents(parent);
@@ -229,7 +228,6 @@ private FieldAccessor(FieldAccessor parent, String canonicalName, String actualN
229228

230229
/**
231230
* Create a child instance.
232-
*
233231
* @param actualName the name of the child property
234232
* @param field the field accessing the child property
235233
*/
@@ -238,7 +236,7 @@ public FieldAccessor child(String actualName, Field field) {
238236
}
239237

240238
public Field getField() {
241-
return field;
239+
return this.field;
242240
}
243241

244242
public Object getValue() {
@@ -252,9 +250,8 @@ public void setValue(Object value) {
252250
try {
253251
this.field.set(localTarget, value);
254252
}
255-
catch (IllegalAccessException e) {
256-
throw new InvalidPropertyException(localTarget.getClass(), canonicalName,
257-
"Field is not accessible", e);
253+
catch (IllegalAccessException ex) {
254+
throw new InvalidPropertyException(localTarget.getClass(), canonicalName, "Field is not accessible", ex);
258255
}
259256
}
260257

@@ -275,8 +272,8 @@ private Object getLocalTarget(Object rootTarget) {
275272
localTarget = autoGrowIfNecessary(parent, parent.getParentValue(localTarget));
276273
if (localTarget == null) { // Could not traverse the graph any further
277274
throw new NullValueInNestedPathException(getRootClass(), parent.actualName,
278-
"Cannot access indexed value of property referenced in indexed " +
279-
"property path '" + getField().getName() + "': returned null");
275+
"Cannot access indexed value of property referenced in indexed property path '" +
276+
getField().getName() + "': returned null");
280277
}
281278
}
282279
return localTarget;
@@ -287,10 +284,10 @@ private Object newValue() {
287284
try {
288285
return type.newInstance();
289286
}
290-
catch (Exception e) {
287+
catch (Exception ex) {
291288
throw new NullValueInNestedPathException(getRootClass(), this.actualName,
292-
"Could not instantiate property type [" + type.getName() + "] to " +
293-
"auto-grow nested property path: " + e);
289+
"Could not instantiate property type [" + type.getName() +
290+
"] to auto-grow nested property path: " + ex);
294291
}
295292
}
296293

@@ -311,7 +308,6 @@ private List<FieldAccessor> buildParents(FieldAccessor parent) {
311308
}
312309
return parents;
313310
}
314-
315311
}
316312

317313
}

spring-beans/src/main/java/org/springframework/beans/PropertyMatches.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 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.
@@ -172,7 +172,8 @@ private int calculateStringDistance(String s1, String s2) {
172172
char t_j = s2.charAt(j - 1);
173173
if (s_i == t_j) {
174174
cost = 0;
175-
} else {
175+
}
176+
else {
176177
cost = 1;
177178
}
178179
d[i][j] = Math.min(Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1),

0 commit comments

Comments
 (0)