You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by dv...@apache.org on 2007/02/06 12:24:52 UTC
svn commit: r504084 - in /xmlgraphics/batik/trunk/sources/org/apache/batik:
apps/rasterizer/ bridge/ ext/awt/color/ ext/awt/g2d/
ext/awt/image/rendered/ ext/swing/ gvt/ script/rhino/ svggen/
transcoder/svg2svg/
Author: dvholten
Date: Tue Feb 6 03:24:46 2007
New Revision: 504084
URL: http://svn.apache.org/viewvc?view=rev&rev=504084
Log:
1.) remove some more Vector
2.) make a number of 'new Error()' exceptions a little more verbose about their reason
Modified:
xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/DestinationType.java
xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/Main.java
xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/SVGConverter.java
xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/SVGConverterFileSource.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGFeColorMatrixElementBridge.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGFeComponentTransferElementBridge.java
xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUtilities.java
xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/color/ICCColorSpaceExt.java
xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/g2d/AbstractGraphics2D.java
xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/g2d/TransformType.java
xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/rendered/ProfileRed.java
xmlgraphics/batik/trunk/sources/org/apache/batik/ext/swing/DoubleDocument.java
xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/AbstractGraphicsNode.java
xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/CanvasGraphicsNode.java
xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/MarkerShapePainter.java
xmlgraphics/batik/trunk/sources/org/apache/batik/script/rhino/RhinoInterpreter.java
xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGAlphaComposite.java
xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGPath.java
xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGPolygon.java
xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/svg2svg/SVGTranscoder.java
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/DestinationType.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/DestinationType.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/DestinationType.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/DestinationType.java Tue Feb 6 03:24:46 2007
@@ -41,19 +41,19 @@
public static final int JPEG_CODE = 1;
public static final int TIFF_CODE = 2;
public static final int PDF_CODE = 3;
-
+
public static final String PNG_EXTENSION = ".png";
public static final String JPEG_EXTENSION = ".jpg";
public static final String TIFF_EXTENSION = ".tif";
public static final String PDF_EXTENSION = ".pdf";
- public static final DestinationType PNG
+ public static final DestinationType PNG
= new DestinationType(PNG_STR, PNG_CODE, PNG_EXTENSION);
- public static final DestinationType JPEG
+ public static final DestinationType JPEG
= new DestinationType(JPEG_STR, JPEG_CODE, JPEG_EXTENSION);
- public static final DestinationType TIFF
+ public static final DestinationType TIFF
= new DestinationType(TIFF_STR, TIFF_CODE, TIFF_EXTENSION);
- public static final DestinationType PDF
+ public static final DestinationType PDF
= new DestinationType(PDF_STR, PDF_CODE, PDF_EXTENSION);
private String type;
@@ -65,7 +65,7 @@
this.code = code;
this.extension = extension;
}
-
+
public String getExtension(){
return extension;
}
@@ -124,7 +124,7 @@
case PDF_CODE:
return PDF;
default:
- throw new Error();
+ throw new Error("unknown code:" + code );
}
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/Main.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/Main.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/Main.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/Main.java Tue Feb 6 03:24:46 2007
@@ -21,13 +21,12 @@
import java.awt.Color;
import java.awt.geom.Rectangle2D;
import java.io.File;
-import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
import java.util.StringTokenizer;
-import java.util.Vector;
import java.util.List;
import java.util.ArrayList;
+import java.util.HashMap;
import org.apache.batik.transcoder.Transcoder;
import org.apache.batik.parser.ClockHandler;
@@ -516,13 +515,13 @@
* Static map containing all the option handlers able to analyze the
* various options.
*/
- protected static Map optionMap = new Hashtable();
+ protected static Map optionMap = new HashMap();
/**
* Static map containing all the mime types understood by the
* rasterizer
*/
- protected static Map mimeTypeMap = new Hashtable();
+ protected static Map mimeTypeMap = new HashMap();
/**
* Static initializer: adds all the option handlers to the
@@ -834,7 +833,7 @@
}
/**
- * Vector of arguments describing the conversion task to be
+ * List of arguments describing the conversion task to be
* performed.
*/
protected List args;
@@ -878,7 +877,7 @@
public void execute(){
SVGConverter c = new SVGConverter(this);
- Vector sources = new Vector();
+ List sources = new ArrayList();
int nArgs = args.size();
for (int i=0; i<nArgs; i++){
@@ -886,7 +885,7 @@
OptionHandler optionHandler = (OptionHandler)optionMap.get(v);
if (optionHandler == null){
// Assume v is a source.
- sources.addElement(v);
+ sources.add(v);
} else {
// v is an option. Extract the optionValues required
// by the handler.
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/SVGConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/SVGConverter.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/SVGConverter.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/SVGConverter.java Tue Feb 6 03:24:46 2007
@@ -29,7 +29,8 @@
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
-import java.util.Vector;
+import java.util.List;
+import java.util.ArrayList;
import org.apache.batik.transcoder.Transcoder;
import org.apache.batik.transcoder.TranscoderInput;
@@ -254,7 +255,7 @@
protected boolean securityOff = false;
/** Sources files or URLs */
- protected Vector sources = null;
+ protected List sources = null;
/**
* Destination image path. Can be a file (for single source) or
@@ -275,7 +276,7 @@
protected String alternateStylesheet = null;
/** Contents of <tt>fileset</tt> elements. */
- protected Vector files = new Vector();
+ protected List files = new ArrayList();
/**
* Controls some aspects of the converter's operation,
@@ -466,10 +467,10 @@
this.sources = null;
}
else{
- this.sources = new Vector();
+ this.sources = new ArrayList();
for (int i=0; i<sources.length; i++){
if (sources[i] != null){
- this.sources.addElement(sources[i]);
+ this.sources.add(sources[i]);
}
}
@@ -479,7 +480,7 @@
}
}
- public Vector getSources(){
+ public List getSources(){
return sources;
}
@@ -671,13 +672,13 @@
// Compute the set of SVGConverterSource from the source properties
// (srcDir and srcFile);
// This throws an exception if there is not at least one src file.
- Vector sources = computeSources();
+ List sources = computeSources();
// Compute the destination files from dest
- Vector dstFiles = null;
+ List dstFiles = null;
if(sources.size() == 1 && dst != null && isFile(dst)){
- dstFiles = new Vector();
- dstFiles.addElement(dst);
+ dstFiles = new ArrayList();
+ dstFiles.add(dst);
}
else{
dstFiles = computeDstFiles(sources);
@@ -720,9 +721,9 @@
* computed from the names of the files in the sources vector
* and the value of the dst property
*/
- protected Vector computeDstFiles(Vector sources)
+ protected List computeDstFiles(List sources)
throws SVGConverterException {
- Vector dstFiles = new Vector();
+ List dstFiles = new ArrayList();
if (dst != null) {
if (dst.exists() && dst.isFile()) {
throw new SVGConverterException(ERROR_CANNOT_USE_DST_FILE);
@@ -738,7 +739,7 @@
// Generate output filename from input filename.
File outputName = new File(dst.getPath(),
getDestinationFile(src.getName()));
- dstFiles.addElement(outputName);
+ dstFiles.add(outputName);
}
} else {
@@ -759,7 +760,7 @@
SVGConverterFileSource fs = (SVGConverterFileSource)src;
File outputName = new File(fs.getFile().getParent(),
getDestinationFile(src.getName()));
- dstFiles.addElement(outputName);
+ dstFiles.add(outputName);
}
}
@@ -772,8 +773,8 @@
* srcDir if it is not null and with the sources (files or URLs)
* if any.
*/
- protected Vector computeSources() throws SVGConverterException{
- Vector sources = new Vector();
+ protected List computeSources() throws SVGConverterException{
+ List sources = new ArrayList();
// Check that at least one source has been specified.
if (this.sources == null){
@@ -785,14 +786,14 @@
String sourceString = (String)(this.sources.get(i));
File file = new File(sourceString);
if (file.exists()) {
- sources.addElement(new SVGConverterFileSource(file));
+ sources.add(new SVGConverterFileSource(file));
} else {
String[] fileNRef = getFileNRef(sourceString);
file = new File(fileNRef[0]);
if (file.exists()){
- sources.addElement(new SVGConverterFileSource(file, fileNRef[1]));
+ sources.add(new SVGConverterFileSource(file, fileNRef[1]));
} else{
- sources.addElement(new SVGConverterURLSource(sourceString));
+ sources.add(new SVGConverterURLSource(sourceString));
}
}
}
@@ -821,7 +822,7 @@
* Computes the set of transcoding hints to use for the operation
*/
protected Map computeTranscodingHints(){
- HashMap map = new HashMap();
+ Map map = new HashMap();
// Set AOI. ----------------------------------------------------------
if (area != null) {
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/SVGConverterFileSource.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/SVGConverterFileSource.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/SVGConverterFileSource.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/rasterizer/SVGConverterFileSource.java Tue Feb 6 03:24:46 2007
@@ -67,7 +67,7 @@
}
return uri;
} catch(MalformedURLException e){
- throw new Error();
+ throw new Error( e.getMessage() );
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGFeColorMatrixElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGFeColorMatrixElementBridge.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGFeColorMatrixElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGFeColorMatrixElementBridge.java Tue Feb 6 03:24:46 2007
@@ -119,7 +119,7 @@
colorMatrix = ColorMatrixRable8Bit.buildSaturate(s);
break;
default:
- throw new Error(); // can't be reached
+ throw new Error("invalid convertType:" + type ); // can't be reached
}
colorMatrix.setSource(in);
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGFeComponentTransferElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGFeComponentTransferElementBridge.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGFeComponentTransferElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGFeComponentTransferElementBridge.java Tue Feb 6 03:24:46 2007
@@ -292,7 +292,7 @@
}
}
default:
- throw new Error(); // can't be reached
+ throw new Error("invalid convertType:" + type ); // can't be reached
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUtilities.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUtilities.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUtilities.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGUtilities.java Tue Feb 6 03:24:46 2007
@@ -905,7 +905,7 @@
}
break;
default:
- throw new Error(); // can't be reached
+ throw new Error("invalid unitsType:" + unitsType ); // can't be reached
}
Rectangle2D region = new Rectangle2D.Double(x, y, w, h);
@@ -1089,7 +1089,7 @@
(hStr, SVG_HEIGHT_ATTRIBUTE, uctx);
break;
default:
- throw new Error(); // can't be reached
+ throw new Error("invalid unitsType:" + unitsType ); // can't be reached
}
return new Rectangle2D.Double(x, y, w, h);
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/color/ICCColorSpaceExt.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/color/ICCColorSpaceExt.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/color/ICCColorSpaceExt.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/color/ICCColorSpaceExt.java Tue Feb 6 03:24:46 2007
@@ -23,7 +23,7 @@
import java.awt.color.ICC_Profile;
/**
- * This class extends the ICCColorSpace class by providing
+ * This class extends the ICCColorSpace class by providing
* convenience methods to convert to sRGB using various
* methods, forcing a givent intent, such as perceptual or
* relative colorimetric.
@@ -40,7 +40,7 @@
static final ColorSpace sRGB = ColorSpace.getInstance(ColorSpace.CS_sRGB);
int intent;
-
+
public ICCColorSpaceExt(ICC_Profile p, int intent){
super(p);
@@ -66,8 +66,8 @@
}
/**
- * Returns the sRGB value obtained by forcing the
- * conversion method to the intent passed to the
+ * Returns the sRGB value obtained by forcing the
+ * conversion method to the intent passed to the
* constructor
*/
public float[] intendedToRGB(float[] values){
@@ -82,7 +82,7 @@
case SATURATION:
return saturationToRGB(values);
default:
- throw new Error();
+ throw new Error("invalid intent:" + intent );
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/g2d/AbstractGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/g2d/AbstractGraphics2D.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/g2d/AbstractGraphics2D.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/g2d/AbstractGraphics2D.java Tue Feb 6 03:24:46 2007
@@ -880,7 +880,7 @@
} catch(NoninvertibleTransformException e){
// Should never happen since we checked the
// matrix determinant
- throw new Error();
+ throw new Error( e.getMessage() );
}
gc.transform(xform);
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/g2d/TransformType.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/g2d/TransformType.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/g2d/TransformType.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/g2d/TransformType.java Tue Feb 6 03:24:46 2007
@@ -105,7 +105,7 @@
case TRANSFORM_GENERAL:
return TransformType.GENERAL;
default:
- throw new Error("Unknown TransformType value");
+ throw new Error("Unknown TransformType value:" + val );
}
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/rendered/ProfileRed.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/rendered/ProfileRed.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/rendered/ProfileRed.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/image/rendered/ProfileRed.java Tue Feb 6 03:24:46 2007
@@ -275,7 +275,7 @@
return argbWR;
}catch(Exception e){
e.printStackTrace();
- throw new Error();
+ throw new Error( e.getMessage() );
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/ext/swing/DoubleDocument.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/swing/DoubleDocument.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/ext/swing/DoubleDocument.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/ext/swing/DoubleDocument.java Tue Feb 6 03:24:46 2007
@@ -101,7 +101,7 @@
}catch(BadLocationException e){
// Will not happen because we are sure
// we use the proper range
- throw new Error();
+ throw new Error( e.getMessage() );
}
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/AbstractGraphicsNode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/AbstractGraphicsNode.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/AbstractGraphicsNode.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/AbstractGraphicsNode.java Tue Feb 6 03:24:46 2007
@@ -193,7 +193,7 @@
inverseTransform = transform.createInverse();
}catch(NoninvertibleTransformException e){
// Should never happen.
- throw new Error();
+ throw new Error( e.getMessage() );
}
} else {
// The transform is not invertible. Use the same
@@ -370,7 +370,7 @@
* @param newFilter the new filter of this node
*/
public void setFilter(Filter newFilter) {
- if ((newFilter == null) && (filter == null))
+ if ((newFilter == null) && (filter == null))
return; // No change still no filter.
fireGraphicsNodeChangeStarted();
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/CanvasGraphicsNode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/CanvasGraphicsNode.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/CanvasGraphicsNode.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/CanvasGraphicsNode.java Tue Feb 6 03:24:46 2007
@@ -46,7 +46,7 @@
*/
protected AffineTransform viewingTransform;
- /**
+ /**
* The background of this canvas graphics node.
*/
protected Paint backgroundPaint;
@@ -88,13 +88,13 @@
transform = new AffineTransform(viewingTransform);
else
transform = new AffineTransform();
-
+
if (transform.getDeterminant() != 0){
try{
inverseTransform = transform.createInverse();
}catch(NoninvertibleTransformException e){
// Should never happen.
- throw new Error();
+ throw new Error( e.getMessage() );
}
}
else{
@@ -127,7 +127,7 @@
inverseTransform = transform.createInverse();
}catch(NoninvertibleTransformException e){
// Should never happen.
- throw new Error();
+ throw new Error( e.getMessage() );
}
}
else{
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/MarkerShapePainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/MarkerShapePainter.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/MarkerShapePainter.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/gvt/MarkerShapePainter.java Tue Feb 6 03:24:46 2007
@@ -686,7 +686,7 @@
break;
case PathIterator.SEG_CLOSE:
// Should not have any close at this point
- throw new Error();
+ throw new Error("should not have SEG_CLOSE here");
case PathIterator.SEG_MOVETO:
// Cannot compute the slope
default:
@@ -825,7 +825,7 @@
return new Point2D.Double(coords[5], coords[6]);
case PathIterator.SEG_CLOSE:
default:
- throw new Error();
+ throw new Error( "invalid segmentType:" + segType );
// Should never happen: close segments are replaced with lineTo
}
}
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/script/rhino/RhinoInterpreter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/script/rhino/RhinoInterpreter.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/script/rhino/RhinoInterpreter.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/script/rhino/RhinoInterpreter.java Tue Feb 6 03:24:46 2007
@@ -154,7 +154,7 @@
* @see org.apache.batik.script.InterpreterPool
*/
public RhinoInterpreter(URL documentURL) {
- try {
+ try {
rhinoClassLoader = new RhinoClassLoader
(documentURL, getClass().getClassLoader());
} catch (SecurityException se) {
@@ -328,9 +328,9 @@
return cx.compileReader
(new StringReader(scriptStr),
SOURCE_NAME_SVG, 1, rhinoClassLoader);
- } catch (IOException ie) {
+ } catch (IOException ioEx ) {
// Should never happen: using a string
- throw new Error();
+ throw new Error( ioEx.getMessage() );
}
}
};
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGAlphaComposite.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGAlphaComposite.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGAlphaComposite.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGAlphaComposite.java Tue Feb 6 03:24:46 2007
@@ -225,7 +225,7 @@
id = ID_PREFIX_ALPHA_COMPOSITE_DST_OVER;
break;
default:
- throw new Error();
+ throw new Error("invalid rule:" + composite.getRule() );
}
Element compositeFilter =
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGPath.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGPath.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGPath.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGPath.java Tue Feb 6 03:24:46 2007
@@ -113,7 +113,7 @@
appendPoint(d, seg[4], seg[5], gc);
break;
default:
- throw new Error();
+ throw new Error("invalid segmentType:" + segType );
}
pi.next();
} // while !isDone
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGPolygon.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGPolygon.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGPolygon.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/svggen/SVGPolygon.java Tue Feb 6 03:24:46 2007
@@ -62,7 +62,7 @@
case PathIterator.SEG_QUADTO:
case PathIterator.SEG_CUBICTO:
default:
- throw new Error();
+ throw new Error("invalid segmentType:" + segType );
}
pi.next();
} // while !isDone
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/svg2svg/SVGTranscoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/svg2svg/SVGTranscoder.java?view=diff&rev=504084&r1=504083&r2=504084
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/svg2svg/SVGTranscoder.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/svg2svg/SVGTranscoder.java Tue Feb 6 03:24:46 2007
@@ -172,11 +172,11 @@
if (d == null) {
throw new Error("Reader or Document expected");
}
- StringWriter sw = new StringWriter();
+ StringWriter sw = new StringWriter( 1024 );
try {
DOMUtilities.writeDocument(d, sw);
- } catch (IOException e) {
- throw new Error("IO");
+ } catch ( IOException ioEx ) {
+ throw new Error("IO:" + ioEx.getMessage() );
}
r = new StringReader(sw.toString());
}
@@ -247,8 +247,8 @@
* To represent a newline value.
*/
protected static class NewlineValue {
- protected String value;
- public NewlineValue(String val) {
+ protected final String value;
+ protected NewlineValue(String val) {
value = val;
}
public String getValue() {
@@ -269,8 +269,8 @@
* To represent a doctype value.
*/
protected static class DoctypeValue {
- int value;
- public DoctypeValue(int value) {
+ final int value;
+ protected DoctypeValue(int value) {
this.value = value;
}
public int getValue() {