From 8ecac571615746308b684d951f4beb75cab920d2 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 13 May 2010 14:44:34 +0000 Subject: [PATCH] polishing git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3327 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../datetime/joda/JodaTimeContextHolder.java | 22 +++++++++---------- .../MBeanServerConnectionFactoryBean.java | 6 ++--- .../jndi/JndiObjectLocator.java | 8 +++---- .../jndi/JndiObjectTargetSource.java | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/org.springframework.context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java b/org.springframework.context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java index cb13e720771..4e3ec16b036 100644 --- a/org.springframework.context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java +++ b/org.springframework.context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 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. @@ -25,8 +25,8 @@ import org.springframework.core.NamedInheritableThreadLocal; /** * A holder for a thread-local user {@link JodaTimeContext}. * - * @since 3.0 * @author Keith Donald + * @since 3.0 */ public final class JodaTimeContextHolder { @@ -51,18 +51,18 @@ public final class JodaTimeContextHolder { return jodaTimeContextHolder.get(); } + /** - * Gets the Formatter with the user-specific settings applied to thefrom the base formatter. - * @param formatter the base formatter that establishes default formatting rules, generally user independent - * @param locale the current user locale (may be null if not known) - * @return the user's DateTimeFormatter + * Obtain a DateTimeFormatter with user-specific settings applied to the given base Formatter. + * @param formatter the base formatter that establishes default formatting rules + * (generally user independent) + * @param locale the current user locale (may be null if not known) + * @return the user-specific DateTimeFormatter */ public static DateTimeFormatter getFormatter(DateTimeFormatter formatter, Locale locale) { - if (locale != null) { - formatter = formatter.withLocale(locale); - } + DateTimeFormatter formatterToUse = (locale != null ? formatter.withLocale(locale) : formatter); JodaTimeContext context = getJodaTimeContext(); - return (context != null ? context.getFormatter(formatter) : formatter); + return (context != null ? context.getFormatter(formatterToUse) : formatterToUse); } - + } diff --git a/org.springframework.context/src/main/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBean.java b/org.springframework.context/src/main/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBean.java index be62dbcabfe..48bcd30a7b6 100644 --- a/org.springframework.context/src/main/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBean.java +++ b/org.springframework.context/src/main/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 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. @@ -183,7 +183,7 @@ public class MBeanServerConnectionFactoryBean } @Override - public Class getTargetClass() { + public Class getTargetClass() { return JMXConnector.class; } } @@ -200,7 +200,7 @@ public class MBeanServerConnectionFactoryBean } @Override - public Class getTargetClass() { + public Class getTargetClass() { return MBeanServerConnection.class; } } diff --git a/org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectLocator.java b/org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectLocator.java index 043d9474da8..4f8a148588c 100644 --- a/org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectLocator.java +++ b/org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectLocator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 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. @@ -49,7 +49,7 @@ public abstract class JndiObjectLocator extends JndiLocatorSupport implements In private String jndiName; - private Class expectedType; + private Class expectedType; /** @@ -73,7 +73,7 @@ public abstract class JndiObjectLocator extends JndiLocatorSupport implements In * Specify the type that the located JNDI object is supposed * to be assignable to, if any. */ - public void setExpectedType(Class expectedType) { + public void setExpectedType(Class expectedType) { this.expectedType = expectedType; } @@ -81,7 +81,7 @@ public abstract class JndiObjectLocator extends JndiLocatorSupport implements In * Return the type that the located JNDI object is supposed * to be assignable to, if any. */ - public Class getExpectedType() { + public Class getExpectedType() { return this.expectedType; } diff --git a/org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectTargetSource.java b/org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectTargetSource.java index c474f16e304..86d44b56d02 100644 --- a/org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectTargetSource.java +++ b/org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectTargetSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2010 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. @@ -105,7 +105,7 @@ public class JndiObjectTargetSource extends JndiObjectLocator implements TargetS } - public Class getTargetClass() { + public Class getTargetClass() { if (this.cachedObject != null) { return this.cachedObject.getClass(); }