[jboss-cvs] JBossAS SVN: r94346 - in projects/kernel/trunk/dependency/src/main: java/org/jboss/dependency/plugins and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 5 05:58:07 EDT 2009
Author: kabir.khan at jboss.com
Date: 2009-10-05 05:58:07 -0400 (Mon, 05 Oct 2009)
New Revision: 94346
Added:
projects/kernel/trunk/dependency/src/main/resources/
projects/kernel/trunk/dependency/src/main/resources/findbugs/
projects/kernel/trunk/dependency/src/main/resources/findbugs/exclude.xml
Modified:
projects/kernel/trunk/dependency/src/main/java/org/jboss/dependency/plugins/AbstractController.java
projects/kernel/trunk/dependency/src/main/java/org/jboss/dependency/plugins/StateStatistics.java
Log:
findbugs fixes and exclude file
Modified: projects/kernel/trunk/dependency/src/main/java/org/jboss/dependency/plugins/AbstractController.java
===================================================================
--- projects/kernel/trunk/dependency/src/main/java/org/jboss/dependency/plugins/AbstractController.java 2009-10-05 08:10:03 UTC (rev 94345)
+++ projects/kernel/trunk/dependency/src/main/java/org/jboss/dependency/plugins/AbstractController.java 2009-10-05 09:58:07 UTC (rev 94346)
@@ -112,7 +112,7 @@
private boolean collectStats = false;
/** The install stats */
- private StateStatistics installStats = null;
+ private volatile StateStatistics installStats = null;
/**
* Create an abstract controller
@@ -277,9 +277,12 @@
public String listStateTimes(boolean details)
{
- if (installStats == null)
- return "No statistics available";
- return installStats.listTimes(details);
+ synchronized (this)
+ {
+ if (installStats == null)
+ return "No statistics available";
+ return installStats.listTimes(details);
+ }
}
public void addState(ControllerState state, ControllerState before)
@@ -611,7 +614,7 @@
{
Map<ControllerState, ControllerContextAction> map = createAliasActions();
ControllerContextActions actions = new AbstractControllerContextActions(map);
- AliasControllerContext context = new InnerAliasControllerContext(alias, original, actions);
+ AliasControllerContext context = new InnerAliasControllerContext(alias, getId(), original, actions);
preAliasInstall(context);
install(context);
// is alias in error
@@ -2112,11 +2115,11 @@
// --- alias dependency
- private class InnerAliasControllerContext extends AbstractAliasControllerContext
+ private static class InnerAliasControllerContext extends AbstractAliasControllerContext
{
- private InnerAliasControllerContext(Object alias, Object original, ControllerContextActions actions)
+ private InnerAliasControllerContext(Object alias, String id, Object original, ControllerContextActions actions)
{
- super(alias, getId(), original, actions);
+ super(alias, id, original, actions);
}
}
@@ -2297,7 +2300,7 @@
* Gets the thread that is currently used to install the asyncronous task
* @return The thread, or null if still queued in the executor
*/
- Thread getThread()
+ synchronized Thread getThread()
{
return thread;
}
@@ -2364,7 +2367,7 @@
* It will install the context as far as possible towards its required state,
* before resolving the other contexts.
*/
- class InstallControllerContextTask extends InterruptibleControllerTask implements Runnable
+ class InstallControllerContextTask extends InterruptibleControllerTask
{
ControllerContext context;
ClassLoader classLoader;
Modified: projects/kernel/trunk/dependency/src/main/java/org/jboss/dependency/plugins/StateStatistics.java
===================================================================
--- projects/kernel/trunk/dependency/src/main/java/org/jboss/dependency/plugins/StateStatistics.java 2009-10-05 08:10:03 UTC (rev 94345)
+++ projects/kernel/trunk/dependency/src/main/java/org/jboss/dependency/plugins/StateStatistics.java 2009-10-05 09:58:07 UTC (rev 94346)
@@ -62,7 +62,7 @@
* @param details whether to show details
* @return the times
*/
- public String listTimes(boolean details)
+ public synchronized String listTimes(boolean details)
{
List<StateStatistic> stats = new ArrayList<StateStatistic>(states.values());
Collections.sort(stats);
Added: projects/kernel/trunk/dependency/src/main/resources/findbugs/exclude.xml
===================================================================
--- projects/kernel/trunk/dependency/src/main/resources/findbugs/exclude.xml (rev 0)
+++ projects/kernel/trunk/dependency/src/main/resources/findbugs/exclude.xml 2009-10-05 09:58:07 UTC (rev 94346)
@@ -0,0 +1,33 @@
+<FindBugsFilter>
+ <!-- The non-serializable Map field it complains about is a Collections.singletonMap which is serializable -->
+ <Match>
+ <Class name="org.jboss.dependency.plugins.graph.ScopeKeySearchInfo"/>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <!-- The underlyingController field uninitialised in the constructor is intended to be set by a setter -->
+ <Match>
+ <Class name="org.jboss.dependency.plugins.ScopedController"/>
+ <Field name="underlyingController"/>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+ <!-- Ignore dead local variable storage in the tests -->
+ <Match>
+ <Class name="~org\.jboss\.test\.dependency\.controller\.test.*"/>
+ <Bug pattern="DLS_DEAD_LOCAL_STORE"/>
+ </Match>
+ <!-- Has an explicit equals method, the hash code method is implemented via JBossObject + getHashCode() -->
+ <Match>
+ <Class name="org.jboss.dependency.spi.Cardinality"/>
+ <Bug pattern="HE_EQUALS_NO_HASHCODE" />
+ </Match>
+ <!-- Has an explicit equals method, the hash code method is implemented via JBossObject + getHashCode() -->
+ <Match>
+ <Class name="org.jboss.dependency.spi.ControllerState"/>
+ <Bug pattern="HE_EQUALS_NO_HASHCODE" />
+ </Match>
+ <!-- We have a compareTo method, but no equals() - not relevant in this case -->
+ <Match>
+ <Class name="org.jboss.dependency.plugins.BasicStatistic"/>
+ <Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS" />
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list