Browse Source

polishing

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3327 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Juergen Hoeller 16 years ago
parent
commit
8ecac57161
  1. 22
      org.springframework.context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java
  2. 6
      org.springframework.context/src/main/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBean.java
  3. 8
      org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectLocator.java
  4. 4
      org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectTargetSource.java

22
org.springframework.context/src/main/java/org/springframework/format/datetime/joda/JodaTimeContextHolder.java

@ -1,5 +1,5 @@ @@ -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; @@ -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 { @@ -51,18 +51,18 @@ public final class JodaTimeContextHolder {
return jodaTimeContextHolder.get();
}
/**
* Gets the Formatter with the user-specific settings applied to thefrom the base <code>formatter</code>.
* @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 <code>null</code> 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);
}
}

6
org.springframework.context/src/main/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBean.java

@ -1,5 +1,5 @@ @@ -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 @@ -183,7 +183,7 @@ public class MBeanServerConnectionFactoryBean
}
@Override
public Class getTargetClass() {
public Class<?> getTargetClass() {
return JMXConnector.class;
}
}
@ -200,7 +200,7 @@ public class MBeanServerConnectionFactoryBean @@ -200,7 +200,7 @@ public class MBeanServerConnectionFactoryBean
}
@Override
public Class getTargetClass() {
public Class<?> getTargetClass() {
return MBeanServerConnection.class;
}
}

8
org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectLocator.java

@ -1,5 +1,5 @@ @@ -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 @@ -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 @@ -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 @@ -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;
}

4
org.springframework.context/src/main/java/org/springframework/jndi/JndiObjectTargetSource.java

@ -1,5 +1,5 @@ @@ -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 @@ -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();
}

Loading…
Cancel
Save