polishing
This commit is contained in:
@@ -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 <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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user