Author: dblevins Date: Mon Sep 27 15:28:43 2004 New Revision: 47338 Added: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ExceptionUtil.java - copied, changed from rev 47335, geronimo/trunk/modules/common/src/java/org/apache/geronimo/common/ExceptionUtil.java Removed: geronimo/trunk/modules/common/src/java/org/apache/geronimo/common/ExceptionUtil.java Modified: geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/ClientCommandLine.java geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentException.java geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java Log: Yanked the exception trimming from the exception class and moved it to the command line tools
Modified: geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/ClientCommandLine.java ============================================================================== --- geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/ClientCommandLine.java (original) +++ geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/ClientCommandLine.java Mon Sep 27 15:28:43 2004 @@ -16,11 +16,12 @@ */ package org.apache.geronimo.client; -import java.util.Collections; import java.net.URI; +import java.util.Collections; import javax.management.ObjectName; import org.apache.geronimo.system.main.CommandLine; +import org.apache.geronimo.system.main.ExceptionUtil; /** * @version $Revision$ $Date$ @@ -40,6 +41,7 @@ log.info("Client shutdown completed"); } catch (Exception e) { + ExceptionUtil.trimStackTrace(e); e.printStackTrace(); System.exit(2); throw new AssertionError(); Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentException.java ============================================================================== --- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentException.java (original) +++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentException.java Mon Sep 27 15:28:43 2004 @@ -27,22 +27,18 @@ public DeploymentException() { - ExceptionUtil.trimStackTrace(this); } public DeploymentException(Throwable cause) { super(cause); - ExceptionUtil.trimStackTrace(this); } public DeploymentException(String message) { super(message); - ExceptionUtil.trimStackTrace(this); } public DeploymentException(String message, Throwable cause) { super(message, cause); - ExceptionUtil.trimStackTrace(this); } } Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java ============================================================================== --- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java (original) +++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java Mon Sep 27 15:28:43 2004 @@ -65,6 +65,7 @@ log.info("Server shutdown completed"); } catch (Exception e) { + ExceptionUtil.trimStackTrace(e); e.printStackTrace(); System.exit(2); throw new AssertionError(); Copied: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ExceptionUtil.java (from rev 47335, geronimo/trunk/modules/common/src/java/org/apache/geronimo/common/ExceptionUtil.java) ============================================================================== --- geronimo/trunk/modules/common/src/java/org/apache/geronimo/common/ExceptionUtil.java (original) +++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/ExceptionUtil.java Mon Sep 27 15:28:43 2004 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.geronimo.deployment; +package org.apache.geronimo.system.main; import java.util.ArrayList; @@ -27,6 +27,10 @@ "org.apache.geronimo.gbean.jmx.", "mx4j.", "net.sf.cglib.reflect" }; + private static final String[] excludedStrings = { + "$$EnhancerByCGLIB$$","$$FastClassByCGLIB$$" + }; + public static void trimStackTrace(Throwable t) { if (t == null) { return; @@ -39,6 +43,11 @@ String className = trace[i].getClassName(); for (int j = 0; j < excludedPackages.length; j++) { if (className.startsWith(excludedPackages[j])) { + continue TRIM; + } + } + for (int j = 0; j < excludedStrings.length; j++) { + if (className.indexOf(excludedStrings[j]) != -1) { continue TRIM; } }