Skip to content

Commit 15c8987

Browse files
committed
Polishing
1 parent 0e90776 commit 15c8987

File tree

15 files changed

+154
-176
lines changed

15 files changed

+154
-176
lines changed

spring-beans/src/main/java/org/springframework/beans/BeanInstantiationException.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.
@@ -49,11 +49,12 @@ public BeanInstantiationException(Class<?> beanClass, String msg, Throwable caus
4949
this.beanClass = beanClass;
5050
}
5151

52+
5253
/**
5354
* Return the offending bean class.
5455
*/
5556
public Class<?> getBeanClass() {
56-
return beanClass;
57+
return this.beanClass;
5758
}
5859

5960
}

spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,7 @@ public void setBeanFactory(BeanFactory beanFactory) {
399399
//---------------------------------------------------------------------
400400

401401
/**
402-
* Kick off bean registration automatically when deployed in an
403-
* {@code ApplicationContext}.
402+
* Kick off bean registration automatically when deployed in an {@code ApplicationContext}.
404403
* @see #registerBeans()
405404
*/
406405
@Override

spring-core/src/main/java/org/springframework/util/MimeType.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class MimeType implements Comparable<MimeType>, Serializable {
6464
static {
6565
// variable names refer to RFC 2616, section 2.2
6666
BitSet ctl = new BitSet(128);
67-
for (int i=0; i <= 31; i++) {
67+
for (int i = 0; i <= 31; i++) {
6868
ctl.set(i);
6969
}
7070
ctl.set(127);
@@ -155,14 +155,14 @@ public MimeType(String type, String subtype, Map<String, String> parameters) {
155155
this.type = type.toLowerCase(Locale.ENGLISH);
156156
this.subtype = subtype.toLowerCase(Locale.ENGLISH);
157157
if (!CollectionUtils.isEmpty(parameters)) {
158-
Map<String, String> m = new LinkedCaseInsensitiveMap<String>(parameters.size(), Locale.ENGLISH);
158+
Map<String, String> map = new LinkedCaseInsensitiveMap<String>(parameters.size(), Locale.ENGLISH);
159159
for (Map.Entry<String, String> entry : parameters.entrySet()) {
160160
String attribute = entry.getKey();
161161
String value = entry.getValue();
162162
checkParameters(attribute, value);
163-
m.put(attribute, value);
163+
map.put(attribute, value);
164164
}
165-
this.parameters = Collections.unmodifiableMap(m);
165+
this.parameters = Collections.unmodifiableMap(map);
166166
}
167167
else {
168168
this.parameters = Collections.emptyMap();
@@ -256,7 +256,7 @@ public String getSubtype() {
256256

257257
/**
258258
* Return the character set, as indicated by a {@code charset} parameter, if any.
259-
* @return the character set; or {@code null} if not available
259+
* @return the character set, or {@code null} if not available
260260
*/
261261
public Charset getCharSet() {
262262
String charSet = getParameter(PARAM_CHARSET);
@@ -266,18 +266,18 @@ public Charset getCharSet() {
266266
/**
267267
* Return a generic parameter value, given a parameter name.
268268
* @param name the parameter name
269-
* @return the parameter value; or {@code null} if not present
269+
* @return the parameter value, or {@code null} if not present
270270
*/
271271
public String getParameter(String name) {
272272
return this.parameters.get(name);
273273
}
274274

275275
/**
276276
* Return all generic parameter values.
277-
* @return a read-only map, possibly empty, never {@code null}
277+
* @return a read-only map (possibly empty, never {@code null})
278278
*/
279279
public Map<String, String> getParameters() {
280-
return parameters;
280+
return this.parameters;
281281
}
282282

283283
/**

spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void findMethodAnnotationOnBridgeMethod() throws Exception {
102102
@Test
103103
public void findAnnotationFavorsInterfacesOverLocalMetaAnnotations() {
104104
Component component = AnnotationUtils.findAnnotation(
105-
ClassWithLocalMetaAnnotationAndMetaAnnotatedInterface.class, Component.class);
105+
ClassWithLocalMetaAnnotationAndMetaAnnotatedInterface.class, Component.class);
106106
assertNotNull(component);
107107

108108
// By inspecting ClassWithLocalMetaAnnotationAndMetaAnnotatedInterface, one
@@ -116,8 +116,8 @@ public void findAnnotationFavorsInterfacesOverLocalMetaAnnotations() {
116116
*/
117117
@Test
118118
public void findAnnotationFavorsInheritedAnnotationsOverMoreLocallyDeclaredComposedAnnotations() {
119-
Transactional transactional = AnnotationUtils.findAnnotation(SubSubClassWithInheritedAnnotation.class,
120-
Transactional.class);
119+
Transactional transactional = AnnotationUtils.findAnnotation(
120+
SubSubClassWithInheritedAnnotation.class, Transactional.class);
121121
assertNotNull(transactional);
122122
assertTrue("readOnly flag for SubSubClassWithInheritedAnnotation", transactional.readOnly());
123123
}
@@ -127,8 +127,8 @@ public void findAnnotationFavorsInheritedAnnotationsOverMoreLocallyDeclaredCompo
127127
*/
128128
@Test
129129
public void findAnnotationFavorsInheritedComposedAnnotationsOverMoreLocallyDeclaredComposedAnnotations() {
130-
Component component = AnnotationUtils.findAnnotation(SubSubClassWithInheritedMetaAnnotation.class,
131-
Component.class);
130+
Component component = AnnotationUtils.findAnnotation(
131+
SubSubClassWithInheritedMetaAnnotation.class, Component.class);
132132
assertNotNull(component);
133133
assertEquals("meta2", component.value());
134134
}

spring-jdbc/src/main/java/org/springframework/jdbc/datasource/ConnectionHandle.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2005 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.
@@ -20,12 +20,13 @@
2020

2121
/**
2222
* Simple interface to be implemented by handles for a JDBC Connection.
23-
* Used by JdoDialect, for example.
23+
* Used by JpaDialect and JdoDialect, for example.
2424
*
2525
* @author Juergen Hoeller
2626
* @since 1.1
2727
* @see SimpleConnectionHandle
2828
* @see ConnectionHolder
29+
* @see org.springframework.orm.jdo.JpaDialect#getJdbcConnection
2930
* @see org.springframework.orm.jdo.JdoDialect#getJdbcConnection
3031
*/
3132
public interface ConnectionHandle {

spring-jdbc/src/main/java/org/springframework/jdbc/support/incrementer/AbstractColumnMaxValueIncrementer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 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.
@@ -23,7 +23,7 @@
2323
/**
2424
* Abstract base class for {@link DataFieldMaxValueIncrementer} implementations that use
2525
* a column in a custom sequence table. Subclasses need to provide the specific handling
26-
* of that table in their {@link #getNextKey()} implementation..
26+
* of that table in their {@link #getNextKey()} implementation.
2727
*
2828
* @author Juergen Hoeller
2929
* @since 2.5.3
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
21
/**
3-
*
4-
* Support package for the Hibernate3 Annotation add-on,
5-
* which supports EJB3-compliant JDK 1.5+ annotations for mappings.
6-
*
2+
* Support package for the Hibernate 3 Annotation add-on,
3+
* which supports JPA-compliant Java 5+ annotations for mappings.
74
*/
85
package org.springframework.orm.hibernate3.annotation;
9-

spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaDialect.java

Lines changed: 6 additions & 6 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.
@@ -244,8 +244,8 @@ protected DataAccessException convertHibernateAccessException(HibernateException
244244
return new JpaSystemException(ex);
245245
}
246246

247-
protected Session getSession(EntityManager em) {
248-
return em.unwrap(Session.class);
247+
protected Session getSession(EntityManager entityManager) {
248+
return entityManager.unwrap(Session.class);
249249
}
250250

251251

@@ -270,14 +270,14 @@ public void resetFlushMode() {
270270

271271
private static class HibernateConnectionHandle implements ConnectionHandle {
272272

273-
private final Session session;
274-
275273
// This will find a corresponding method on Hibernate 3.x but not on 4.x
276274
private static final Method sessionConnectionMethod =
277275
ClassUtils.getMethodIfAvailable(Session.class, "connection");
278276

279277
private static volatile Method connectionMethodToUse = sessionConnectionMethod;
280278

279+
private final Session session;
280+
281281
public HibernateConnectionHandle(Session session) {
282282
this.session = session;
283283
}
@@ -286,7 +286,7 @@ public HibernateConnectionHandle(Session session) {
286286
public Connection getConnection() {
287287
try {
288288
if (connectionMethodToUse == null) {
289-
// Reflective lookup trying to find SessionImpl's connection() on Hibernate 4.x
289+
// Reflective lookup to find SessionImpl's connection() method on Hibernate 4.x
290290
connectionMethodToUse = this.session.getClass().getMethod("connection");
291291
}
292292
return (Connection) ReflectionUtils.invokeMethod(connectionMethodToUse, this.session);
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
21
/**
3-
*
42
* Contains (un)marshallers optimized to store binary data in MIME attachments.
5-
* </htm
6-
*
73
*/
84
package org.springframework.oxm.mime;
9-
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
21
/**
3-
*
4-
* Provides generic support classes for using Spring's O/X Mapping integration within various scenario's. Includes the
5-
* MarshallingSource for compatibility with TrAX, MarshallingView for use withing Spring Web MVC, and the
2+
* Provides generic support classes for using Spring's O/X Mapping integration
3+
* within various scenario's. Includes the MarshallingSource for compatibility
4+
* with TrAX, MarshallingView for use withing Spring Web MVC, and the
65
* MarshallingMessageConverter for use within Spring's JMS support.
7-
* </htm
8-
*
96
*/
107
package org.springframework.oxm.support;
11-

0 commit comments

Comments
 (0)