Skip to content

Commit 354917c

Browse files
committed
Polishing (backports from 4.0.1)
1 parent 1e0bf49 commit 354917c

File tree

6 files changed

+58
-115
lines changed

6 files changed

+58
-115
lines changed

spring-context/src/main/java/org/springframework/context/expression/EnvironmentAccessor.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2013 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.
@@ -32,7 +32,7 @@
3232
public class EnvironmentAccessor implements PropertyAccessor {
3333

3434
public Class<?>[] getSpecificTargetClasses() {
35-
return new Class[] { Environment.class };
35+
return new Class<?>[] {Environment.class};
3636
}
3737

3838
/**
@@ -48,19 +48,18 @@ public boolean canRead(EvaluationContext context, Object target, String name) th
4848
* environment.
4949
*/
5050
public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException {
51-
return new TypedValue(((Environment)target).getProperty(name));
51+
return new TypedValue(((Environment) target).getProperty(name));
5252
}
5353

5454
/**
55-
* Read only.
56-
* @return false
55+
* Read-only: returns {@code false}.
5756
*/
5857
public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException {
5958
return false;
6059
}
6160

6261
/**
63-
* Read only. No-op.
62+
* Read-only: no-op.
6463
*/
6564
public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException {
6665
}

spring-jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,8 @@ public void setCacheLevelName(String constantName) throws IllegalArgumentExcepti
247247
* transaction in case of a freshly obtained JMS {@code Connection} and {@code Session},
248248
* which is why this listener container by default does not cache any of those.
249249
* However, if you want to optimize for a specific server, consider switching
250-
* this setting to at least {@link #CACHE_CONNECTION} or {@link #CACHE_SESSION} even in
251-
* conjunction with an external transaction manager.
252-
* <p>Currently known servers that absolutely require {@link #CACHE_NONE} for XA
253-
* transaction processing: JBoss 4. For any others, consider raising the cache level.
250+
* this setting to at least {@link #CACHE_CONNECTION} or {@link #CACHE_SESSION}
251+
* even in conjunction with an external transaction manager.
254252
* @see #CACHE_NONE
255253
* @see #CACHE_CONNECTION
256254
* @see #CACHE_SESSION

spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/DefaultPersistenceUnitManager.java

Lines changed: 8 additions & 7 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-2013 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.
@@ -305,22 +305,23 @@ public PersistenceUnitPostProcessor[] getPersistenceUnitPostProcessors() {
305305
/**
306306
* Specify the Spring LoadTimeWeaver to use for class instrumentation according
307307
* to the JPA class transformer contract.
308-
* <p>It is not required to specify a LoadTimeWeaver: Most providers will be
309-
* able to provide a subset of their functionality without class instrumentation
310-
* as well, or operate with their VM agent specified on JVM startup.
308+
* <p>It is not required to specify a LoadTimeWeaver: Most providers will be able
309+
* to provide a subset of their functionality without class instrumentation as well,
310+
* or operate with their own VM agent specified on JVM startup. Furthermore,
311+
* DefaultPersistenceUnitManager falls back to an InstrumentationLoadTimeWeaver
312+
* if Spring's agent-based instrumentation is available at runtime.
311313
* <p>In terms of Spring-provided weaving options, the most important ones are
312314
* InstrumentationLoadTimeWeaver, which requires a Spring-specific (but very general)
313315
* VM agent specified on JVM startup, and ReflectiveLoadTimeWeaver, which interacts
314316
* with an underlying ClassLoader based on specific extended methods being available
315317
* on it (for example, interacting with Spring's TomcatInstrumentableClassLoader).
316318
* <p><b>NOTE:</b> As of Spring 2.5, the context's default LoadTimeWeaver (defined
317319
* as bean with name "loadTimeWeaver") will be picked up automatically, if available,
318-
* removing the need for LoadTimeWeaver configuration on each affected target bean.</b>
320+
* removing the need for LoadTimeWeaver configuration on each affected target bean.
319321
* Consider using the {@code context:load-time-weaver} XML tag for creating
320322
* such a shared LoadTimeWeaver (autodetecting the environment by default).
321323
* @see org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver
322324
* @see org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
323-
* @see org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader
324325
*/
325326
public void setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver) {
326327
this.loadTimeWeaver = loadTimeWeaver;
@@ -447,7 +448,7 @@ private SpringPersistenceUnitInfo buildDefaultPersistenceUnitInfo() {
447448
}
448449
}
449450
catch (IOException ex) {
450-
throw new PersistenceException("Failed to scan classpath for unlisted classes", ex);
451+
throw new PersistenceException("Failed to scan classpath for unlisted entity classes", ex);
451452
}
452453
}
453454
}

0 commit comments

Comments
 (0)