xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sstei...@apache.org
Subject svn commit: r1681108 [3/3] - in /xmlgraphics/commons/trunk: ./ src/java/org/apache/xmlgraphics/fonts/ src/java/org/apache/xmlgraphics/image/codec/png/ src/java/org/apache/xmlgraphics/image/codec/tiff/ src/java/org/apache/xmlgraphics/image/codec/util/ s...
Date Fri, 22 May 2015 13:26:13 GMT
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBeginDocument.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBeginDocument.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBeginDocument.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBeginDocument.java
Fri May 22 13:26:12 2015
@@ -107,7 +107,7 @@ public class DSCCommentBeginDocument ext
         String name = (String)iter.next();
         this.resource = new PSResource(PSResource.TYPE_FILE, name);
         if (iter.hasNext()) {
-            this.version = new Float(iter.next().toString());
+            this.version = Float.valueOf(iter.next().toString());
             this.type = null;
             if (iter.hasNext()) {
                 this.type = (String)iter.next();

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBeginResource.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBeginResource.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBeginResource.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBeginResource.java
Fri May 22 13:26:12 2015
@@ -56,8 +56,8 @@ public class DSCCommentBeginResource ext
      */
     public DSCCommentBeginResource(PSResource resource, int min, int max) {
         super(resource);
-        this.min = new Integer(min);
-        this.max = new Integer(max);
+        this.min = min;
+        this.max = max;
     }
 
     /**

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBoundingBox.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBoundingBox.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBoundingBox.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentBoundingBox.java
Fri May 22 13:26:12 2015
@@ -90,10 +90,10 @@ public class DSCCommentBoundingBox exten
     public void generate(PSGenerator gen) throws IOException {
         if (getBoundingBox() != null) {
             gen.writeDSCComment(getName(), new Object[] {
-                new Integer((int)Math.floor(this.bbox.getX())),
-                new Integer((int)Math.floor(this.bbox.getY())),
-                new Integer((int)Math.ceil(this.bbox.getX() + this.bbox.getWidth())),
-                new Integer((int)Math.ceil(this.bbox.getY() + this.bbox.getHeight()))});
+                    (int) Math.floor(this.bbox.getX()),
+                    (int) Math.floor(this.bbox.getY()),
+                    (int) Math.ceil(this.bbox.getX() + this.bbox.getWidth()),
+                    (int) Math.ceil(this.bbox.getY() + this.bbox.getHeight())});
         } else {
             gen.writeDSCComment(getName(), DSCConstants.ATEND);
         }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentHiResBoundingBox.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentHiResBoundingBox.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentHiResBoundingBox.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentHiResBoundingBox.java
Fri May 22 13:26:12 2015
@@ -54,10 +54,10 @@ public class DSCCommentHiResBoundingBox
     public void generate(PSGenerator gen) throws IOException {
         if (getBoundingBox() != null) {
             gen.writeDSCComment(getName(), new Object[] {
-                new Double(getBoundingBox().getX()),
-                new Double(getBoundingBox().getY()),
-                new Double(getBoundingBox().getX() + getBoundingBox().getWidth()),
-                new Double(getBoundingBox().getY() + getBoundingBox().getHeight())});
+                    getBoundingBox().getX(),
+                    getBoundingBox().getY(),
+                    getBoundingBox().getX() + getBoundingBox().getWidth(),
+                    getBoundingBox().getY() + getBoundingBox().getHeight()});
         } else {
             gen.writeDSCComment(getName(), DSCConstants.ATEND);
         }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentLanguageLevel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentLanguageLevel.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentLanguageLevel.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentLanguageLevel.java
Fri May 22 13:26:12 2015
@@ -81,7 +81,7 @@ public class DSCCommentLanguageLevel ext
         if (level <= 0) {
             throw new IllegalStateException("Language Level was not properly set");
         }
-        gen.writeDSCComment(getName(), new Integer(getLanguageLevel()));
+        gen.writeDSCComment(getName(), getLanguageLevel());
     }
 
 }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentPage.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentPage.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentPage.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentPage.java
Fri May 22 13:26:12 2015
@@ -123,7 +123,7 @@ public class DSCCommentPage extends Abst
      */
     public void generate(PSGenerator gen) throws IOException {
         gen.writeDSCComment(getName(),
-                new Object[] {getPageName(), new Integer(getPagePosition())});
+                new Object[] {getPageName(), getPagePosition()});
     }
 
 }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentPages.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentPages.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentPages.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/DSCCommentPages.java
