[jboss-cvs] JBossAS SVN: r94351 - in projects/kernel/trunk/jmx-mc-int/src/main: java/org/jboss/system and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 5 06:49:23 EDT 2009
Author: kabir.khan at jboss.com
Date: 2009-10-05 06:49:22 -0400 (Mon, 05 Oct 2009)
New Revision: 94351
Added:
projects/kernel/trunk/jmx-mc-int/src/main/resources/
projects/kernel/trunk/jmx-mc-int/src/main/resources/findbugs/
projects/kernel/trunk/jmx-mc-int/src/main/resources/findbugs/exclude.xml
Modified:
projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ListenerServiceMBeanSupport.java
projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ServiceDynamicMBeanSupport.java
projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ServiceMBeanSupport.java
projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/metadata/ServiceMetaDataParser.java
projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/microcontainer/LifecycleInfo.java
projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/microcontainer/ServiceControllerContextActions.java
Log:
findbugs fixes and exclude file
Modified: projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ListenerServiceMBeanSupport.java
===================================================================
--- projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ListenerServiceMBeanSupport.java 2009-10-05 10:12:44 UTC (rev 94350)
+++ projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ListenerServiceMBeanSupport.java 2009-10-05 10:49:22 UTC (rev 94351)
@@ -441,7 +441,7 @@
private void init()
{
// just pickup a unique object
- this.myHandback = new Integer(Integer.MAX_VALUE);
+ this.myHandback = Integer.valueOf(Integer.MAX_VALUE);
// allow only registration events
this.myFilter = new NotificationFilterSupport();
Modified: projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ServiceDynamicMBeanSupport.java
===================================================================
--- projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ServiceDynamicMBeanSupport.java 2009-10-05 10:12:44 UTC (rev 94350)
+++ projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ServiceDynamicMBeanSupport.java 2009-10-05 10:49:22 UTC (rev 94351)
@@ -94,7 +94,7 @@
//
if("State".equals(attribute))
{
- return new Integer(getState());
+ return Integer.valueOf(getState());
}
if("StateString".equals(attribute))
{
Modified: projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ServiceMBeanSupport.java
===================================================================
--- projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ServiceMBeanSupport.java 2009-10-05 10:12:44 UTC (rev 94350)
+++ projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/ServiceMBeanSupport.java 2009-10-05 10:49:22 UTC (rev 94351)
@@ -588,7 +588,7 @@
this,
getNextNotificationSequenceNumber(), now, msg,
"State", "java.lang.Integer",
- new Integer(oldState), new Integer(newState)
+ Integer.valueOf(oldState), Integer.valueOf(newState)
);
stateChangeNotification.setUserData(t);
Modified: projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/metadata/ServiceMetaDataParser.java
===================================================================
--- projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/metadata/ServiceMetaDataParser.java 2009-10-05 10:12:44 UTC (rev 94350)
+++ projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/metadata/ServiceMetaDataParser.java 2009-10-05 10:49:22 UTC (rev 94351)
@@ -757,16 +757,16 @@
public static String getRawElementTextContent(Element element)
{
NodeList nl = element.getChildNodes();
- String rawText = "";
+ StringBuilder rawText = new StringBuilder();
for (int i = 0; i < nl.getLength(); i++)
{
Node n = nl.item(i);
if (n instanceof Text)
{
- rawText += ((Text) n).getData();
+ rawText.append(((Text) n).getData());
}
}
- return rawText;
+ return rawText.toString();
}
/**
Modified: projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/microcontainer/LifecycleInfo.java
===================================================================
--- projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/microcontainer/LifecycleInfo.java 2009-10-05 10:12:44 UTC (rev 94350)
+++ projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/microcontainer/LifecycleInfo.java 2009-10-05 10:49:22 UTC (rev 94351)
@@ -138,7 +138,7 @@
/**
* State info holder.
*/
- private class StateInfo
+ private static class StateInfo
{
boolean opExists;
boolean installPhase;
Modified: projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/microcontainer/ServiceControllerContextActions.java
===================================================================
--- projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/microcontainer/ServiceControllerContextActions.java 2009-10-05 10:12:44 UTC (rev 94350)
+++ projects/kernel/trunk/jmx-mc-int/src/main/java/org/jboss/system/microcontainer/ServiceControllerContextActions.java 2009-10-05 10:49:22 UTC (rev 94351)
@@ -90,9 +90,9 @@
public class ServiceControllerContextActions extends AbstractControllerContextActions
{
/** The single instance */
- private static ServiceControllerContextActions instance;
+ private static volatile ServiceControllerContextActions instance;
/** The lifecycle instance */
- private static ServiceControllerContextActions lifecycleOnly;
+ private static volatile ServiceControllerContextActions lifecycleOnly;
/**
* Get the instance
Added: projects/kernel/trunk/jmx-mc-int/src/main/resources/findbugs/exclude.xml
===================================================================
--- projects/kernel/trunk/jmx-mc-int/src/main/resources/findbugs/exclude.xml (rev 0)
+++ projects/kernel/trunk/jmx-mc-int/src/main/resources/findbugs/exclude.xml 2009-10-05 10:49:22 UTC (rev 94351)
@@ -0,0 +1,199 @@
+<FindBugsFilter>
+
+ <!-- final static array field is part of the spi -->
+ <Match>
+ <Class name="org.jboss.system.ServiceMBeanSupport"/>
+ <Field name="SERVICE_CONTROLLER_SIG"/>
+ <Bug pattern="MS_PKGPROTECT"/>
+ </Match>
+
+ <!-- final static array field is part of the spi -->
+ <Match>
+ <Class name="org.jboss.system.ServiceController"/>
+ <Field name="JBOSS_INTERNAL_LIFECYCLE_SIG"/>
+ <Bug pattern="MS_MUTABLE_ARRAY"/>
+ </Match>
+
+ <!-- final static array field is part of the spi -->
+ <Match>
+ <Class name="org.jboss.system.ServiceMBean"/>
+ <Field name="states"/>
+ <Bug pattern="MS_OOI_PKGPROTECT"/>
+ </Match>
+
+ <!-- Only used internally -->
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceConstructorMetaData"/>
+ <Or>
+ <Method name="getParameters"/>
+ <Method name="getParams"/>
+ <Method name="getSignature"/>
+ <Method name="setParameters"/>
+ <Method name="setParams"/>
+ <Method name="setSignature"/>
+ </Or>
+ <Or>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Or>
+ </Match>
+
+ <!-- Calling toLowerCase should be fine -->
+ <Match>
+ <Class name="org.jboss.system.ServiceConfigurator"/>
+ <Method name="configure" params="javax.management.MBeanServer, org.jboss.system.ServiceController, javax.management.ObjectName, java.lang.ClassLoader, java.util.Collection" returns="void"/>
+ <Bug pattern="DM_CONVERT_CASE"/>
+ </Match>
+
+ <!-- Ignored exception is by design -->
+ <Match>
+ <Class name="org.jboss.system.microcontainer.ServiceControllerContext"/>
+ <Method name="getServiceContext"/>
+ <Bug pattern="DE_MIGHT_IGNORE"/>
+ </Match>
+
+ <!-- Ignored exception is by design -->
+ <Match>
+ <Class name="org.jboss.system.ServiceCreator"/>
+ <Method name="installExternalXMBean" params="javax.management.MBeanServer, javax.management.ObjectName, org.jboss.system.metadata.ServiceMetaData" returns="org.jboss.system.ServiceInstance"/>
+ <Bug pattern="DE_MIGHT_IGNORE"/>
+ </Match>
+
+ <!-- Hashcode implemented via JBossObject/getHashCode() -->
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceAnnotationMetaData"/>
+ <Method name="equals" params="java.lang.Object" returns="boolean"/>
+ <Bug pattern="HE_EQUALS_NO_HASHCODE"/>
+ </Match>
+
+ <!-- org.jboss.system.metadata.ServiceValueContext.getClassloader() and org.jboss.system.microcontainer.ServiceControllerContext.getClassLoader() names are part of the spi -->
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceValueContext"/>
+ <Method name="getClassloader"/>
+ <Bug pattern="NM_CONFUSING"/>
+ </Match>
+
+ <!-- We are handling the CCE for the cast -->
+ <Match>
+ <Class name="org.jboss.system.ListenerServiceMBeanSupport"/>
+ <Method name="handleNotification" params="javax.management.Notification, java.lang.Object" returns="void"/>
+ <Bug pattern="BC_UNCONFIRMED_CAST"/>
+ </Match>
+
+ <!-- This is an 'inner' exception, we're rethrowing the 'outer' one -->
+ <Match>
+ <Class name="org.jboss.system.ListenerServiceMBeanSupport"/>
+ <Method name="createNotificationFilter" params="java.lang.String, org.w3c.dom.Element" returns="javax.management.NotificationFilter"/>
+ <Bug pattern="REC_CATCH_EXCEPTION"/>
+ </Match>
+
+ <!-- We are throwing a ConfiurationException instead of the original excpetion-->
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceConstructorMetaData"/>
+ <Method name="getParameters" params="java.lang.ClassLoader" returns="java.lang.Object[]"/>
+ <Bug pattern="REC_CATCH_EXCEPTION"/>
+ </Match>
+
+ <!-- We are throwing a ConfiurationException instead of the original excpetion-->
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceValueFactoryParameterMetaData"/>
+ <Method name="getValue" params="java.lang.ClassLoader, java.lang.String, java.lang.String, java.lang.String" returns="java.lang.Object"/>
+ <Bug pattern="REC_CATCH_EXCEPTION"/>
+ </Match>
+
+ <!-- Field is set via a setter -->
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceAttributeMetaData"/>
+ <Field name="value"/>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+
+ <!-- Field are set via a setter -->
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceDependencyMetaData"/>
+ <Or>
+ <Field name="iDependOnObjectName"/>
+ <Field name="iDependOn"/>
+ </Or>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+
+ <!-- Exclude these non serializable field errors until it is clear if the metadata classes actually need to be serialized,
+ in which case there should be some tests testing that -->
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceAnnotationMetaData"/>
+ <Field name="ann"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceDependencyListValueMetaData"/>
+ <Field name="dependencies"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceDependencyListValueMetaData"/>
+ <Field name="objectNames"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceDeployment"/>
+ <Field name="config"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceDeployment"/>
+ <Field name="classPaths"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceDeployment"/>
+ <Field name="services"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceElementValueMetaData"/>
+ <Field name="element"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceMetaData"/>
+ <Field name="xmbeanDescriptor"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceMetaData"/>
+ <Field name="aliases"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceMetaData"/>
+ <Field name="annotations"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceMetaData"/>
+ <Field name="attributes"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceMetaData"/>
+ <Field name="dependencies"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.metadata.ServiceValueFactoryValueMetaData"/>
+ <Field name="parameterMetaData"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.ServiceContext"/>
+ <Field name="dependsOnMe"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.system.ServiceContext"/>
+ <Field name="iDependOn"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+
+</FindBugsFilter>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list