[jboss-cvs] JBossAS SVN: r79165 - projects/jboss-deployers/trunk/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Oct 6 15:40:40 EDT 2008


Author: alesj
Date: 2008-10-06 15:40:40 -0400 (Mon, 06 Oct 2008)
New Revision: 79165

Modified:
   projects/jboss-deployers/trunk/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/DeployerTracking.java
Log:
Simplyfy code a bit.

Modified: projects/jboss-deployers/trunk/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/DeployerTracking.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/DeployerTracking.java	2008-10-06 19:20:25 UTC (rev 79164)
+++ projects/jboss-deployers/trunk/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/DeployerTracking.java	2008-10-06 19:40:40 UTC (rev 79165)
@@ -41,24 +41,40 @@
    };
 
    /**
+    * Get the stack.
+    *
+    * @return the stack
+    */
+   private static Stack<String> getStack()
+   {
+      return currentDeployer.get();
+   }
+
+   /**
     * Get the current deployer
     * 
     * @return the name of the current deployer
     */
    public static String getCurrentDeployer()
    {
-      if (currentDeployer.get().isEmpty())
-         return "UNKNOWN";
-      return currentDeployer.get().peek();
+      return (getStack().isEmpty()) ? "UNKNOWN" : getStack().peek();
    }
 
+   /**
+    * Push onto stack.
+    *
+    * @param deployer the current deployer
+    */
    public static void push(String deployer)
    {
-      currentDeployer.get().push(deployer);
+      getStack().push(deployer);
    }
-   
+
+   /**
+    * Pop from the stack.
+    */
    public static void pop()
    {
-      currentDeployer.get().pop();
+      getStack().pop();
    }
 }




More information about the jboss-cvs-commits mailing list