[jboss-cvs] JBossAS SVN: r95578 - in projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager: exception and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 26 16:06:06 EDT 2009
Author: gurkanerdogdu
Date: 2009-10-26 16:06:06 -0400 (Mon, 26 Oct 2009)
New Revision: 95578
Modified:
projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/ConnectionValidator.java
projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/IdleRemover.java
projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/exception/JBossLocalXAExceptionFormatter.java
projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/InternalManagedConnectionPool.java
projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/xa/XidWrapperImpl.java
Log:
Decrease number of findbugs problems.
Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/ConnectionValidator.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/ConnectionValidator.java 2009-10-26 19:56:58 UTC (rev 95577)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/ConnectionValidator.java 2009-10-26 20:06:06 UTC (rev 95578)
@@ -173,15 +173,29 @@
return;
}
- AccessController.doPrivileged(new PrivilegedAction<Object>()
+ AccessController.doPrivileged(new ClassLoaderAction(cl));
+
+ }
+
+ /**
+ * Priviledge action.
+ */
+ private static class ClassLoaderAction implements PrivilegedAction<Object>
+ {
+ private ClassLoader classLoader;
+
+ public ClassLoaderAction(ClassLoader cl)
{
- public Object run()
- {
- Thread.currentThread().setContextClassLoader(cl);
-
- return null;
- }
- });
+ this.classLoader = cl;
+ }
+
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+
+ return null;
+ }
+
}
/**
Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/IdleRemover.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/IdleRemover.java 2009-10-26 19:56:58 UTC (rev 95577)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/IdleRemover.java 2009-10-26 20:06:06 UTC (rev 95578)
@@ -171,18 +171,33 @@
return;
}
- AccessController.doPrivileged(new PrivilegedAction<Object>()
- {
- public Object run()
- {
- Thread.currentThread().setContextClassLoader(cl);
-
- return null;
- }
- });
+ AccessController.doPrivileged(new ClassLoaderAction(cl));
+
}
/**
+ * Priviledge action.
+ */
+ private static class ClassLoaderAction implements PrivilegedAction<Object>
+ {
+ private ClassLoader classLoader;
+
+ public ClassLoaderAction(ClassLoader cl)
+ {
+ this.classLoader = cl;
+ }
+
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+
+ return null;
+ }
+
+ }
+
+
+ /**
* Wait for background thread.
*/
public static void waitForBackgroundThread()
Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/exception/JBossLocalXAExceptionFormatter.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/exception/JBossLocalXAExceptionFormatter.java 2009-10-26 19:56:58 UTC (rev 95577)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/exception/JBossLocalXAExceptionFormatter.java 2009-10-26 20:06:06 UTC (rev 95578)
@@ -51,13 +51,13 @@
*/
public void formatXAException(XAException xae, Logger log)
{
- try
+ if (xae instanceof JBossLocalXAException)
{
- log.warn("JBoss Local XA wrapper error: ", ((JBossLocalXAException) xae).getCause());
+ log.warn("JBoss Local XA wrapper error: ", ((JBossLocalXAException) xae).getCause());
}
- catch (Exception e)
+ else
{
- log.warn("Problem trying to format XAException: ", e);
+ log.warn("Problem trying to format XAException: ", xae);
}
}
}
Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/InternalManagedConnectionPool.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/InternalManagedConnectionPool.java 2009-10-26 19:56:58 UTC (rev 95577)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/InternalManagedConnectionPool.java 2009-10-26 20:06:06 UTC (rev 95578)
@@ -292,8 +292,7 @@
this.checkedOut.remove(connectionListener);
//Destroy it
- doDestroy(connectionListener);
- connectionListener = null;
+ doDestroy(connectionListener);
}
/**
Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/xa/XidWrapperImpl.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/xa/XidWrapperImpl.java 2009-10-26 19:56:58 UTC (rev 95577)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/connectionmanager/xa/XidWrapperImpl.java 2009-10-26 20:06:06 UTC (rev 95578)
@@ -151,12 +151,8 @@
StringBuffer buffer = new StringBuffer();
buffer.append("XidWrapper[FormatId=").append(getFormatId());
buffer.append(" GlobalId=").append(new String(getGlobalTransactionId()).trim());
- byte[] branchQualifer = getBranchQualifier();
buffer.append(" BranchQual=");
- if (branchQualifer == null)
- buffer.append("null");
- else
- buffer.append(new String(getBranchQualifier()).trim());
+ buffer.append(new String(getBranchQualifier()).trim());
buffer.append(']');
cachedToString = buffer.toString();
}
More information about the jboss-cvs-commits
mailing list