[jboss-cvs] JBossAS SVN: r94350 - in projects/kernel/trunk/kernel/src/main: java/org/jboss/kernel and 11 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 5 06:12:45 EDT 2009
Author: kabir.khan at jboss.com
Date: 2009-10-05 06:12:44 -0400 (Mon, 05 Oct 2009)
New Revision: 94350
Added:
projects/kernel/trunk/kernel/src/main/resources/findbugs/
projects/kernel/trunk/kernel/src/main/resources/findbugs/exclude.xml
Modified:
projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractDependencyMetaData.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractDependencyValueMetaData.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInstallMetaData.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/CallbackCreatorUtil.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/NestedBeanHandler.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/KernelPermission.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanMetaDataAnnotationAdapter.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectionDependencyItem.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectionValueMetaData.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/config/Configurator.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/KernelControllerContextActions.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/PreInstallAction.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/PropertiesGraphFactory.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/BeanVertexFactory.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/ClassVertexFactory.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/HolderVertexFactory.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/LevelVertexFactory.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/PropertyVertexFactory.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/lazy/JavassistLazyInitializer.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/validation/basic/BasicKernelBeanValidator.java
projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/spi/lazy/LazyProxyFactory.java
Log:
findbugs fixes and exclude file
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractDependencyMetaData.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractDependencyMetaData.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractDependencyMetaData.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -96,9 +96,9 @@
throw new IllegalArgumentException("Null or empty dependency.");
KernelControllerContext context = visitor.getControllerContext();
- DependencyItem item = new LifecycleDependencyItem(context.getName(), ControllerState.CREATE);
+ DependencyItem item = new LifecycleDependencyItem(context.getName(), dependency, ControllerState.CREATE);
visitor.addDependency(item);
- item = new LifecycleDependencyItem(context.getName(), ControllerState.START);
+ item = new LifecycleDependencyItem(context.getName(), dependency, ControllerState.START);
visitor.addDependency(item);
visitor.initialVisit(this);
@@ -140,7 +140,7 @@
/**
* A LifecycleDependencyItem.
*/
- public class LifecycleDependencyItem extends AbstractDependencyItem
+ public static class LifecycleDependencyItem extends AbstractDependencyItem
{
/**
* Create a new LifecycleDependencyItem.
@@ -148,7 +148,7 @@
* @param name the name
* @param state the state
*/
- public LifecycleDependencyItem(Object name, ControllerState state)
+ public LifecycleDependencyItem(Object name, Object dependency, ControllerState state)
{
super(name, dependency, state, state);
}
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractDependencyValueMetaData.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractDependencyValueMetaData.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractDependencyValueMetaData.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -248,7 +248,7 @@
*/
protected void addOptionalDependency(Controller controller, ControllerContext lookup)
{
- OptionalDependencyItem dependency = new OptionalDependencyItem(context.getName(), lookup.getName(), lookup.getState());
+ OptionalDependencyItem dependency = new OptionalDependencyItem(context.getName(), optionalWhenRequired, lookup.getName(), lookup.getState(), search);
context.getDependencyInfo().addIDependOn(dependency);
lookup.getDependencyInfo().addDependsOnMe(dependency);
}
@@ -373,9 +373,9 @@
/**
* Optional depedency item.
*/
- protected class OptionalDependencyItem extends SearchDependencyItem
+ protected static class OptionalDependencyItem extends SearchDependencyItem
{
- public OptionalDependencyItem(Object name, Object iDependOn, ControllerState dependentState)
+ public OptionalDependencyItem(Object name, ControllerState optionalWhenRequired, Object iDependOn, ControllerState dependentState, SearchInfo search)
{
super(name, iDependOn, optionalWhenRequired, dependentState, search);
setResolved(true);
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInstallMetaData.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInstallMetaData.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInstallMetaData.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -106,7 +106,7 @@
KernelControllerContext context = visitor.getControllerContext();
if (bean != null)
{
- DependencyItem item = new InstallationDependencyItem(context.getName());
+ DependencyItem item = new InstallationDependencyItem(context.getName(), bean, state, dependentState);
visitor.addDependency(item);
}
super.initialVisit(visitor);
@@ -155,14 +155,14 @@
/**
* An InstallationDependencyItem.
*/
- public class InstallationDependencyItem extends AbstractDependencyItem
+ public static class InstallationDependencyItem extends AbstractDependencyItem
{
/**
* Create a new InstallationDependencyItem.
*
* @param name the name
*/
- public InstallationDependencyItem(Object name)
+ public InstallationDependencyItem(Object name, String bean, ControllerState state, ControllerState dependentState)
{
super(name, bean, state, dependentState);
}
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/CallbackCreatorUtil.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/CallbackCreatorUtil.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/CallbackCreatorUtil.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -50,8 +50,8 @@
*/
public class CallbackCreatorUtil
{
- protected static Logger log;
- protected static CollectionCallbackItemFactory factory;
+ protected static volatile Logger log;
+ protected static volatile CollectionCallbackItemFactory factory;
// layz log
protected static Logger getLog()
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/NestedBeanHandler.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/NestedBeanHandler.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/beans/metadata/plugins/NestedBeanHandler.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -238,7 +238,7 @@
/**
* Simple pair class.
*/
- private class Pair
+ private static class Pair
{
private MetaDataVisitorNode previous;
private BeanMetaData bean;
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/KernelPermission.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/KernelPermission.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/KernelPermission.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -164,7 +164,7 @@
/**
* A KernelPermissionCollection.
*/
- class KernelPermissionCollection extends PermissionCollection
+ static class KernelPermissionCollection extends PermissionCollection
{
/** The serialVersionUID */
private static final long serialVersionUID = 3256442516797665329L;
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -32,7 +32,7 @@
*/
public class BasicBeanAnnotationAdapter extends AbstractBeanAnnotationAdapter
{
- public static BasicBeanAnnotationAdapter INSTANCE = new BasicBeanAnnotationAdapter();
+ public static final BasicBeanAnnotationAdapter INSTANCE = new BasicBeanAnnotationAdapter();
/** The parameter annotation adapters */
private Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters;
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanMetaDataAnnotationAdapter.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanMetaDataAnnotationAdapter.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanMetaDataAnnotationAdapter.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -32,7 +32,7 @@
*/
public class BasicBeanMetaDataAnnotationAdapter extends AbstractMetaDataAnnotationAdapter
{
- public static BasicBeanMetaDataAnnotationAdapter INSTANCE = new BasicBeanMetaDataAnnotationAdapter();
+ public static final BasicBeanMetaDataAnnotationAdapter INSTANCE = new BasicBeanMetaDataAnnotationAdapter();
/** The parameter annotation adapters */
private Set<Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters;
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectionDependencyItem.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectionDependencyItem.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectionDependencyItem.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -41,7 +41,9 @@
public WBInjectionDependencyItem(Object name, ControllerState whenRequired, Class<?> type, Annotation[] annotations)
{
super(name, type, whenRequired, ControllerState.INSTALLED);
- this.annotations = annotations;
+ //Defensive copy
+ this.annotations = new Annotation[annotations.length];
+ System.arraycopy(annotations, 0, this.annotations, 0, annotations.length);
}
public boolean resolve(Controller controller)
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectionValueMetaData.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectionValueMetaData.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectionValueMetaData.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -50,7 +50,9 @@
public WBInjectionValueMetaData(Class<?> type, Annotation[] annotations)
{
this.type = type;
- this.annotations = annotations;
+ //Defensive copy
+ this.annotations = new Annotation[annotations.length];
+ System.arraycopy(annotations, 0, this.annotations, 0, annotations.length);
}
public void initialVisit(MetaDataVisitor visitor)
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/config/Configurator.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/config/Configurator.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/config/Configurator.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -56,6 +56,10 @@
*/
public class Configurator extends Config
{
+ final static String[] NO_PARAMS = new String[0];
+ final static Object[] NO_PARAM_VALUES = new Object[0];
+
+
/**
* Instantiate and configure a bean
*
@@ -573,7 +577,7 @@
public static String[] getParameterTypes(boolean trace, List<ParameterMetaData> parameters) throws Throwable
{
if (parameters == null)
- return null;
+ return NO_PARAMS;
String[] paramTypes = new String[parameters.size()];
int x = 0;
@@ -596,7 +600,7 @@
public static String[] getParameterTypes(boolean trace, TypeInfo[] parameters) throws Throwable
{
if (parameters == null)
- return null;
+ return NO_PARAMS;
String[] paramTypes = new String[parameters.length];
int x = 0;
@@ -618,7 +622,7 @@
public static Object[] getParameters(boolean trace, ClassLoader cl, TypeInfo[] pinfos, List<ParameterMetaData> parameters) throws Throwable
{
if (parameters == null)
- return null;
+ return NO_PARAM_VALUES;
Object[] params = new Object[parameters.size()];
int x = 0;
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -415,7 +415,7 @@
}
}
- private class ClassContext
+ private static class ClassContext
{
private boolean used;
private Set<KernelControllerContext> contexts;
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/KernelControllerContextActions.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/KernelControllerContextActions.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/KernelControllerContextActions.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -42,10 +42,10 @@
public class KernelControllerContextActions extends AbstractControllerContextActions
{
/** The single instance */
- private static KernelControllerContextActions instance;
+ private static volatile KernelControllerContextActions instance;
/** Actions without instantiate */
- private static KernelControllerContextActions noInstantiate;
+ private static volatile KernelControllerContextActions noInstantiate;
/**
* Get the instance
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/PreInstallAction.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/PreInstallAction.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/PreInstallAction.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -70,11 +70,9 @@
if (factory != null)
return factory;
}
- if (factory == null)
- {
- factory = clazz.newInstance();
- factories.put(clazz, new WeakReference<ScopeFactory<? extends Annotation>>(factory));
- }
+
+ factory = clazz.newInstance();
+ factories.put(clazz, new WeakReference<ScopeFactory<? extends Annotation>>(factory));
return factory;
}
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/PropertiesGraphFactory.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/PropertiesGraphFactory.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/PropertiesGraphFactory.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -24,6 +24,7 @@
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
+import java.util.Map.Entry;
import org.jboss.kernel.plugins.deployment.props.vertex.DefaultVertexFactory;
import org.jboss.kernel.spi.deployment.KernelDeployment;
@@ -82,10 +83,10 @@
protected static Map<String, String> toMap(Properties properties)
{
Map<String, String> map = new TreeMap<String, String>();
- for(Object key : properties.keySet())
+
+ for (Entry<Object, Object> entry : properties.entrySet())
{
- String ks = key.toString();
- map.put(ks, properties.getProperty(ks));
+ map.put(entry.getKey().toString(), (String)entry.getValue());
}
return map;
}
@@ -100,10 +101,9 @@
graph = new Graph<String>();
root = vertexFactory.rootVertex();
graph.setRootVertex(root);
- for(String key : properties.keySet())
+ for(Entry<String, String> entry : properties.entrySet())
{
- String value = properties.get(key);
- buildVertices(root, 0, key, value, 0);
+ buildVertices(root, 0, entry.getKey(), entry.getValue(), 0);
}
}
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/BeanVertexFactory.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/BeanVertexFactory.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/BeanVertexFactory.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -53,7 +53,7 @@
*
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
- class BeanVertex extends TreeVertex<BaseDeploymentVertex>
+ static class BeanVertex extends TreeVertex<BaseDeploymentVertex>
{
private AbstractBeanMetaData beanMetaData;
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/ClassVertexFactory.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/ClassVertexFactory.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/ClassVertexFactory.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -43,7 +43,7 @@
return new ClassVertex(name);
}
- class ClassVertex extends TreeVertex<BeanVertexFactory.BeanVertex>
+ static class ClassVertex extends TreeVertex<BeanVertexFactory.BeanVertex>
{
public ClassVertex(String name)
{
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/HolderVertexFactory.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/HolderVertexFactory.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/HolderVertexFactory.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -46,7 +46,7 @@
/**
* Holder vertex.
*/
- class HolderVertex extends TreeVertex<Vertex<String>>
+ static class HolderVertex extends TreeVertex<Vertex<String>>
{
public HolderVertex(String name)
{
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/LevelVertexFactory.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/LevelVertexFactory.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/LevelVertexFactory.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -21,6 +21,7 @@
*/
package org.jboss.kernel.plugins.deployment.props.vertex;
+import java.io.Serializable;
import java.util.Comparator;
import org.jboss.kernel.plugins.deployment.props.TreeVertex;
@@ -53,8 +54,10 @@
*/
public static Comparator<LevelVertexFactory> COMPARATOR = new LevelVertexFactoryComparator();
- static class LevelVertexFactoryComparator implements Comparator<LevelVertexFactory>
+ static class LevelVertexFactoryComparator implements Comparator<LevelVertexFactory>, Serializable
{
+ private static final long serialVersionUID = 1L;
+
public int compare(LevelVertexFactory o1, LevelVertexFactory o2)
{
return o1.getOrder() - o2.getOrder();
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/PropertyVertexFactory.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/PropertyVertexFactory.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/PropertyVertexFactory.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -47,7 +47,7 @@
/**
* Property vertex.
*/
- class PropertyVertex extends ValueMetaDataAwareVertex<AbstractPropertyMetaData, BeanVertexFactory.BeanVertex>
+ static class PropertyVertex extends ValueMetaDataAwareVertex<AbstractPropertyMetaData, BeanVertexFactory.BeanVertex>
{
public PropertyVertex(String name)
{
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/lazy/JavassistLazyInitializer.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/lazy/JavassistLazyInitializer.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/lazy/JavassistLazyInitializer.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -106,7 +106,7 @@
/**
* Privileged class creator.
*/
- protected class ClassCreator implements PrivilegedAction<Class<?>>
+ protected static class ClassCreator implements PrivilegedAction<Class<?>>
{
private ProxyFactory factory;
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/validation/basic/BasicKernelBeanValidator.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/validation/basic/BasicKernelBeanValidator.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/validation/basic/BasicKernelBeanValidator.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -77,7 +77,7 @@
return Boolean.parseBoolean(System.getProperty(DISABLED_PROPERTY_KEY, "true"));
}
- private class DisabledFlagReader implements PrivilegedAction<Boolean>
+ private static class DisabledFlagReader implements PrivilegedAction<Boolean>
{
public Boolean run()
{
Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/spi/lazy/LazyProxyFactory.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/spi/lazy/LazyProxyFactory.java 2009-10-05 10:11:49 UTC (rev 94349)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/spi/lazy/LazyProxyFactory.java 2009-10-05 10:12:44 UTC (rev 94350)
@@ -36,7 +36,7 @@
*/
public class LazyProxyFactory
{
- private static LazyInitializer initializer;
+ private static volatile LazyInitializer initializer;
private static Map<String, String> initializerMap;
static
Added: projects/kernel/trunk/kernel/src/main/resources/findbugs/exclude.xml
===================================================================
--- projects/kernel/trunk/kernel/src/main/resources/findbugs/exclude.xml (rev 0)
+++ projects/kernel/trunk/kernel/src/main/resources/findbugs/exclude.xml 2009-10-05 10:12:44 UTC (rev 94350)
@@ -0,0 +1,338 @@
+<FindBugsFilter>
+ <!-- Message is: "instanceof will always return true in org.jboss.beans.metadata.plugins.AbstractArrayMetaData.getValue(TypeInfo, ClassLoader),
+ since all org.jboss.reflect.spi.ClassInfo are instances of org.jboss.reflect.spi.ClassInfo"
+ however we are checking if "typeInfo instanceof ClassInfo" and ClassInfo is a sub-interface of TypeInfo -->
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractArrayMetaData"/>
+ <Method name="getValue"/>
+ <Bug pattern="BC_VACUOUS_INSTANCEOF"/>
+ </Match>
+ <!-- There should only be one instance of KernelLocator -->
+ <Match>
+ <Class name="org.jboss.kernel.plugins.util.KernelLocator"/>
+ <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
+ </Match>
+ <!-- Null Object parameter is handled further down -->
+ <Match>
+ <Class name="org.jboss.kernel.plugins.config.Configurator"/>
+ <Method name="getConstructorJoinPoint"/>
+ <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE"/>
+ </Match>
+ <!-- Context will be an instance of KCC -->
+ <Match>
+ <Class name="org.jboss.beans.metadata.api.model.FromContextDelegate$BeanInfoFromContext"/>
+ <Method name="internalExecute"/>
+ <Bug pattern="BC_UNCONFIRMED_CAST"/>
+ </Match>
+ <!-- Don't want to change the interfaces for these existing classes -->
+ <Match>
+ <Or>
+ <Class>org.jboss.beans.metadata.plugins.AbstractBeanMetaData</Class>
+ <Class>org.jboss.beans.metadata.plugins.AbstractCallbackMetaData</Class>
+ <Class>org.jboss.beans.metadata.plugins.AbstractCollectionMetaData</Class>
+ <Class>org.jboss.beans.metadata.plugins.AbstractConstructorMetaData</Class>
+ <Class>org.jboss.beans.metadata.plugins.AbstractInstallMetaData</Class>
+ <Class>org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData</Class>
+ <Class>org.jboss.beans.metadata.plugins.AbstractListMetaData</Class>
+ <Class>org.jboss.beans.metadata.plugins.AbstractMapMetaData</Class>
+ <Class>org.jboss.beans.metadata.plugins.AbstractParameterMetaData</Class>
+ <Class>org.jboss.beans.metadata.plugins.AbstractPropertyMetaData</Class>
+ <Class>org.jboss.beans.metadata.plugins.AbstractSetMetaData</Class>
+ <Class>org.jboss.beans.metadata.plugins.AbstractTypeMetaData</Class>
+ </Or>
+ <Bug pattern="RI_REDUNDANT_INTERFACES"/>
+ </Match>
+ <!-- Allow this safety check -->
+ <Match>
+ <Class name="org.jboss.kernel.plugins.annotations.InjectableMemberAnnotationPlugin"/>
+ <Method name="getPropertyMetaData"/>
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
+ </Match>
+ <!-- These fields are intended to be set by a setter rather than in the constructor -->
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractSearchValueMetaData"/>
+ <Field name="context"/>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.policy.MetaDataRepositoryInstaller"/>
+ <Field name="underlyingKernel"/>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.kernel.plugins.dependency.JNDIKernelRegistryPlugin"/>
+ <Field name="context"/>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+
+ <!-- Has an explicit equals method, the hash code method is implemented via JBossObject + getHashCode() -->
+ <Match>
+ <Or>
+ <Class name="org.jboss.beans.metadata.api.model.FromContextDelegate"/>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractAliasMetaData"/>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData"/>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractDemandMetaData"/>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractDependencyMetaData"/>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractNamedAliasMetaData"/>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractRelatedClassMetaData"/>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractSupplyMetaData"/>
+ <Class name="org.jboss.beans.metadata.plugins.DirectAnnotationMetaData"/>
+ <Class name="org.jboss.kernel.plugins.dependency.CallbackDependencyItem"/>
+ </Or>
+ <Bug pattern="HE_EQUALS_NO_HASHCODE" />
+ </Match>
+
+ <!-- Don't refactor these anonymous inner classes into static inner classes. They all need external stuff -->
+ <Match>
+ <Or>
+ <Class name="~org\.jboss\.beans\.metadata\.plugins\.factory\.GenericBeanFactory\$.*"/>
+ <Class name="~org\.jboss\.kernel\.KernelPermission\$KernelPermissionCollection\$.*"/>
+ <Class name="~org\.jboss\.kernel\.plugins\.registry\.basic\.BasicKernelBus\$.*"/>
+ <Class name="~org\.jboss\.kernel\.plugins\.registry\.basic\.LifecycleAwareKernelBus\$.*"/>
+ </Or>
+ <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
+ </Match>
+
+ <!-- Don't worry about storing externally mutable object in a field -->
+ <Match>
+ <Class name="org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap"/>
+ <Field name="args"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.kernel.plugins.dependency.JNDIKernelRegistryPlugin"/>
+ <Field name="properties"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+
+ <!-- Usage of Class.getResource() is as intended, it should be using the subclasses package name -->
+ <Match>
+ <Class name="org.jboss.test.kernel.junit.MicrocontainerTest"/>
+ <Method name="deploy"/>
+ <Bug pattern="UI_INHERITANCE_UNSAFE_GETRESOURCE"/>
+ </Match>
+
+ <Match>
+ <Class name="org.jboss.test.kernel.junit.MicrocontainerTest"/>
+ <Method name="deploy"/>
+ <Bug pattern="UI_INHERITANCE_UNSAFE_GETRESOURCE"/>
+ </Match>
+
+ <!-- Is option -->
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData"/>
+ <Field name="optionalWhenRequired"/>
+ <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.kernel.plugins.annotations.wb.AnnotationsMatcher"/>
+ <Bug pattern="SE_NO_SUITABLE_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.beans.metadata.plugins.AbstractAnnotationMetaData"/>
+ <Field name="ann"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData"/>
+ <Field name="aliasMetaData"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData"/>
+ <Field name="aliases"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData"/>
+ <Field name="demands"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData"/>
+ <Field name="depends"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData"/>
+ <Field name="installCallbacks"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData"/>
+ <Field name="installs"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData"/>
+ <Field name="properties"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData"/>
+ <Field name="related"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData"/>
+ <Field name="supplies"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData"/>
+ <Field name="uninstallCallbacks"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData"/>
+ <Field name="uninstalls"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractConstructorMetaData"/>
+ <Field name="parameters"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData"/>
+ <Field name="search"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractLazyMetaData"/>
+ <Field name="interfaces"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData"/>
+ <Field name="parameters"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractMapMetaData"/>
+ <Field name="map"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractRelatedClassMetaData"/>
+ <Field name="enabled"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractSearchValueMetaData"/>
+ <Field name="context"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractSearchValueMetaData"/>
+ <Field name="search"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData"/>
+ <Field name="parameters"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.DirectAnnotationMetaData"/>
+ <Field name="annotation"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData"/>
+ <Field name="annotations"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData"/>
+ <Field name="bindings"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData"/>
+ <Field name="aliases"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData"/>
+ <Field name="annotations"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData"/>
+ <Field name="demands"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData"/>
+ <Field name="depends"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData"/>
+ <Field name="installCallbacks"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData"/>
+ <Field name="installs"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData"/>
+ <Field name="properties"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData"/>
+ <Field name="supplies"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData"/>
+ <Field name="uninstallCallbacks"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData"/>
+ <Field name="uninstalls"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.kernel.plugins.annotations.wb.AnnotationsMatcher"/>
+ <Field name="annotations"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.kernel.plugins.annotations.wb.AnnotationsSupply"/>
+ <Field name="annotations"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.kernel.plugins.annotations.wb.WBInjectionValueMetaData"/>
+ <Field name="annotations"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.kernel.plugins.deployment.AbstractKernelDeployment"/>
+ <Field name="aliases"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.kernel.plugins.deployment.AbstractKernelDeployment"/>
+ <Field name="annotations"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Class name="org.jboss.kernel.plugins.deployment.AbstractKernelDeployment"/>
+ <Field name="beanFactories"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+
+
+
+</FindBugsFilter>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list