pbwest 2003/07/10 04:26:29
Modified: src/java/org/apache/fop/apps Tag: FOP_0-20-0_Alt-Design
Fop.java FOPException.java CommandLineStarter.java
Log:
Responded to some style complaints.
Revision Changes Path
No revision
No revision
1.1.2.2 +29 -26 xml-fop/src/java/org/apache/fop/apps/Fop.java
Index: Fop.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Fop.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- Fop.java 5 Jul 2003 19:04:50 -0000 1.1.2.1
+++ Fop.java 10 Jul 2003 11:26:28 -0000 1.1.2.2
@@ -65,48 +65,48 @@
public static void main(String[] args) {
- long endtotal, endfree, gctotal, gcfree;
+ long endtotal, endfree, gctotal, gcfree;
Driver driver;
Boolean bool = null;
- runtime = Runtime.getRuntime();
- startTotal = runtime.totalMemory();
- startFree = runtime.freeMemory();
- startTime = System.currentTimeMillis();
+ runtime = Runtime.getRuntime();
+ startTotal = runtime.totalMemory();
+ startFree = runtime.freeMemory();
+ startTime = System.currentTimeMillis();
try {
Options.configure(args);
driver = new Driver();
driver.run();
System.out.println("Back from driver.run()");
- System.out.println("Elapsed time: " +
- (System.currentTimeMillis() - startTime));
- endtotal = runtime.totalMemory();
- endfree = runtime.freeMemory();
- System.gc();
- gctotal = runtime.totalMemory();
- gcfree = runtime.freeMemory();
- System.out.println("Total memory before run : " + startTotal);
- System.out.println("Total memory after run : " + endtotal);
- System.out.println("Total memory after GC : " + gctotal);
- System.out.println("Diff before/after total : "
+ System.out.println("Elapsed time: " +
+ (System.currentTimeMillis() - startTime));
+ endtotal = runtime.totalMemory();
+ endfree = runtime.freeMemory();
+ System.gc();
+ gctotal = runtime.totalMemory();
+ gcfree = runtime.freeMemory();
+ System.out.println("Total memory before run : " + startTotal);
+ System.out.println("Total memory after run : " + endtotal);
+ System.out.println("Total memory after GC : " + gctotal);
+ System.out.println("Diff before/after total : "
+ (endtotal - startTotal));
- System.out.println("Diff before/GC total : "
+ System.out.println("Diff before/GC total : "
+ (gctotal - startTotal));
- System.out.println("Diff after/GC total : "
+ System.out.println("Diff after/GC total : "
+ (gctotal - endtotal));
- System.out.println("Free memory before run : " + startFree);
- System.out.println("Free memory after run : " + endfree);
- System.out.println("Free memory after GC : " + gcfree);
- System.out.println("Diff before/after free : "
+ System.out.println("Free memory before run : " + startFree);
+ System.out.println("Free memory after run : " + endfree);
+ System.out.println("Free memory after GC : " + gcfree);
+ System.out.println("Diff before/after free : "
+ (endfree - startFree));
- System.out.println("Diff before/GC free : "
+ System.out.println("Diff before/GC free : "
+ (gcfree - startFree));
- System.out.println("Diff after/GC free : "
+ System.out.println("Diff after/GC free : "
+ (gcfree - endfree));
- System.out.println("cg() freed : "
+ System.out.println("cg() freed : "
+ (gcfree - endfree));
- //System.out.println("PC time : " + (endPCi - startPCi));
+ //System.out.println("PC time : " + (endPCi - startPCi));
} catch (FOPException e) {
MessageHandler.errorln("ERROR: " + e.getMessage());
@@ -121,6 +121,9 @@
e.printStackTrace();
}
}
+ }
+
+ private Fop() {
}
}
1.2.2.2 +40 -15 xml-fop/src/java/org/apache/fop/apps/FOPException.java
Index: FOPException.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/FOPException.java,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -r1.2.2.1 -r1.2.2.2
--- FOPException.java 5 Jul 2003 19:04:50 -0000 1.2.2.1
+++ FOPException.java 10 Jul 2003 11:26:28 -0000 1.2.2.2
@@ -57,14 +57,15 @@
/**
* Exception thrown when FOP has a problem
+ * @author pbw
*/
public class FOPException extends Exception {
- private static final String tag = "$Name$";
- private static final String revision = "$Revision$";
+ private static final String TAG = "$Name$";
+ private static final String REVISION = "$Revision$";
private static final String EXCEPTION_SEPARATOR = "\n---------\n";
- private Throwable _exception;
+ private Throwable exception;
/**
* create a new FOP Exception
@@ -75,47 +76,68 @@
super(message);
}
+ /**
+ * create a new FOP Exception
+ *
+ * @param e incoming Throwable
+ */
public FOPException(Throwable e) {
super(e.getMessage());
setException(e);
}
+ /**
+ * @param message
+ * @param e
+ */
public FOPException(String message, Throwable e) {
super(message);
setException(e);
}
+ /**
+ * @param t
+ */
protected void setException(Throwable t) {
- _exception = t;
+ exception = t;
}
+ /**
+ * @return
+ */
public Throwable getException() {
- return _exception;
+ return exception;
}
+ /**
+ * @return
+ */
protected Throwable getRootException() {
- Throwable result = _exception;
+ Throwable result = exception;
if (result instanceof SAXException) {
result = ((SAXException)result).getException();
}
if (result instanceof java.lang.reflect.InvocationTargetException) {
- result =
-
((java.lang.reflect.InvocationTargetException)result).getTargetException();
+ result = ((java.lang.reflect.InvocationTargetException)result)
+ .getTargetException();
}
- if (result != _exception) {
+ if (result != exception) {
return result;
}
return null;
}
+ /* (non-Javadoc)
+ * @see java.lang.Throwable#printStackTrace()
+ */
public void printStackTrace() {
synchronized (System.err) {
super.printStackTrace();
- if (_exception != null) {
+ if (exception != null) {
System.err.println(EXCEPTION_SEPARATOR);
- _exception.printStackTrace();
+ exception.printStackTrace();
}
if (getRootException() != null) {
System.err.println(EXCEPTION_SEPARATOR);
@@ -127,9 +149,9 @@
public void printStackTrace(java.io.PrintStream stream) {
synchronized (stream) {
super.printStackTrace(stream);
- if (_exception != null) {
+ if (exception != null) {
stream.println(EXCEPTION_SEPARATOR);
- _exception.printStackTrace(stream);
+ exception.printStackTrace(stream);
}
if (getRootException() != null) {
System.err.println(EXCEPTION_SEPARATOR);
@@ -138,12 +160,15 @@
}
}
+ /* (non-Javadoc)
+ * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter)
+ */
public void printStackTrace(java.io.PrintWriter writer) {
synchronized (writer) {
super.printStackTrace(writer);
- if (_exception != null) {
+ if (exception != null) {
writer.println(EXCEPTION_SEPARATOR);
- _exception.printStackTrace(writer);
+ exception.printStackTrace(writer);
}
if (getRootException() != null) {
System.err.println(EXCEPTION_SEPARATOR);
1.3.2.2 +9 -0 xml-fop/src/java/org/apache/fop/apps/CommandLineStarter.java
Index: CommandLineStarter.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/CommandLineStarter.java,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -r1.3.2.1 -r1.3.2.2
--- CommandLineStarter.java 5 Jul 2003 19:04:50 -0000 1.3.2.1
+++ CommandLineStarter.java 10 Jul 2003 11:26:28 -0000 1.3.2.2
@@ -52,8 +52,17 @@
package org.apache.fop.apps;
+/**
+ * A vestigal class left after initial alt.design hacking.
+ * @author pbw
+ */
public class CommandLineStarter {
+ /**
+ * Empty constructor.
+ *
+ * @throws FOPException
+ */
public CommandLineStarter() throws FOPException {
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]