Fri May 22 13:26:12 2015
@@ -87,7 +87,7 @@ public class DSCCommentPages extends Abs
      */
     public void generate(PSGenerator gen) throws IOException {
         if (getPageCount() > 0) {
-            gen.writeDSCComment(getName(), new Integer(getPageCount()));
+            gen.writeDSCComment(getName(), getPageCount());
         } else {
             gen.writeDSCComment(getName(), DSCConstants.ATEND);
         }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/PostScriptComment.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/PostScriptComment.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/PostScriptComment.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/events/PostScriptComment.java
Fri May 22 13:26:12 2015
@@ -36,7 +36,7 @@ public class PostScriptComment extends A
      */
     public PostScriptComment(String comment) {
         if (comment != null && comment.startsWith("%")) {
-            this.comment = this.comment.substring(1);
+            this.comment = comment.substring(1);
         } else {
             this.comment = comment;
         }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/DSCTools.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/DSCTools.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/DSCTools.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/dsc/tools/DSCTools.java Fri
May 22 13:26:12 2015
@@ -52,6 +52,7 @@ public final class DSCTools implements D
             DSCComment comment = event.asDSCComment();
             return (comment.getName().equals(DSCConstants.END_COMMENTS));
         case COMMENT:
+            assert event instanceof PostScriptComment;
             String s = ((PostScriptComment)event).getComment();
             if (s == null || s.length() == 0) {
                 return true;

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/ImageIODebugUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/ImageIODebugUtil.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/ImageIODebugUtil.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/ImageIODebugUtil.java Fri
May 22 13:26:12 2015
@@ -25,6 +25,8 @@ import javax.xml.transform.OutputKeys;
 import javax.xml.transform.Result;
 import javax.xml.transform.Source;
 import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
@@ -60,8 +62,9 @@ public final class ImageIODebugUtil {
             Source src = new DOMSource(node);
             Result res = new StreamResult(System.out);
             t.transform(src, res);
-            System.out.println();
-        } catch (Exception e) {
+        } catch (TransformerConfigurationException e) {
+            e.printStackTrace();
+        } catch (TransformerException e) {
             e.printStackTrace();
         }
     }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/UnitConv.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/UnitConv.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/UnitConv.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/UnitConv.java Fri May 22
13:26:12 2015
@@ -20,6 +20,7 @@
 package org.apache.xmlgraphics.util;
 
 import java.awt.geom.AffineTransform;
+import java.util.Locale;
 
 /**
  * Utility class for unit conversions.
@@ -189,24 +190,24 @@ public final class UnitConv {
     public static int convert(String value) {
         double retValue = 0;
         if (value != null) {
-            if (value.toLowerCase().indexOf(PX) > 0) {
+            if (value.toLowerCase(Locale.getDefault()).indexOf(PX) >= 0) {
                 retValue = Double.parseDouble(value.substring(0, value.length() - 2));
                 retValue *= 1000;
-            } else if (value.toLowerCase().indexOf(INCH) > 0) {
+            } else if (value.toLowerCase(Locale.getDefault()).indexOf(INCH) >= 0) {
                 retValue = Double.parseDouble(value.substring(0, value.length() - 2));
                 retValue *= 72000;
-            } else if (value.toLowerCase().indexOf(CM) > 0) {
+            } else if (value.toLowerCase(Locale.getDefault()).indexOf(CM) >= 0) {
                 retValue = Double.parseDouble(value.substring(0, value.length() - 2));
                 retValue *= 28346.4567;
-            } else if (value.toLowerCase().indexOf(MM) > 0) {
+            } else if (value.toLowerCase(Locale.getDefault()).indexOf(MM) >= 0) {
                 retValue = Double.parseDouble(value.substring(0, value.length() - 2));
                 retValue *= 2834.64567;
-            } else if (value.toLowerCase().indexOf(MPT) > 0) {
+            } else if (value.toLowerCase(Locale.getDefault()).indexOf(MPT) >= 0) {
                 retValue = Double.parseDouble(value.substring(0, value.length() - 3));
-            } else if (value.toLowerCase().indexOf(POINT) > 0) {
+            } else if (value.toLowerCase(Locale.getDefault()).indexOf(POINT) >= 0) {
                 retValue = Double.parseDouble(value.substring(0, value.length() - 2));
                 retValue *= 1000;
-            } else if (value.toLowerCase().indexOf(PICA) > 0) {
+            } else if (value.toLowerCase(Locale.getDefault()).indexOf(PICA) >= 0) {
                 retValue = Double.parseDouble(value.substring(0, value.length() - 2));
                 retValue *= 12000;
             }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/WriterOutputStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/WriterOutputStream.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/WriterOutputStream.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/WriterOutputStream.java
Fri May 22 13:26:12 2015
@@ -70,7 +70,7 @@ public class WriterOutputStream extends
         if (encoding != null) {
             writer.write(new String(buf, offset, length, encoding));
         } else {
-            writer.write(new String(buf, offset, length));
+            writer.write(new String(buf, offset, length, "UTF-8"));
         }
     }
 

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/dijkstra/DijkstraAlgorithm.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/dijkstra/DijkstraAlgorithm.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/dijkstra/DijkstraAlgorithm.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/dijkstra/DijkstraAlgorithm.java
Fri May 22 13:26:12 2015
@@ -185,7 +185,7 @@ public class DijkstraAlgorithm {
         priorityQueue.remove(vertex);
 
         //Update the lowest penalty.
-        lowestPenalties.put(vertex, new Integer(distance));
+        lowestPenalties.put(vertex, distance);
 
         //Insert the vertex again at the new position based on the lowest penalty
         priorityQueue.add(vertex);
@@ -199,7 +199,7 @@ public class DijkstraAlgorithm {
      */
     public int getLowestPenalty(Vertex vertex) {
         Integer d = ((Integer)lowestPenalties.get(vertex));
-        return (d == null) ? INFINITE : d.intValue();
+        return (d == null) ? INFINITE : d;
     }
 
     /**

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85OutputStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85OutputStream.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85OutputStream.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/ASCII85OutputStream.java
Fri May 22 13:26:12 2015
@@ -156,7 +156,7 @@ public class ASCII85OutputStream extends
                 for (int i = 0; i < ret.length; i++) {
                     if (ret[i] < 33 || ret[i] > 117) {
                         System.out.println("Illegal char value "
-                                        + new Integer(ret[i]));
+                                        + Integer.valueOf(ret[i]));
                     }
                 }
             }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64EncodeStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64EncodeStream.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64EncodeStream.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/io/Base64EncodeStream.java
Fri May 22 13:26:12 2015
@@ -22,6 +22,7 @@ package org.apache.xmlgraphics.util.io;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
 
 // CSOFF: ConstantName
 // CSOFF: InnerAssignment
@@ -67,12 +68,20 @@ public class Base64EncodeStream extends
     boolean closeOutOnClose;
 
     public Base64EncodeStream(OutputStream out) {
-        this.out = new PrintStream(out);
+        try {
+            this.out = new PrintStream(out, false, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
         closeOutOnClose = true;
     }
 
     public Base64EncodeStream(OutputStream out, boolean closeOutOnClose) {
-        this.out = new PrintStream(out);
+        try {
+            this.out = new PrintStream(out, false, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
         this.closeOutOnClose = closeOutOnClose;
     }
 

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURIResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURIResolver.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURIResolver.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/util/uri/DataURIResolver.java
Fri May 22 13:26:12 2015
@@ -68,7 +68,12 @@ public class DataURIResolver implements
         String header = href.substring(0, commaPos);
         String data = href.substring(commaPos + 1);
         if (header.endsWith(";base64")) {
-            byte[] bytes = data.getBytes();
+            byte[] bytes = new byte[0];
+            try {
+                bytes = data.getBytes("UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
             ByteArrayInputStream encodedStream = new ByteArrayInputStream(bytes);
             Base64DecodeStream decodedStream = new Base64DecodeStream(
                     encodedStream);

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPArray.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPArray.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPArray.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPArray.java Fri May 22
13:26:12 2015
@@ -114,7 +114,7 @@ public class XMPArray extends XMPComplex
                 }
             }
         }
-        if (lang != null & v == null && valueForParentLanguage != null) {
+        if (lang != null && v == null && valueForParentLanguage != null)
{
             //Use value found for parent language
             v = valueForParentLanguage;
         }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPHandler.java Fri May
22 13:26:12 2015
@@ -82,14 +82,14 @@ public class XMPHandler extends DefaultH
         }
     }
 
-    private XMPComplexValue getCurrentComplexValue() {
-        Object obj = this.contextStack.peek();
-        if (obj instanceof XMPComplexValue) {
-            return (XMPComplexValue)obj;
-        } else {
-            return null;
-        }
-    }
+//    private XMPComplexValue getCurrentComplexValue() {
+//        Object obj = this.contextStack.peek();
+//        if (obj instanceof XMPComplexValue) {
+//            return (XMPComplexValue)obj;
+//        } else {
+//            return null;
+//        }
+//    }
 
     private XMPStructure getCurrentStructure() {
         Object obj = this.contextStack.peek();

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPPacketParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPPacketParser.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPPacketParser.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPPacketParser.java Fri
May 22 13:26:12 2015
@@ -80,7 +80,7 @@ public final class XMPPacketParser {
             throw new IOException("Invalid XMP packet header!");
         }
         ByteArrayOutputStream baout = null;
-        Metadata metadata = new Metadata();
+        Metadata metadata;
         try {
             //TODO think about not buffering this but for example, parse in another thread
             //ex. using PipedInput/OutputStream

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPProperty.java Fri May
22 13:26:12 2015
@@ -40,7 +40,6 @@ public class XMPProperty implements XMLi
     private Object value;
     private String xmllang;
     private Map qualifiers;
-    private boolean uri;
 
     /**
      * Creates a new XMP property.
@@ -50,7 +49,6 @@ public class XMPProperty implements XMLi
     public XMPProperty(QName name, Object value) {
         this.name = name;
         this.value = value;
-        this.uri = false;
     }
 
     /** @return the qualified name of the property (namespace URI + local name) */

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java Fri
May 22 13:26:12 2015
@@ -34,7 +34,7 @@ import org.apache.xmlgraphics.xmp.schema
  */
 public final class XMPSchemaRegistry {
 
-    private static XMPSchemaRegistry instance;
+    private static XMPSchemaRegistry instance = new XMPSchemaRegistry();
 
     private Map schemas = new java.util.HashMap();
 
@@ -44,9 +44,6 @@ public final class XMPSchemaRegistry {
 
     /** @return the singleton instance of the XMP schema registry. */
     public static XMPSchemaRegistry getInstance() {
-        if (instance == null) {
-            instance = new XMPSchemaRegistry();
-        }
         return instance;
     }
 

Modified: xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/image/loader/PipelineFactoryTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/image/loader/PipelineFactoryTestCase.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/image/loader/PipelineFactoryTestCase.java
(original)
+++ xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/image/loader/PipelineFactoryTestCase.java
Fri May 22 13:26:12 2015
@@ -109,8 +109,8 @@ public class PipelineFactoryTestCase {
 
         //Input is some TIFF file with CCITT Group 4 compression
         ImageInfo imageInfo = new ImageInfo("test:tiff", "image/tiff");
-        imageInfo.getCustomObjects().put("TIFF_STRIP_COUNT", new Integer(1));
-        imageInfo.getCustomObjects().put("TIFF_COMPRESSION", new Integer(TIFFImage.COMP_FAX_G4_2D));
+        imageInfo.getCustomObjects().put("TIFF_STRIP_COUNT", 1);
+        imageInfo.getCustomObjects().put("TIFF_COMPRESSION", TIFFImage.COMP_FAX_G4_2D);
 
         //We want either a G2D image or a raw CCITT image
         ImageFlavor[] targetFlavors = new ImageFlavor[] {
@@ -131,7 +131,7 @@ public class PipelineFactoryTestCase {
         }
 
         //Now, we set this to a multi-strip TIFF which should disable the raw loader
-        imageInfo.getCustomObjects().put("TIFF_STRIP_COUNT", new Integer(7));
+        imageInfo.getCustomObjects().put("TIFF_STRIP_COUNT", 7);
 
         candidates = pFactory.determineCandidatePipelines(
                 imageInfo, targetFlavors);
@@ -168,8 +168,8 @@ public class PipelineFactoryTestCase {
 
         //Input is some TIFF file with CCITT Group 4 compression
         ImageInfo imageInfo = new ImageInfo("test:tiff", "image/tiff");
-        imageInfo.getCustomObjects().put("TIFF_STRIP_COUNT", new Integer(1));
-        imageInfo.getCustomObjects().put("TIFF_COMPRESSION", new Integer(TIFFImage.COMP_FAX_G4_2D));
+        imageInfo.getCustomObjects().put("TIFF_STRIP_COUNT", 1);
+        imageInfo.getCustomObjects().put("TIFF_COMPRESSION", TIFFImage.COMP_FAX_G4_2D);
 
         //We want either a G2D image or a raw CCITT image
         ImageFlavor[] targetFlavors = new ImageFlavor[] {

Modified: xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/ps/dsc/ListenerTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/ps/dsc/ListenerTestCase.java?rev=1681108&r1=1681107&r2=1681108&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/ps/dsc/ListenerTestCase.java
(original)
+++ xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/ps/dsc/ListenerTestCase.java
Fri May 22 13:26:12 2015
@@ -110,7 +110,7 @@ public class ListenerTestCase {
                         throws IOException, DSCException {
                     if (event instanceof DSCCommentLanguageLevel) {
                         DSCCommentLanguageLevel level = (DSCCommentLanguageLevel) event;
-                        results.put("level", new Integer(level.getLanguageLevel()));
+                        results.put("level", level.getLanguageLevel());
                     }
                 }
             });
@@ -121,7 +121,7 @@ public class ListenerTestCase {
                 count++;
             }
             assertEquals(12, count);
-            assertEquals(new Integer(1), results.get("level"));
+            assertEquals(1, results.get("level"));
         } finally {
             IOUtils.closeQuietly(in);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message