Java 5 code style

This commit is contained in:
Juergen Hoeller
2009-02-05 21:04:13 +00:00
parent 460977263d
commit 92588cddc6
21 changed files with 117 additions and 90 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import org.springframework.beans.factory.config.BeanDefinition;
*
* <p>The default scope is "singleton", and the default is to <i>not</i> create
* scoped-proxies.
*
*
* @author Mark Fisher
* @since 2.5
* @see ScopeMetadataResolver
@@ -37,36 +37,32 @@ public class ScopeMetadata {
private ScopedProxyMode scopedProxyMode = ScopedProxyMode.NO;
/**
* Get the name of the scope.
* @return said scope name
*/
public String getScopeName() {
return scopeName;
}
/**
* Set the name of the scope.
* @param scopeName said scope name
*/
public void setScopeName(String scopeName) {
this.scopeName = scopeName;
}
/**
* Get the proxy-mode to be applied to the scoped instance.
* @return said scoped-proxy mode
* Get the name of the scope.
*/
public ScopedProxyMode getScopedProxyMode() {
return scopedProxyMode;
public String getScopeName() {
return this.scopeName;
}
/**
* Set the proxy-mode to be applied to the scoped instance.
* @param scopedProxyMode said scoped-proxy mode
*/
public void setScopedProxyMode(ScopedProxyMode scopedProxyMode) {
this.scopedProxyMode = scopedProxyMode;
}
/**
* Get the proxy-mode to be applied to the scoped instance.
*/
public ScopedProxyMode getScopedProxyMode() {
return this.scopedProxyMode;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ package org.springframework.context.annotation;
* @see ScopeMetadata
*/
public enum ScopedProxyMode {
/**
* Do not create a scoped proxy.
* <p>This proxy-mode is not typically useful when used with a
@@ -37,16 +37,16 @@ public enum ScopedProxyMode {
* is to be used as a dependency.
*/
NO,
/**
* Create a JDK dynamic proxy implementing <i>all</i> interfaces exposed by
* the class of the target object.
*/
INTERFACES,
/**
* Create a class-based proxy (requires CGLIB).
*/
TARGET_CLASS
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,10 +40,11 @@ import org.springframework.core.NamedThreadLocal;
*/
public abstract class LocaleContextHolder {
private static final ThreadLocal localeContextHolder = new NamedThreadLocal("Locale context");
private static final ThreadLocal<LocaleContext> localeContextHolder =
new NamedThreadLocal<LocaleContext>("Locale context");
private static final ThreadLocal inheritableLocaleContextHolder =
new NamedInheritableThreadLocal("Locale context");
private static final ThreadLocal<LocaleContext> inheritableLocaleContextHolder =
new NamedInheritableThreadLocal<LocaleContext>("Locale context");
/**
@@ -87,9 +88,9 @@ public abstract class LocaleContextHolder {
* @return the current LocaleContext, or <code>null</code> if none
*/
public static LocaleContext getLocaleContext() {
LocaleContext localeContext = (LocaleContext) localeContextHolder.get();
LocaleContext localeContext = localeContextHolder.get();
if (localeContext == null) {
localeContext = (LocaleContext) inheritableLocaleContextHolder.get();
localeContext = inheritableLocaleContextHolder.get();
}
return localeContext;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,8 +63,13 @@ public class AspectJWeavingEnabler
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
LoadTimeWeaver weaverToUse = this.loadTimeWeaver;
if (weaverToUse == null && InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
weaverToUse = new InstrumentationLoadTimeWeaver(this.beanClassLoader);
if (weaverToUse == null) {
if (InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
weaverToUse = new InstrumentationLoadTimeWeaver(this.beanClassLoader);
}
else {
throw new IllegalStateException("No LoadTimeWeaver available");
}
}
weaverToUse.addTransformer(new AspectJClassBypassingClassFileTransformer(
new ClassPreProcessorAgentAdapter()));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,9 +30,8 @@ import org.springframework.util.Assert;
* to beans that implement the {@link LoadTimeWeaverAware} interface.
*
* <p>{@link org.springframework.context.ApplicationContext Application contexts}
* will automatically register this with their underlying
* {@link BeanFactory bean factory}, provided that a default
* <code>LoadTimeWeaver</code> is actually available.
* will automatically register this with their underlying {@link BeanFactory bean factory},
* provided that a default <code>LoadTimeWeaver</code> is actually available.
*
* <p>Applications should not use this class directly.
*