commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1649198 - in /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff: TiffField.java TiffImageMetadata.java
Date Sat, 03 Jan 2015 12:45:48 GMT
Author: britter
Date: Sat Jan  3 12:45:48 2015
New Revision: 1649198

URL: http://svn.apache.org/r1649198
Log:
Better generics

Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java?rev=1649198&r1=1649197&r2=1649198&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java
Sat Jan  3 12:45:48 2015
@@ -51,7 +51,7 @@ public class TiffField {
     private final byte[] value;
     private final ByteOrder byteOrder;
     private final int sortHint;
-    private static final Map<Object, List<TagInfo>> ALL_TAG_MAP = makeTagMap(AllTagConstants.ALL_TAGS);
+    private static final Map<Integer, List<TagInfo>> ALL_TAG_MAP = makeTagMap(AllTagConstants.ALL_TAGS);
 
     public TiffField(final int tag, final int directoryType, final FieldType fieldType,
             final long count, final long offset, final byte[] value,
@@ -559,10 +559,10 @@ public class TiffField {
         return (String) o;
     }
 
-    private static Map<Object, List<TagInfo>> makeTagMap(
+    private static Map<Integer, List<TagInfo>> makeTagMap(
             final List<TagInfo> tags) {
         // make sure to use the thread-safe version; this is shared state.
-        final Map<Object, List<TagInfo>> map = new HashMap<Object, List<TagInfo>>();
+        final Map<Integer, List<TagInfo>> map = new HashMap<Integer, List<TagInfo>>();
 
         for (TagInfo tag : tags) {
             List<TagInfo> tagList = map.get(tag.tag);

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java?rev=1649198&r1=1649197&r2=1649198&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffImageMetadata.java
Sat Jan  3 12:45:48 2015
@@ -53,14 +53,14 @@ import org.apache.commons.imaging.format
 
 public class TiffImageMetadata extends GenericImageMetadata {
     public final TiffContents contents;
-    private static final Map<Object, Integer> TAG_COUNTS = countTags(AllTagConstants.ALL_TAGS);
+    private static final Map<Integer, Integer> TAG_COUNTS = countTags(AllTagConstants.ALL_TAGS);
 
     public TiffImageMetadata(final TiffContents contents) {
         this.contents = contents;
     }
 
-    private static Map<Object, Integer> countTags(final List<TagInfo> tags) {
-        final Map<Object, Integer> map = new HashMap<Object, Integer>();
+    private static Map<Integer, Integer> countTags(final List<TagInfo> tags)
{
+        final Map<Integer, Integer> map = new HashMap<Integer, Integer>();
 
         for (TagInfo tag : tags) {
             final Integer count = map.get(tag.tag);



Mime
View raw message