diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java b/org.springframework.beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java index ca66d655e28..d7a574cc433 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java @@ -136,8 +136,7 @@ public class PropertyBatchUpdateException extends BeansException { if (exType.isInstance(this)) { return true; } - for (int i = 0; i < this.propertyAccessExceptions.length; i++) { - PropertyAccessException pae = this.propertyAccessExceptions[i]; + for (PropertyAccessException pae : this.propertyAccessExceptions) { if (pae.contains(exType)) { return true; } diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/CustomScopeConfigurer.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/CustomScopeConfigurer.java index 9c701cd08c4..130387e552a 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/CustomScopeConfigurer.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/CustomScopeConfigurer.java @@ -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. @@ -74,6 +74,7 @@ public class CustomScopeConfigurer implements BeanFactoryPostProcessor, BeanClas } + @SuppressWarnings("unchecked") public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { if (this.scopes != null) { for (Map.Entry entry : this.scopes.entrySet()) { diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java index f8a801b9b04..669b0ab6502 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java @@ -426,10 +426,10 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp if (System.getSecurityManager() != null) { return AccessController.doPrivileged(new PrivilegedAction() { public Boolean run() { - return Boolean.valueOf(((factoryBean instanceof SmartFactoryBean && ((SmartFactoryBean) factoryBean).isPrototype()) || - !factoryBean.isSingleton())); + return ((factoryBean instanceof SmartFactoryBean && ((SmartFactoryBean) factoryBean).isPrototype()) || + !factoryBean.isSingleton()); } - }, getAccessControlContext()).booleanValue(); + }, getAccessControlContext()); } else { return ((factoryBean instanceof SmartFactoryBean && ((SmartFactoryBean) factoryBean).isPrototype()) || @@ -1015,9 +1015,8 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp if (!this.customEditors.isEmpty()) { for (Map.Entry> entry : this.customEditors.entrySet()) { Class requiredType = entry.getKey(); - Class editorClass = entry.getValue(); - registry.registerCustomEditor(requiredType, - (PropertyEditor) BeanUtils.instantiateClass(editorClass)); + Class editorClass = entry.getValue(); + registry.registerCustomEditor(requiredType, BeanUtils.instantiateClass(editorClass)); } } } @@ -1196,10 +1195,8 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp if (mbd.hasBeanClass()) { return mbd.getBeanClass(); } - if (System.getSecurityManager() != null) { return AccessController.doPrivileged(new PrivilegedExceptionAction() { - public Class run() throws Exception { return doResolveBeanClass(mbd, typesToMatch); } @@ -1211,10 +1208,10 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp } catch (PrivilegedActionException pae) { ClassNotFoundException ex = (ClassNotFoundException) pae.getException(); - throw new CannotLoadBeanClassException(mbd.getResourceDescription(), beanName, mbd.getBeanClassName(), (ClassNotFoundException) ex); + throw new CannotLoadBeanClassException(mbd.getResourceDescription(), beanName, mbd.getBeanClassName(), ex); } catch (ClassNotFoundException ex) { - throw new CannotLoadBeanClassException(mbd.getResourceDescription(), beanName, mbd.getBeanClassName(), (ClassNotFoundException) ex); + throw new CannotLoadBeanClassException(mbd.getResourceDescription(), beanName, mbd.getBeanClassName(), ex); } catch (LinkageError err) { throw new CannotLoadBeanClassException(mbd.getResourceDescription(), beanName, mbd.getBeanClassName(), err); diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java index 0004bf56195..987fd73b189 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java @@ -518,8 +518,8 @@ public class BeanDefinitionParserDelegate { } else if (ele.hasAttribute(SINGLETON_ATTRIBUTE)) { // Spring 1.x "singleton" attribute - bd.setScope(TRUE_VALUE.equals(ele.getAttribute(SINGLETON_ATTRIBUTE)) ? BeanDefinition.SCOPE_SINGLETON - : BeanDefinition.SCOPE_PROTOTYPE); + bd.setScope(TRUE_VALUE.equals(ele.getAttribute(SINGLETON_ATTRIBUTE)) ? + BeanDefinition.SCOPE_SINGLETON : BeanDefinition.SCOPE_PROTOTYPE); } else if (containingBean != null) { // Take default from containing bean in case of an inner bean definition. diff --git a/org.springframework.context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java b/org.springframework.context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java index 0267fc5f540..b2a1d26338b 100644 --- a/org.springframework.context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java +++ b/org.springframework.context/src/main/java/org/springframework/jmx/export/annotation/ManagedMetric.java @@ -1,3 +1,19 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.jmx.export.annotation; import java.lang.annotation.Documented; @@ -13,7 +29,6 @@ import org.springframework.jmx.support.MetricType; * property as JMX attribute, with added Descriptor properties to indicate that * it is a metric. Only valid when used on a JavaBean getter. * - * * @author Jennifer Hickey * @since 3.0 * @see org.springframework.jmx.export.metadata.ManagedMetric @@ -39,4 +54,4 @@ public @interface ManagedMetric { String unit() default ""; -} \ No newline at end of file +} diff --git a/org.springframework.context/src/main/java/org/springframework/jmx/export/metadata/ManagedMetric.java b/org.springframework.context/src/main/java/org/springframework/jmx/export/metadata/ManagedMetric.java index 1f5f9e0506b..f84908a5c3d 100644 --- a/org.springframework.context/src/main/java/org/springframework/jmx/export/metadata/ManagedMetric.java +++ b/org.springframework.context/src/main/java/org/springframework/jmx/export/metadata/ManagedMetric.java @@ -1,3 +1,19 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.jmx.export.metadata; import org.springframework.jmx.support.MetricType; @@ -6,7 +22,7 @@ import org.springframework.jmx.support.MetricType; * Metadata that indicates to expose a given bean property as a JMX attribute, * with additional descriptor properties that indicate that the attribute is a * metric. Only valid when used on a JavaBean getter. - * + * * @author Jennifer Hickey * @since 3.0 * @see org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler @@ -25,100 +41,89 @@ public class ManagedMetric extends AbstractJmxAttribute { private String unit = ""; - /** - * - *@return The category of this metric (ex. throughput, performance, utilization) - */ - public String getCategory() { - return category; - } /** - * - * @return A display name for this metric - */ - public String getDisplayName() { - return displayName; - } - - /** - * - * @return A description of how this metric's values change over time - */ - public MetricType getMetricType() { - return metricType; - } - - /** - * - * @return The persist period for this metric - */ - public int getPersistPeriod() { - return persistPeriod; - } - - /** - * - * @return The persist policy for this metric - */ - public String getPersistPolicy() { - return persistPolicy; - } - - /** - * - * @return The expected unit of measurement values - */ - public String getUnit() { - return unit; - } - - /** - * - * @param category The category of this metric (ex. throughput, performance, utilization) + * The category of this metric (ex. throughput, performance, utilization). */ public void setCategory(String category) { this.category = category; } /** - * - * @param displayName A display name for this metric + * The category of this metric (ex. throughput, performance, utilization). + */ + public String getCategory() { + return this.category; + } + + /** + * A display name for this metric. */ public void setDisplayName(String displayName) { this.displayName = displayName; } /** - * - * @param metricType A description of how this metric's values change over time + * A display name for this metric. + */ + public String getDisplayName() { + return this.displayName; + } + + /** + * A description of how this metric's values change over time. */ public void setMetricType(MetricType metricType) { this.metricType = metricType; } /** - * - * @param persistPeriod The persist period for this metric + * A description of how this metric's values change over time. + */ + public MetricType getMetricType() { + return this.metricType; + } + + /** + * The persist period for this metric. */ public void setPersistPeriod(int persistPeriod) { this.persistPeriod = persistPeriod; } /** - * - * @param persistPolicy The persist policy for this metric + * The persist period for this metric. + */ + public int getPersistPeriod() { + return this.persistPeriod; + } + + /** + * The persist policy for this metric. */ public void setPersistPolicy(String persistPolicy) { this.persistPolicy = persistPolicy; } /** - * - * @param unit The expected unit of measurement values + * The persist policy for this metric. + */ + public String getPersistPolicy() { + return this.persistPolicy; + } + + /** + * The expected unit of measurement values. */ public void setUnit(String unit) { this.unit = unit; } + /** + * The expected unit of measurement values. + */ + public String getUnit() { + return this.unit; + } + }