diff options
author | Simon Steiner <ssteiner@apache.org> | 2016-09-23 12:57:46 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2016-09-23 12:57:46 +0000 |
commit | 65fc5610642b7f7aaed4396a2a26fd87a6bb41e2 (patch) | |
tree | 553aad9b860ad52af5ac771b47afdf33e50fdde5 | |
parent | 812dc1b5f74377912befb8f0c5243d3992629160 (diff) | |
download | xmlgraphics-fop-65fc5610642b7f7aaed4396a2a26fd87a6bb41e2.tar.gz xmlgraphics-fop-65fc5610642b7f7aaed4396a2a26fd87a6bb41e2.zip |
FOP-2648: Add generics
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1762060 13f79535-47bb-0310-9956-ffa450edef68
30 files changed, 166 insertions, 174 deletions
diff --git a/fop-core/src/main/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java b/fop-core/src/main/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java index d13ab2534..0bf0f5950 100644 --- a/fop-core/src/main/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java +++ b/fop-core/src/main/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java @@ -162,9 +162,9 @@ public final class GenerateBidiTestData { String line; int n; // singleton map - derived from single char entry - Map/*<Integer,List>*/ sm = new HashMap/*<Integer,List>*/(); + Map<Integer, List> sm = new HashMap<Integer, List>(); // interval map - derived from pair of block endpoint entries - Map/*<String,int[3]>*/ im = new HashMap/*<String,int[3]>*/(); + Map<String, Integer[]> im = new HashMap<String, Integer[]>(); if (verbose) { System.out.print("Reading bidi type data..."); } @@ -189,7 +189,7 @@ public final class GenerateBidiTestData { td = (int[][]) tdl.toArray(new int [ tdl.size() ] []); } - private static void parseTypeProperties(String line, Map/*<Integer,List>*/ sm, Map/*<String,int[3]>*/ im) { + private static void parseTypeProperties(String line, Map<Integer, List> sm, Map<String, Integer[]> im) { String[] sa = line.split(";"); if (sa.length >= 5) { int uc = Integer.parseInt(sa[0], 16); @@ -250,9 +250,9 @@ public final class GenerateBidiTestData { return sa[0].trim(); } - private static List processTypeData(Map/*<Integer,List>*/ sm, Map/*<String,int[3]>*/ im, List tdl) { + private static List processTypeData(Map<Integer, List> sm, Map<String, Integer[]> im, List tdl) { for (int i = BidiConstants.FIRST, k = BidiConstants.LAST; i <= k; i++) { - Map/*<Integer,Integer>*/ rm = new TreeMap/*<Integer,Integer>*/(); + Map<Integer, Integer> rm = new TreeMap<Integer, Integer>(); // populate intervals from singleton map List sl = (List) sm.get(Integer.valueOf(i)); if (sl != null) { @@ -277,12 +277,12 @@ public final class GenerateBidiTestData { return tdl; } - private static List extractRanges(Map/*<Integer,Integer>*/ rm) { + private static List extractRanges(Map<Integer, Integer> rm) { List ranges = new ArrayList(); int sLast = 0; int eLast = 0; for (Iterator it = rm.entrySet().iterator(); it.hasNext(); ) { - Map.Entry/*<Integer,Integer>*/ me = (Map.Entry/*<Integer,Integer>*/) it.next(); + Map.Entry<Integer, Integer> me = (Map.Entry<Integer, Integer>) it.next(); int s = ((Integer) me.getKey()).intValue(); int e = ((Integer) me.getValue()).intValue(); if (s > eLast) { @@ -703,7 +703,7 @@ public final class GenerateBidiTestData { } private static List complementRanges(List ranges) { - Map/*<Integer,Integer>*/ rm = new TreeMap/*<Integer,Integer>*/(); + Map<Integer, Integer> rm = new TreeMap<Integer, Integer>(); for (Iterator it = ranges.iterator(); it.hasNext(); ) { int[] r = (int[]) it.next(); rm.put(Integer.valueOf(r[0]), Integer.valueOf(r[1])); @@ -714,7 +714,7 @@ public final class GenerateBidiTestData { int cs = 0; List compRanges = new ArrayList(rm.size() + 1); for (Iterator it = rm.entrySet().iterator(); it.hasNext(); ) { - Map.Entry/*<Integer,Integer>*/ me = (Map.Entry/*<Integer,Integer>*/) it.next(); + Map.Entry<Integer, Integer> me = (Map.Entry<Integer, Integer>) it.next(); s = ((Integer) me.getKey()).intValue(); e = ((Integer) me.getValue()).intValue(); if (s > cs) { diff --git a/fop-core/src/main/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java b/fop-core/src/main/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java index b3fc8effe..083e560f8 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java +++ b/fop-core/src/main/java/org/apache/fop/afp/goca/AbstractGraphicsDrawingOrderContainer.java @@ -36,8 +36,7 @@ public abstract class AbstractGraphicsDrawingOrderContainer extends AbstractName implements StructuredData, Completable, Startable { /** list of objects contained within this container */ - protected List/*<StructuredDataObject>*/ objects - = new java.util.ArrayList/*<StructuredDataObject>*/(); + protected List objects = new java.util.ArrayList(); /** object is complete */ private boolean complete; @@ -85,7 +84,7 @@ implements StructuredData, Completable, Startable { * @param graphicsContainer a graphics container */ public void addAll(AbstractGraphicsDrawingOrderContainer graphicsContainer) { - Collection/*<StructuredDataObject>*/ objects = graphicsContainer.getObjects(); + Collection objects = graphicsContainer.getObjects(); objects.addAll(objects); } diff --git a/fop-core/src/main/java/org/apache/fop/afp/modca/AbstractPageObject.java b/fop-core/src/main/java/org/apache/fop/afp/modca/AbstractPageObject.java index 80d5da8e6..b3e733673 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/modca/AbstractPageObject.java +++ b/fop-core/src/main/java/org/apache/fop/afp/modca/AbstractPageObject.java @@ -58,7 +58,7 @@ public abstract class AbstractPageObject extends AbstractNamedAFPObject implemen private PresentationTextObject currentPresentationTextObject; /** The list of objects within this resource container */ - protected List/*<AbstractStructuredObject>*/ objects = new java.util.ArrayList(); + protected List objects = new java.util.ArrayList(); /** The page width */ private int width; @@ -215,7 +215,7 @@ public abstract class AbstractPageObject extends AbstractNamedAFPObject implemen */ protected List getTagLogicalElements() { if (objects == null) { - this.objects = new java.util.ArrayList/*<AbstractStructuredObject>*/(); + this.objects = new java.util.ArrayList<AbstractStructuredObject>(); } return this.objects; } diff --git a/fop-core/src/main/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java b/fop-core/src/main/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java index 667faca80..5bbce3d1e 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java +++ b/fop-core/src/main/java/org/apache/fop/afp/modca/AbstractResourceGroupContainer.java @@ -140,7 +140,7 @@ public abstract class AbstractResourceGroupContainer extends AbstractPageObject /** {@inheritDoc} */ @Override - protected void writeObjects(Collection/*<AbstractAFPObject>*/ objects, OutputStream os) + protected void writeObjects(Collection objects, OutputStream os) throws IOException { writeObjects(objects, os, false); } @@ -153,7 +153,7 @@ public abstract class AbstractResourceGroupContainer extends AbstractPageObject * @param forceWrite true if writing should happen in any case * @throws java.io.IOException an I/O exception of some sort has occurred. */ - protected void writeObjects(Collection/*<AbstractAFPObject>*/ objects, OutputStream os, + protected void writeObjects(Collection<AbstractAFPObject> objects, OutputStream os, boolean forceWrite) throws IOException { if (objects != null && objects.size() > 0) { Iterator it = objects.iterator(); diff --git a/fop-core/src/main/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java b/fop-core/src/main/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java index 48eaa0a40..b635347ea 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java +++ b/fop-core/src/main/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java @@ -51,8 +51,8 @@ import org.apache.fop.render.afp.AFPFontConfig; public final class ActiveEnvironmentGroup extends AbstractEnvironmentGroup { /** The collection of MapCodedFont objects */ - private final List/*<MapCodedFonts>*/ mapCodedFonts - = new java.util.ArrayList/*<MapCodedFonts>*/(); + private final List<AbstractStructuredObject> mapCodedFonts + = new java.util.ArrayList<AbstractStructuredObject>(); /** the collection of MapPageSegments objects */ private List mapPageSegments; diff --git a/fop-core/src/main/java/org/apache/fop/afp/modca/MapCodedFont.java b/fop-core/src/main/java/org/apache/fop/afp/modca/MapCodedFont.java index f42249314..fa82802c6 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/modca/MapCodedFont.java +++ b/fop-core/src/main/java/org/apache/fop/afp/modca/MapCodedFont.java @@ -44,8 +44,8 @@ import org.apache.fop.afp.util.BinaryUtils; public class MapCodedFont extends AbstractStructuredObject { /** the collection of map coded fonts (maximum of 254) */ - private final List/*<FontDefinition>*/ fontList - = new java.util.ArrayList/*<FontDefinition>*/(); + private final List<FontDefinition> fontList + = new java.util.ArrayList<FontDefinition>(); /** * Main constructor diff --git a/fop-core/src/main/java/org/apache/fop/afp/modca/PageSegment.java b/fop-core/src/main/java/org/apache/fop/afp/modca/PageSegment.java index 50c3a642c..7808e7747 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/modca/PageSegment.java +++ b/fop-core/src/main/java/org/apache/fop/afp/modca/PageSegment.java @@ -31,7 +31,7 @@ import java.util.List; */ public class PageSegment extends AbstractNamedAFPObject { - private List/*<AbstractAFPObject>*/ objects; + private List<AbstractAFPObject> objects; /** * Main constructor @@ -47,7 +47,7 @@ public class PageSegment extends AbstractNamedAFPObject { * * @return a list of objects contained within this page segment */ - public List/*<AbstractAFPObject>*/ getObjects() { + public List<AbstractAFPObject> getObjects() { if (objects == null) { objects = new java.util.ArrayList(); } diff --git a/fop-core/src/main/java/org/apache/fop/afp/modca/PresentationTextObject.java b/fop-core/src/main/java/org/apache/fop/afp/modca/PresentationTextObject.java index d1b0c9318..33744b465 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/modca/PresentationTextObject.java +++ b/fop-core/src/main/java/org/apache/fop/afp/modca/PresentationTextObject.java @@ -58,7 +58,7 @@ public class PresentationTextObject extends AbstractNamedAFPObject { /** * The presentation text data list */ - private List/*<PresentationTextData>*/ presentationTextDataList; + private List<PresentationTextData> presentationTextDataList; private DefaultBuilder builder = new DefaultBuilder(); @@ -140,7 +140,7 @@ public class PresentationTextObject extends AbstractNamedAFPObject { */ private void startPresentationTextData() { if (presentationTextDataList == null) { - presentationTextDataList = new java.util.ArrayList/*<PresentationTextData>*/(); + presentationTextDataList = new java.util.ArrayList<PresentationTextData>(); } if (presentationTextDataList.size() == 0) { currentPresentationTextData = new PresentationTextData(true); diff --git a/fop-core/src/main/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java b/fop-core/src/main/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java index db254273e..16251827a 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java +++ b/fop-core/src/main/java/org/apache/fop/afp/modca/ResourceEnvironmentGroup.java @@ -35,7 +35,7 @@ public class ResourceEnvironmentGroup extends AbstractEnvironmentGroup implement /** the pre-process presentation objects contained in this resource environment group */ // never written - // private List/*<PreprocessPresentationObject>*/ preProcessPresentationObjects; + // private List<PreprocessPresentationObject> preProcessPresentationObjects; /** the resource environment group state */ private boolean complete; diff --git a/fop-core/src/main/java/org/apache/fop/afp/modca/ResourceGroup.java b/fop-core/src/main/java/org/apache/fop/afp/modca/ResourceGroup.java index c301557c8..c45d1e2fb 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/modca/ResourceGroup.java +++ b/fop-core/src/main/java/org/apache/fop/afp/modca/ResourceGroup.java @@ -31,7 +31,7 @@ import org.apache.fop.afp.Streamable; public class ResourceGroup extends AbstractNamedAFPObject { /** Set of resource uri */ - private final Set/*<String>*/ resourceSet = new java.util.HashSet/*<String>*/(); + private final Set<AbstractNamedAFPObject> resourceSet = new java.util.HashSet<AbstractNamedAFPObject>(); /** * Constructor for the ResourceGroup, this takes a @@ -62,17 +62,6 @@ public class ResourceGroup extends AbstractNamedAFPObject { return resourceSet.size(); } - /** - * Returns true if the resource exists within this resource group, - * false otherwise. - * - * @param uri the uri of the resource - * @return true if the resource exists within this resource group - */ - public boolean resourceExists(String uri) { - return resourceSet.contains(uri); - } - /** {@inheritDoc} */ public void writeStart(OutputStream os) throws IOException { byte[] data = new byte[17]; diff --git a/fop-core/src/main/java/org/apache/fop/apps/FopFactory.java b/fop-core/src/main/java/org/apache/fop/apps/FopFactory.java index ac6c87933..91d42313a 100644 --- a/fop-core/src/main/java/org/apache/fop/apps/FopFactory.java +++ b/fop-core/src/main/java/org/apache/fop/apps/FopFactory.java @@ -103,7 +103,7 @@ public final class FopFactory implements ImageContext { /** * Map of configured names of hyphenation pattern file names: ll_CC => name */ - private Map/*<String,String>*/ hyphPatNames; + private Map<String, String> hyphPatNames; /** * FOP has the ability, for some FO's, to continue processing even if the diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java index 82a9f6afd..fb86dc211 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java @@ -232,7 +232,7 @@ public class GlyphPositioningTable extends GlyphTable { * @return true if some adjustment is not zero; otherwise, false */ public boolean position(GlyphSequence gs, String script, String language, int fontSize, int[] widths, int[][] adjustments) { - Map/*<LookupSpec,List<LookupTable>>*/ lookups = matchLookups(script, language, "*"); + Map<LookupSpec, List<LookupTable>> lookups = matchLookups(script, language, "*"); if ((lookups != null) && (lookups.size() > 0)) { ScriptProcessor sp = ScriptProcessor.getInstance(script); return sp.position(this, gs, script, language, fontSize, lookups, widths, adjustments); @@ -1209,7 +1209,7 @@ public class GlyphPositioningTable extends GlyphTable { } } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } /** {@inheritDoc} */ @@ -1296,7 +1296,7 @@ public class GlyphPositioningTable extends GlyphTable { } } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } /** {@inheritDoc} */ @@ -1397,7 +1397,7 @@ public class GlyphPositioningTable extends GlyphTable { } } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } /** {@inheritDoc} */ @@ -1533,7 +1533,7 @@ public class GlyphPositioningTable extends GlyphTable { } } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } /** {@inheritDoc} */ @@ -1608,7 +1608,7 @@ public class GlyphPositioningTable extends GlyphTable { } } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } /** {@inheritDoc} */ @@ -1698,7 +1698,7 @@ public class GlyphPositioningTable extends GlyphTable { } } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } /** {@inheritDoc} */ diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java index 9ca9ac328..f6d0b74f6 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java @@ -94,7 +94,7 @@ public class GlyphSubstitutionTable extends GlyphTable { */ public GlyphSequence substitute(GlyphSequence gs, String script, String language) { GlyphSequence ogs; - Map/*<LookupSpec,List<LookupTable>>*/ lookups = matchLookups(script, language, "*"); + Map<LookupSpec, List<LookupTable>> lookups = matchLookups(script, language, "*"); if ((lookups != null) && (lookups.size() > 0)) { ScriptProcessor sp = ScriptProcessor.getInstance(script); ogs = sp.substitute(this, gs, script, language, lookups); @@ -734,7 +734,7 @@ public class GlyphSubstitutionTable extends GlyphTable { } } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } /** {@inheritDoc} */ @@ -821,7 +821,7 @@ public class GlyphSubstitutionTable extends GlyphTable { } } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } /** {@inheritDoc} */ @@ -922,7 +922,7 @@ public class GlyphSubstitutionTable extends GlyphTable { } } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } /** {@inheritDoc} */ @@ -1059,7 +1059,7 @@ public class GlyphSubstitutionTable extends GlyphTable { } } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } /** {@inheritDoc} */ @@ -1165,7 +1165,7 @@ public class GlyphSubstitutionTable extends GlyphTable { return ContextualSubtableFormat2.matches(ss, cdt, classes, offset, rv); } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } private void populate(List entries) { @@ -1224,7 +1224,7 @@ public class GlyphSubstitutionTable extends GlyphTable { } } /** {@inheritDoc} */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { GlyphTable.resolveLookupReferences(rsa, lookupTables); } /** {@inheritDoc} */ diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubtable.java b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubtable.java index 135901735..6a245af7c 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubtable.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphSubtable.java @@ -191,7 +191,7 @@ public abstract class GlyphSubtable implements Comparable { * Resolve references to lookup tables, e.g., in RuleLookup, to the lookup tables themselves. * @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables */ - public void resolveLookupReferences(Map/*<String,GlyphTable.LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, GlyphTable.LookupTable> lookupTables) { } /** diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphTable.java b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphTable.java index 46a724b88..b3a0afe88 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphTable.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphTable.java @@ -63,13 +63,13 @@ public class GlyphTable { private GlyphTable gdef; // map from lookup specs to lists of strings, each of which identifies a lookup table (consisting of one or more subtables) - private Map/*<LookupSpec,List<String>>*/ lookups; + private Map<LookupSpec, List<String>> lookups; // map from lookup identifiers to lookup tables - private Map/*<String,LookupTable>*/ lookupTables; + private Map<String, LookupTable> lookupTables; // cache for lookups matching - private Map/*<LookupSpec,Map<LookupSpec,List<LookupTable>>>*/ matchedLookups; + private Map<LookupSpec, Map<LookupSpec, List<LookupTable>>> matchedLookups; // if true, then prevent further subtable addition private boolean frozen; @@ -79,7 +79,7 @@ public class GlyphTable { * @param gdef glyph definition table that applies * @param lookups map from lookup specs to lookup tables */ - public GlyphTable(GlyphTable gdef, Map/*<LookupSpec,List<String>>*/ lookups) { + public GlyphTable(GlyphTable gdef, Map<LookupSpec, List<String>> lookups) { if ((gdef != null) && !(gdef instanceof GlyphDefinitionTable)) { throw new AdvancedTypographicTableFormatException("bad glyph definition table"); } else if (lookups == null) { @@ -87,8 +87,8 @@ public class GlyphTable { } else { this.gdef = gdef; this.lookups = lookups; - this.lookupTables = new LinkedHashMap/*<String,List<LookupTable>>*/(); - this.matchedLookups = new HashMap/*<LookupSpec,Map<LookupSpec,List<LookupTable>>>*/(); + this.lookupTables = new LinkedHashMap<String, LookupTable>(); + this.matchedLookups = new HashMap<LookupSpec, Map<LookupSpec, List<LookupTable>>>(); } } @@ -104,7 +104,7 @@ public class GlyphTable { * Obtain list of all lookup specifications. * @return (possibly empty) list of all lookup specifications */ - public List/*<LookupSpec>*/ getLookups() { + public List<LookupSpec> getLookups() { return matchLookupSpecs("*", "*", "*"); } @@ -113,9 +113,9 @@ public class GlyphTable { * lexicographic ordering follows the lookup list order. * @return (possibly empty) ordered list of all lookup tables */ - public List/*<LookupTable>*/ getLookupTables() { - TreeSet/*<String>*/ lids = new TreeSet/*<String>*/(lookupTables.keySet()); - List/*<LookupTable>*/ ltl = new ArrayList/*<LookupTable>*/(lids.size()); + public List<LookupTable> getLookupTables() { + TreeSet<String> lids = new TreeSet<String>(lookupTables.keySet()); + List<LookupTable> ltl = new ArrayList<LookupTable>(lids.size()); for (Object lid1 : lids) { String lid = (String) lid1; ltl.add(lookupTables.get(lid)); @@ -130,7 +130,7 @@ public class GlyphTable { * @return table associated with lookup id or null if none */ public LookupTable getLookupTable(String lid) { - return (LookupTable) lookupTables.get(lid); + return lookupTables.get(lid); } /** @@ -147,7 +147,7 @@ public class GlyphTable { // add subtable to this table's subtable collection String lid = subtable.getLookupId(); if (lookupTables.containsKey(lid)) { - LookupTable lt = (LookupTable) lookupTables.get(lid); + LookupTable lt = lookupTables.get(lid); lt.addSubtable(subtable); } else { LookupTable lt = new LookupTable(lid, subtable); @@ -177,9 +177,9 @@ public class GlyphTable { * @param feature a feature identifier * @return a (possibly empty) array of matching lookup specifications */ - public List/*<LookupSpec>*/ matchLookupSpecs(String script, String language, String feature) { - Set/*<LookupSpec>*/ keys = lookups.keySet(); - List/*<LookupSpec>*/ matches = new ArrayList/*<LookupSpec>*/(); + public List<LookupSpec> matchLookupSpecs(String script, String language, String feature) { + Set<LookupSpec> keys = lookups.keySet(); + List<LookupSpec> matches = new ArrayList<LookupSpec>(); for (Object key : keys) { LookupSpec ls = (LookupSpec) key; if (!"*".equals(script)) { @@ -210,12 +210,12 @@ public class GlyphTable { * @param feature a feature identifier * @return a (possibly empty) map from matching lookup specifications to lists of corresponding lookup tables */ - public Map/*<LookupSpec,List<LookupTable>>*/ matchLookups(String script, String language, String feature) { + public Map<LookupSpec, List<LookupTable>> matchLookups(String script, String language, String feature) { LookupSpec lsm = new LookupSpec(script, language, feature, true, true); - Map/*<LookupSpec,List<LookupTable>>*/ lm = (Map/*<LookupSpec,List<LookupTable>>*/) matchedLookups.get(lsm); + Map<LookupSpec, List<LookupTable>> lm = matchedLookups.get(lsm); if (lm == null) { lm = new LinkedHashMap(); - List/*<LookupSpec>*/ lsl = matchLookupSpecs(script, language, feature); + List<LookupSpec> lsl = matchLookupSpecs(script, language, feature); for (Object aLsl : lsl) { LookupSpec ls = (LookupSpec) aLsl; lm.put(ls, findLookupTables(ls)); @@ -234,19 +234,19 @@ public class GlyphTable { * @param ls a (non-null) lookup specification * @return a (possibly empty) ordered list of lookup tables whose corresponding lookup specifications match the specified lookup spec */ - public List/*<LookupTable>*/ findLookupTables(LookupSpec ls) { - TreeSet/*<LookupTable>*/ lts = new TreeSet/*<LookupTable>*/(); - List/*<String>*/ ids; - if ((ids = (List/*<String>*/) lookups.get(ls)) != null) { + public List<LookupTable> findLookupTables(LookupSpec ls) { + TreeSet<LookupTable> lts = new TreeSet<LookupTable>(); + List<String> ids; + if ((ids = lookups.get(ls)) != null) { for (Object id : ids) { String lid = (String) id; LookupTable lt; - if ((lt = (LookupTable) lookupTables.get(lid)) != null) { + if ((lt = lookupTables.get(lid)) != null) { lts.add(lt); } } } - return new ArrayList/*<LookupTable>*/(lts); + return new ArrayList<LookupTable>(lts); } /** @@ -256,14 +256,14 @@ public class GlyphTable { * @param lookups a mapping from lookup specifications to lists of look tables from which to select lookup tables according to the specified features * @return ordered array of assembled lookup table use specifications */ - public UseSpec[] assembleLookups(String[] features, Map/*<LookupSpec,List<LookupTable>>*/ lookups) { - TreeSet/*<UseSpec>*/ uss = new TreeSet/*<UseSpec>*/(); + public UseSpec[] assembleLookups(String[] features, Map<LookupSpec, List<LookupTable>> lookups) { + TreeSet<UseSpec> uss = new TreeSet<UseSpec>(); for (String feature : features) { for (Object o : lookups.entrySet()) { - Map.Entry/*<LookupSpec,List<LookupTable>>*/ e = (Map.Entry/*<LookupSpec,List<LookupTable>>*/) o; - LookupSpec ls = (LookupSpec) e.getKey(); + Map.Entry<LookupSpec, List<LookupTable>> e = (Map.Entry<LookupSpec, List<LookupTable>>) o; + LookupSpec ls = e.getKey(); if (ls.getFeature().equals(feature)) { - List/*<LookupTable>*/ ltl = (List/*<LookupTable>*/) e.getValue(); + List<LookupTable> ltl = e.getValue(); if (ltl != null) { for (Object aLtl : ltl) { LookupTable lt = (LookupTable) aLtl; @@ -273,7 +273,7 @@ public class GlyphTable { } } } - return (UseSpec[]) uss.toArray(new UseSpec [ uss.size() ]); + return uss.toArray(new UseSpec [ uss.size() ]); } /** @@ -330,7 +330,7 @@ public class GlyphTable { * @param rsa array of rule sets * @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables */ - public static void resolveLookupReferences(RuleSet[] rsa, Map/*<String,LookupTable>*/ lookupTables) { + public static void resolveLookupReferences(RuleSet[] rsa, Map<String, LookupTable> lookupTables) { if ((rsa != null) && (lookupTables != null)) { for (RuleSet rs : rsa) { if (rs != null) { @@ -465,7 +465,7 @@ public class GlyphTable { private final String id; // lookup identifier private final int idOrdinal; // parsed lookup identifier ordinal - private final List/*<GlyphSubtable>*/ subtables; // list of subtables + private final List<GlyphSubtable> subtables; // list of subtables private boolean doesSub; // performs substitutions private boolean doesPos; // performs positioning private boolean frozen; // if true, then don't permit further subtable additions @@ -487,13 +487,13 @@ public class GlyphTable { * @param id the lookup table's identifier * @param subtables a pre-poplated list of subtables or null */ - public LookupTable(String id, List/*<GlyphSubtable>*/ subtables) { + public LookupTable(String id, List<GlyphSubtable> subtables) { assert id != null; assert id.length() != 0; assert id.startsWith("lu"); this.id = id; this.idOrdinal = Integer.parseInt(id.substring(2)); - this.subtables = new LinkedList/*<GlyphSubtable>*/(); + this.subtables = new LinkedList<GlyphSubtable>(); if (subtables != null) { for (Object subtable : subtables) { GlyphSubtable st = (GlyphSubtable) subtable; @@ -508,9 +508,9 @@ public class GlyphTable { return (subtablesArray != null) ? subtablesArray : subtablesArrayEmpty; } else { if (doesSub) { - return (GlyphSubtable[]) subtables.toArray(new GlyphSubstitutionSubtable [ subtables.size() ]); + return subtables.toArray(new GlyphSubstitutionSubtable [ subtables.size() ]); } else if (doesPos) { - return (GlyphSubtable[]) subtables.toArray(new GlyphPositioningSubtable [ subtables.size() ]); + return subtables.toArray(new GlyphPositioningSubtable [ subtables.size() ]); } else { return null; } @@ -532,8 +532,8 @@ public class GlyphTable { // validate subtable to ensure consistency with current subtables validateSubtable(subtable); // insert subtable into ordered list - for (ListIterator/*<GlyphSubtable>*/ lit = subtables.listIterator(0); lit.hasNext(); ) { - GlyphSubtable st = (GlyphSubtable) lit.next(); + for (ListIterator<GlyphSubtable> lit = subtables.listIterator(0); lit.hasNext(); ) { + GlyphSubtable st = lit.next(); int d; if ((d = subtable.compareTo(st)) < 0) { // insert within list @@ -573,7 +573,7 @@ public class GlyphTable { } } if (subtables.size() > 0) { - GlyphSubtable st = (GlyphSubtable) subtables.get(0); + GlyphSubtable st = subtables.get(0); if (!st.isCompatible(subtable)) { throw new AdvancedTypographicTableFormatException("subtable " + subtable + " is not compatible with subtable " + st); } @@ -586,7 +586,7 @@ public class GlyphTable { * lookup tables that appear in this lookup table's subtables. * @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables */ - public void freezeSubtables(Map/*<String,LookupTable>*/ lookupTables) { + public void freezeSubtables(Map<String, LookupTable> lookupTables) { if (!frozen) { GlyphSubtable[] sta = getSubtables(); resolveLookupReferences(sta, lookupTables); @@ -595,7 +595,7 @@ public class GlyphTable { } } - private void resolveLookupReferences(GlyphSubtable[] subtables, Map/*<String,LookupTable>*/ lookupTables) { + private void resolveLookupReferences(GlyphSubtable[] subtables, Map<String, LookupTable> lookupTables) { if (subtables != null) { for (GlyphSubtable st : subtables) { if (st != null) { @@ -740,11 +740,11 @@ public class GlyphTable { return sb.toString(); } - private static List/*<GlyphSubtable>*/ makeSingleton(GlyphSubtable subtable) { + private static List<GlyphSubtable> makeSingleton(GlyphSubtable subtable) { if (subtable == null) { return null; } else { - List/*<GlyphSubtable>*/ stl = new ArrayList/*<GlyphSubtable>*/(1); + List<GlyphSubtable> stl = new ArrayList<GlyphSubtable>(1); stl.add(subtable); return stl; } @@ -878,10 +878,10 @@ public class GlyphTable { * Resolve references to lookup tables. * @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { if (lookupTables != null) { String lid = "lu" + Integer.toString(lookupIndex); - LookupTable lt = (LookupTable) lookupTables.get(lid); + LookupTable lt = lookupTables.get(lid); if (lt != null) { this.lookup = lt; } else { @@ -930,7 +930,7 @@ public class GlyphTable { * Resolve references to lookup tables, e.g., in RuleLookup, to the lookup tables themselves. * @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { if (lookups != null) { for (RuleLookup l : lookups) { if (l != null) { @@ -1267,7 +1267,7 @@ public class GlyphTable { * Resolve references to lookup tables, e.g., in RuleLookup, to the lookup tables themselves. * @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables */ - public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) { + public void resolveLookupReferences(Map<String, LookupTable> lookupTables) { if (rules != null) { for (Rule r : rules) { if (r != null) { diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java index 74bf803d8..469f7f8f5 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java @@ -51,9 +51,9 @@ public final class OTFAdvancedTypographicTableReader { private GlyphSubstitutionTable gsub; // glyph substitution table private GlyphPositioningTable gpos; // glyph positioning table // transient parsing state - private transient Map/*<String,Object[3]>*/ seScripts; // script-tag => Object[3] : { default-language-tag, List(language-tag), seLanguages } - private transient Map/*<String,Object[2]>*/ seLanguages; // language-tag => Object[2] : { "f<required-feature-index>", List("f<feature-index>") - private transient Map/*<String,List<String>>*/ seFeatures; // "f<feature-index>" => Object[2] : { feature-tag, List("lu<lookup-index>") } + private transient Map<String, Object> seScripts; // script-tag => Object[3] : { default-language-tag, List(language-tag), seLanguages } + private transient Map<String, Object> seLanguages; // language-tag => Object[2] : { "f<required-feature-index>", List("f<feature-index>") + private transient Map<String, Object> seFeatures; // "f<feature-index>" => Object[2] : { feature-tag, List("lu<lookup-index>") } private transient GlyphMappingTable seMapping; // subtable entry mappings private transient List seEntries; // subtable entry entries private transient List seSubtables; // subtable entry subtables @@ -3567,7 +3567,7 @@ public final class OTFAdvancedTypographicTableReader { if (fp != null) { assert fp.length == 2; String ft = (String) fp[0]; // feature tag - List/*<String>*/ lul = (List) fp[1]; // list of lookup table ids + List<String> lul = (List) fp[1]; // list of lookup table ids if ((ft != null) && (lul != null) && (lul.size() > 0)) { GlyphTable.LookupSpec ls = new GlyphTable.LookupSpec(st, lt, ft); lookups.put(ls, lul); @@ -3575,14 +3575,14 @@ public final class OTFAdvancedTypographicTableReader { } } - private void constructLookupsFeatures(Map lookups, String st, String lt, List/*<String>*/ fids) { + private void constructLookupsFeatures(Map lookups, String st, String lt, List<String> fids) { for (Object fid1 : fids) { String fid = (String) fid1; constructLookupsFeature(lookups, st, lt, fid); } } - private void constructLookupsLanguage(Map lookups, String st, String lt, Map/*<String,Object[2]>*/ languages) { + private void constructLookupsLanguage(Map lookups, String st, String lt, Map<String, Object> languages) { Object[] lp = (Object[]) languages.get(lt); if (lp != null) { assert lp.length == 2; @@ -3595,7 +3595,7 @@ public final class OTFAdvancedTypographicTableReader { } } - private void constructLookupsLanguages(Map lookups, String st, List/*<String>*/ ll, Map/*<String,Object[2]>*/ languages) { + private void constructLookupsLanguages(Map lookups, String st, List<String> ll, Map<String, Object> languages) { for (Object aLl : ll) { String lt = (String) aLl; constructLookupsLanguage(lookups, st, lt, languages); @@ -3603,13 +3603,13 @@ public final class OTFAdvancedTypographicTableReader { } private Map constructLookups() { - Map/*<GlyphTable.LookupSpec,List<String>>*/ lookups = new java.util.LinkedHashMap(); + Map<GlyphTable.LookupSpec, List<String>> lookups = new java.util.LinkedHashMap(); for (Object o : seScripts.keySet()) { String st = (String) o; Object[] sp = (Object[]) seScripts.get(st); if (sp != null) { assert sp.length == 3; - Map/*<String,Object[2]>*/ languages = (Map) sp[2]; + Map<String, Object> languages = (Map) sp[2]; if (sp[0] != null) { // default language constructLookupsLanguage(lookups, st, (String) sp[0], languages); } @@ -3622,7 +3622,7 @@ public final class OTFAdvancedTypographicTableReader { } private List constructGDEFSubtables() { - List/*<GlyphDefinitionSubtable>*/ subtables = new java.util.ArrayList(); + List<GlyphSubtable> subtables = new java.util.ArrayList(); if (seSubtables != null) { for (Object seSubtable : seSubtables) { Object[] stp = (Object[]) seSubtable; @@ -3658,7 +3658,7 @@ public final class OTFAdvancedTypographicTableReader { } private List constructGSUBSubtables() { - List/*<GlyphSubtable>*/ subtables = new java.util.ArrayList(); + List<GlyphSubtable> subtables = new java.util.ArrayList(); if (seSubtables != null) { for (Object seSubtable : seSubtables) { Object[] stp = (Object[]) seSubtable; @@ -3694,7 +3694,7 @@ public final class OTFAdvancedTypographicTableReader { } private List constructGPOSSubtables() { - List/*<GlyphSubtable>*/ subtables = new java.util.ArrayList(); + List<GlyphSubtable> subtables = new java.util.ArrayList(); if (seSubtables != null) { for (Object seSubtable : seSubtables) { Object[] stp = (Object[]) seSubtable; diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/ArabicScriptProcessor.java b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/ArabicScriptProcessor.java index 6ffd8c5ef..dad7f2367 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/ArabicScriptProcessor.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/ArabicScriptProcessor.java @@ -71,7 +71,7 @@ public class ArabicScriptProcessor extends DefaultScriptProcessor { }; private static class SubstitutionScriptContextTester implements ScriptContextTester { - private static Map/*<String,GlyphContextTester>*/ testerMap = new HashMap/*<String,GlyphContextTester>*/(); + private static Map<String, GlyphContextTester> testerMap = new HashMap<String, GlyphContextTester>(); static { testerMap.put("fina", new GlyphContextTester() { public boolean test(String script, String language, String feature, GlyphSequence gs, int index, int flags) { @@ -100,14 +100,14 @@ public class ArabicScriptProcessor extends DefaultScriptProcessor { }); } public GlyphContextTester getTester(String feature) { - return (GlyphContextTester) testerMap.get(feature); + return testerMap.get(feature); } } private static class PositioningScriptContextTester implements ScriptContextTester { - private static Map/*<String,GlyphContextTester>*/ testerMap = new HashMap/*<String,GlyphContextTester>*/(); + private static Map<String, GlyphContextTester> testerMap = new HashMap<String, GlyphContextTester>(); public GlyphContextTester getTester(String feature) { - return (GlyphContextTester) testerMap.get(feature); + return testerMap.get(feature); } } diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java index 93fd3e75c..45e82856a 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java @@ -98,16 +98,16 @@ public class IndicScriptProcessor extends DefaultScriptProcessor { }; private static class SubstitutionScriptContextTester implements ScriptContextTester { - private static Map/*<String,GlyphContextTester>*/ testerMap = new HashMap/*<String,GlyphContextTester>*/(); + private static Map<String, GlyphContextTester> testerMap = new HashMap<String, GlyphContextTester>(); public GlyphContextTester getTester(String feature) { - return (GlyphContextTester) testerMap.get(feature); + return testerMap.get(feature); } } private static class PositioningScriptContextTester implements ScriptContextTester { - private static Map/*<String,GlyphContextTester>*/ testerMap = new HashMap/*<String,GlyphContextTester>*/(); + private static Map<String, GlyphContextTester> testerMap = new HashMap<String, GlyphContextTester>(); public GlyphContextTester getTester(String feature) { - return (GlyphContextTester) testerMap.get(feature); + return testerMap.get(feature); } } diff --git a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/ScriptProcessor.java b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/ScriptProcessor.java index 82dc822be..9d8c28890 100644 --- a/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/ScriptProcessor.java +++ b/fop-core/src/main/java/org/apache/fop/complexscripts/scripts/ScriptProcessor.java @@ -21,6 +21,7 @@ package org.apache.fop.complexscripts.scripts; import java.util.Arrays; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.apache.fop.complexscripts.fonts.GlyphDefinitionTable; @@ -43,7 +44,7 @@ public abstract class ScriptProcessor { private final String script; - private final Map/*<AssembledLookupsKey,GlyphTable.UseSpec[]>*/ assembledLookups; + private final Map<AssembledLookupsKey, GlyphTable.UseSpec[]> assembledLookups; private static Map<String, ScriptProcessor> processors = new HashMap<String, ScriptProcessor>(); @@ -56,7 +57,7 @@ public abstract class ScriptProcessor { throw new IllegalArgumentException("script must be non-empty string"); } else { this.script = script; - this.assembledLookups = new HashMap/*<AssembledLookupsKey,GlyphTable.UseSpec[]>*/(); + this.assembledLookups = new HashMap<AssembledLookupsKey, GlyphTable.UseSpec[]>(); } } @@ -94,7 +95,8 @@ public abstract class ScriptProcessor { * @param lookups a mapping from lookup specifications to glyph subtables to use for substitution processing * @return the substituted (output) glyph sequence */ - public final GlyphSequence substitute(GlyphSubstitutionTable gsub, GlyphSequence gs, String script, String language, Map/*<LookupSpec,List<LookupTable>>>*/ lookups) { + public final GlyphSequence substitute(GlyphSubstitutionTable gsub, GlyphSequence gs, String script, String language, + Map<GlyphTable.LookupSpec, List<GlyphTable.LookupTable>> lookups) { return substitute(gs, script, language, assembleLookups(gsub, getSubstitutionFeatures(), lookups), getSubstitutionContextTester()); } @@ -165,7 +167,8 @@ public abstract class ScriptProcessor { * with one 4-tuple for each element of glyph sequence * @return true if some adjustment is not zero; otherwise, false */ - public final boolean position(GlyphPositioningTable gpos, GlyphSequence gs, String script, String language, int fontSize, Map/*<LookupSpec,List<LookupTable>>*/ lookups, int[] widths, int[][] adjustments) { + public final boolean position(GlyphPositioningTable gpos, GlyphSequence gs, String script, String language, int fontSize, + Map<GlyphTable.LookupSpec, List<GlyphTable.LookupTable>> lookups, int[] widths, int[][] adjustments) { return position(gs, script, language, fontSize, assembleLookups(gpos, getPositioningFeatures(), lookups), widths, adjustments, getPositioningContextTester()); } @@ -201,7 +204,8 @@ public abstract class ScriptProcessor { * @param lookups a mapping from lookup specifications to lists of look tables from which to select lookup tables according to the specified features * @return ordered array of assembled lookup table use specifications */ - public final GlyphTable.UseSpec[] assembleLookups(GlyphTable table, String[] features, Map/*<LookupSpec,List<LookupTable>>*/ lookups) { + public final GlyphTable.UseSpec[] assembleLookups(GlyphTable table, String[] features, + Map<GlyphTable.LookupSpec, List<GlyphTable.LookupTable>> lookups) { AssembledLookupsKey key = new AssembledLookupsKey(table, features, lookups); GlyphTable.UseSpec[] usa; if ((usa = assembledLookupsGet(key)) != null) { @@ -212,7 +216,7 @@ public abstract class ScriptProcessor { } private GlyphTable.UseSpec[] assembledLookupsGet(AssembledLookupsKey key) { - return (GlyphTable.UseSpec[]) assembledLookups.get(key); + return assembledLookups.get(key); } private GlyphTable.UseSpec[] assembledLookupsPut(AssembledLookupsKey key, GlyphTable.UseSpec[] usa) { @@ -252,9 +256,9 @@ public abstract class ScriptProcessor { private final GlyphTable table; private final String[] features; - private final Map/*<LookupSpec,List<LookupTable>>*/ lookups; + private final Map<GlyphTable.LookupSpec, List<GlyphTable.LookupTable>> lookups; - AssembledLookupsKey(GlyphTable table, String[] features, Map/*<LookupSpec,List<LookupTable>>*/ lookups) { + AssembledLookupsKey(GlyphTable table, String[] features, Map<GlyphTable.LookupSpec, List<GlyphTable.LookupTable>> lookups) { this.table = table; this.features = features; this.lookups = lookups; diff --git a/fop-core/src/main/java/org/apache/fop/fo/FObj.java b/fop-core/src/main/java/org/apache/fop/fo/FObj.java index ce983dfb2..fc105e7e6 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/FObj.java +++ b/fop-core/src/main/java/org/apache/fop/fo/FObj.java @@ -692,7 +692,7 @@ public abstract class FObj extends FONode implements Constants { } /** @return the extension attachments of this FObj. */ - public List/*<ExtensionAttachment>*/ getExtensionAttachments() { + public List<ExtensionAttachment> getExtensionAttachments() { if (extensionAttachments == null) { return Collections.EMPTY_LIST; } else { diff --git a/fop-core/src/main/java/org/apache/fop/fo/flow/table/BorderResolver.java b/fop-core/src/main/java/org/apache/fop/fo/flow/table/BorderResolver.java index 1b856abff..8eb5b9cbd 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/flow/table/BorderResolver.java +++ b/fop-core/src/main/java/org/apache/fop/fo/flow/table/BorderResolver.java @@ -33,7 +33,7 @@ interface BorderResolver { * @param row the row that has just been finished * @param container the FO element holding the given row */ - void endRow(List/*<GridUnit>*/ row, TableCellContainer container); + void endRow(List<GridUnit> row, TableCellContainer container); /** * Receives notification of the start of a table-header/footer/body. diff --git a/fop-core/src/main/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java b/fop-core/src/main/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java index 1a7e6fe3f..8fabec6b3 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java +++ b/fop-core/src/main/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java @@ -39,14 +39,14 @@ class CollapsingBorderResolver implements BorderResolver { * The previously registered row, either in the header or the body(-ies), but not in * the footer (handled separately). */ - private List/*<GridUnit>*/ previousRow; + private List<GridUnit> previousRow; private boolean firstInTable; - private List/*<GridUnit>*/ footerFirstRow; + private List<GridUnit> footerFirstRow; /** The last currently registered footer row. */ - private List/*<GridUnit>*/ footerLastRow; + private List<GridUnit> footerLastRow; private Resolver delegate; @@ -56,13 +56,13 @@ class CollapsingBorderResolver implements BorderResolver { private Resolver resolverInFooter; - private List/*<ConditionalBorder>*/ leadingBorders; + private List<ConditionalBorder> leadingBorders; - private List/*<ConditionalBorder>*/ trailingBorders; + private List<ConditionalBorder> trailingBorders; /* TODO Temporary hack for resolved borders in header */ /* Currently the normal border is always used. */ - private List/*<GridUnit>*/ headerLastRow; + private List<GridUnit> headerLastRow; /* End of temporary hack */ /** @@ -89,12 +89,12 @@ class CollapsingBorderResolver implements BorderResolver { * @param withLeadingTrailing * @param withRest */ - void resolveBordersFirstRowInTable(List/*<GridUnit>*/ row, boolean withNormal, + void resolveBordersFirstRowInTable(List<GridUnit> row, boolean withNormal, boolean withLeadingTrailing, boolean withRest) { assert firstInTable; for (int i = 0; i < row.size(); i++) { TableColumn column = table.getColumn(i); - ((GridUnit) row.get(i)).integrateBorderSegment( + row.get(i).integrateBorderSegment( CommonBorderPaddingBackground.BEFORE, column, withNormal, withLeadingTrailing, withRest); } @@ -107,19 +107,19 @@ class CollapsingBorderResolver implements BorderResolver { * @param rowBefore * @param rowAfter */ - void resolveBordersBetweenRows(List/*<GridUnit>*/ rowBefore, List/*<GridUnit>*/ rowAfter) { + void resolveBordersBetweenRows(List<GridUnit> rowBefore, List<GridUnit> rowAfter) { assert rowBefore != null && rowAfter != null; for (int i = 0; i < rowAfter.size(); i++) { - GridUnit gu = (GridUnit) rowAfter.get(i); + GridUnit gu = rowAfter.get(i); if (gu.getRowSpanIndex() == 0) { - GridUnit beforeGU = (GridUnit) rowBefore.get(i); + GridUnit beforeGU = rowBefore.get(i); gu.resolveBorder(beforeGU, CommonBorderPaddingBackground.BEFORE); } } } /** Integrates the border-after of the part. */ - void resolveBordersLastRowInPart(List/*<GridUnit>*/ row, boolean withNormal, + void resolveBordersLastRowInPart(List<GridUnit> row, boolean withNormal, boolean withLeadingTrailing, boolean withRest) { for (Object aRow : row) { ((GridUnit) aRow).integrateBorderSegment(CommonBorderPaddingBackground.AFTER, @@ -136,11 +136,11 @@ class CollapsingBorderResolver implements BorderResolver { * @param withLeadingTrailing * @param withRest */ - void resolveBordersLastRowInTable(List/*<GridUnit>*/ row, boolean withNormal, + void resolveBordersLastRowInTable(List<GridUnit> row, boolean withNormal, boolean withLeadingTrailing, boolean withRest) { for (int i = 0; i < row.size(); i++) { TableColumn column = table.getColumn(i); - ((GridUnit) row.get(i)).integrateBorderSegment(CommonBorderPaddingBackground.AFTER, + row.get(i).integrateBorderSegment(CommonBorderPaddingBackground.AFTER, column, withNormal, withLeadingTrailing, withRest); } } @@ -152,10 +152,10 @@ class CollapsingBorderResolver implements BorderResolver { * * @param row */ - void integrateLeadingBorders(List/*<GridUnit>*/ row) { + void integrateLeadingBorders(List<GridUnit> row) { for (int i = 0; i < table.getNumberOfColumns(); i++) { - GridUnit gu = (GridUnit) row.get(i); - ConditionalBorder border = (ConditionalBorder) leadingBorders.get(i); + GridUnit gu = row.get(i); + ConditionalBorder border = leadingBorders.get(i); gu.integrateCompetingBorder(CommonBorderPaddingBackground.BEFORE, border, false, true, true); } @@ -168,10 +168,10 @@ class CollapsingBorderResolver implements BorderResolver { * * @param row */ - void integrateTrailingBorders(List/*<GridUnit>*/ row) { + void integrateTrailingBorders(List<GridUnit> row) { for (int i = 0; i < table.getNumberOfColumns(); i++) { - GridUnit gu = (GridUnit) row.get(i); - ConditionalBorder border = (ConditionalBorder) trailingBorders.get(i); + GridUnit gu = row.get(i); + ConditionalBorder border = trailingBorders.get(i); gu.integrateCompetingBorder(CommonBorderPaddingBackground.AFTER, border, false, true, true); } @@ -197,7 +197,7 @@ class CollapsingBorderResolver implements BorderResolver { * @param row the row being finished * @param container the containing element */ - void endRow(List/*<GridUnit>*/ row, TableCellContainer container) { + void endRow(List<GridUnit> row, TableCellContainer container) { BorderSpecification borderStart = borderStartTableAndBody; BorderSpecification borderEnd = borderEndTableAndBody; // Resolve before- and after-borders for the table-row @@ -256,7 +256,7 @@ class CollapsingBorderResolver implements BorderResolver { private class ResolverInHeader extends Resolver { - void endRow(List/*<GridUnit>*/ row, TableCellContainer container) { + void endRow(List<GridUnit> row, TableCellContainer container) { super.endRow(row, container); if (previousRow != null) { resolveBordersBetweenRows(previousRow, row); @@ -309,7 +309,7 @@ class CollapsingBorderResolver implements BorderResolver { private class ResolverInFooter extends Resolver { - void endRow(List/*<GridUnit>*/ row, TableCellContainer container) { + void endRow(List<GridUnit> row, TableCellContainer container) { super.endRow(row, container); if (footerFirstRow == null) { footerFirstRow = row; @@ -350,7 +350,7 @@ class CollapsingBorderResolver implements BorderResolver { private boolean firstInBody = true; - void endRow(List/*<GridUnit>*/ row, TableCellContainer container) { + void endRow(List<GridUnit> row, TableCellContainer container) { super.endRow(row, container); if (firstInTable) { resolveBordersFirstRowInTable(row, true, true, true); @@ -410,7 +410,7 @@ class CollapsingBorderResolver implements BorderResolver { } /** {@inheritDoc} */ - public void endRow(List/*<GridUnit>*/ row, TableCellContainer container) { + public void endRow(List<GridUnit> row, TableCellContainer container) { delegate.endRow(row, container); } diff --git a/fop-core/src/main/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java b/fop-core/src/main/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java index 7376873bb..71d3f9413 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java +++ b/fop-core/src/main/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java @@ -41,7 +41,7 @@ class FixedColRowGroupBuilder extends RowGroupBuilder { private int currentRowIndex; /** The rows belonging to this row group. List of List of {@link GridUnit}s. */ - private List/*<List<GridUnit>>*/ rows; + private List<List<GridUnit>> rows; private boolean firstInPart = true; diff --git a/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontQualifier.java b/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontQualifier.java index 865211a3e..532e6cb7d 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontQualifier.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontQualifier.java @@ -147,19 +147,19 @@ public class FontQualifier { * @param fontInfo the font info * @return a list of matching font triplets */ - protected List/*<FontTriplet>*/ match(FontInfo fontInfo) { + protected List<FontTriplet> match(FontInfo fontInfo) { AttributeValue fontFamilyValue = getFontFamily(); AttributeValue weightValue = getFontWeight(); AttributeValue styleValue = getFontStyle(); - List/*<FontTriplet>*/ matchingTriplets = new java.util.ArrayList/*<FontTriplet>*/(); + List<FontTriplet> matchingTriplets = new java.util.ArrayList<FontTriplet>(); // try to find matching destination font triplet for (Object aFontFamilyValue : fontFamilyValue) { String fontFamilyString = (String) aFontFamilyValue; - Map/*<FontTriplet>*/ triplets = (Map/*<FontTriplet>*/) fontInfo.getFontTriplets(); + Map<FontTriplet, String> triplets = fontInfo.getFontTriplets(); if (triplets != null) { - Set/*<FontTriplet>*/ tripletSet = triplets.keySet(); + Set<FontTriplet> tripletSet = triplets.keySet(); for (Object aTripletSet : tripletSet) { FontTriplet triplet = (FontTriplet) aTripletSet; String fontName = triplet.getName(); @@ -218,10 +218,10 @@ public class FontQualifier { * @return the highest priority matching font triplet */ protected FontTriplet bestMatch(FontInfo fontInfo) { - List/*<FontTriplet>*/ matchingTriplets = match(fontInfo); + List<FontTriplet> matchingTriplets = match(fontInfo); FontTriplet bestTriplet = null; if (matchingTriplets.size() == 1) { - bestTriplet = (FontTriplet)matchingTriplets.get(0); + bestTriplet = matchingTriplets.get(0); } else { for (Object matchingTriplet : matchingTriplets) { FontTriplet triplet = (FontTriplet) matchingTriplet; @@ -241,8 +241,8 @@ public class FontQualifier { /** * @return a list of font triplets matching this qualifier */ - public List/*<FontTriplet>*/ getTriplets() { - List/*<FontTriplet>*/ triplets = new java.util.ArrayList/*<FontTriplet>*/(); + public List<FontTriplet> getTriplets() { + List<FontTriplet> triplets = new java.util.ArrayList<FontTriplet>(); AttributeValue fontFamilyValue = getFontFamily(); for (Object aFontFamilyValue : fontFamilyValue) { diff --git a/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontSubstitutions.java b/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontSubstitutions.java index 20af38520..054d42a80 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontSubstitutions.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/substitute/FontSubstitutions.java @@ -31,7 +31,7 @@ import org.apache.fop.fonts.FontTriplet; /** * Font substitutions */ -public class FontSubstitutions extends java.util.ArrayList/*<Substitutions>*/ { +public class FontSubstitutions extends java.util.ArrayList<FontSubstitution> { private static final long serialVersionUID = -9173104935431899722L; @@ -43,8 +43,8 @@ public class FontSubstitutions extends java.util.ArrayList/*<Substitutions>*/ { * @param fontInfo font info */ public void adjustFontInfo(FontInfo fontInfo) { - for (Iterator/*<FontSubstitution>*/ subsIt = super.iterator(); subsIt.hasNext();) { - FontSubstitution substitution = (FontSubstitution)subsIt.next(); + for (Iterator<FontSubstitution> subsIt = super.iterator(); subsIt.hasNext();) { + FontSubstitution substitution = subsIt.next(); // find the best matching font triplet FontQualifier toQualifier = substitution.getToQualifier(); @@ -57,7 +57,7 @@ public class FontSubstitutions extends java.util.ArrayList/*<Substitutions>*/ { String internalFontKey = fontInfo.getInternalFontKey(fontTriplet); FontQualifier fromQualifier = substitution.getFromQualifier(); - List/*<FontTriplet>*/ tripletList = fromQualifier.getTriplets(); + List<FontTriplet> tripletList = fromQualifier.getTriplets(); for (Object aTripletList : tripletList) { FontTriplet triplet = (FontTriplet) aTripletList; fontInfo.addFontProperties(internalFontKey, triplet); diff --git a/fop-core/src/main/java/org/apache/fop/render/RendererContext.java b/fop-core/src/main/java/org/apache/fop/render/RendererContext.java index ba95297f1..d715eaccc 100644 --- a/fop-core/src/main/java/org/apache/fop/render/RendererContext.java +++ b/fop-core/src/main/java/org/apache/fop/render/RendererContext.java @@ -35,7 +35,7 @@ public class RendererContext { private final AbstractRenderer renderer; private FOUserAgent userAgent; - private final Map/*<String,Object>*/ props = new java.util.HashMap/*<String,Object>*/(); + private final Map<String, Object> props = new java.util.HashMap<String, Object>(); /** * Constructor for this class. It takes a MIME type as parameter. diff --git a/fop-core/src/main/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java b/fop-core/src/main/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java index 5f155e277..93aee86eb 100644 --- a/fop-core/src/main/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java +++ b/fop-core/src/main/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java @@ -61,10 +61,10 @@ public class AFPForeignAttributeReader { * @param foreignAttributes the foreign attributes * @return the resource information */ - public AFPResourceInfo getResourceInfo(Map/*<QName, String>*/ foreignAttributes) { + public AFPResourceInfo getResourceInfo(Map<QName, String> foreignAttributes) { AFPResourceInfo resourceInfo = new AFPResourceInfo(); if (foreignAttributes != null && !foreignAttributes.isEmpty()) { - String resourceName = (String) foreignAttributes.get(RESOURCE_NAME); + String resourceName = foreignAttributes.get(RESOURCE_NAME); if (resourceName != null) { resourceInfo.setName(resourceName); } diff --git a/fop-core/src/main/java/org/apache/fop/render/pcl/fonts/truetype/PCLTTFFontReader.java b/fop-core/src/main/java/org/apache/fop/render/pcl/fonts/truetype/PCLTTFFontReader.java index 142262ade..ff397fe1d 100644 --- a/fop-core/src/main/java/org/apache/fop/render/pcl/fonts/truetype/PCLTTFFontReader.java +++ b/fop-core/src/main/java/org/apache/fop/render/pcl/fonts/truetype/PCLTTFFontReader.java @@ -715,7 +715,7 @@ public class PCLTTFFontReader extends PCLFontReader { originalIndex = ((SingleByteFont) font).getGIDFromChar(unicode); writeUShort(hmtxTable, (softFontGlyphIndex) * 4, - ((SingleByteFont) font).getWidth(originalIndex, 1)); + font.getWidth(originalIndex, 1)); writeUShort(hmtxTable, (softFontGlyphIndex) * 4 + 2, 0); } } diff --git a/fop-core/src/main/java/org/apache/fop/tools/anttasks/Fop.java b/fop-core/src/main/java/org/apache/fop/tools/anttasks/Fop.java index d35c00436..bb1bef24b 100644 --- a/fop-core/src/main/java/org/apache/fop/tools/anttasks/Fop.java +++ b/fop-core/src/main/java/org/apache/fop/tools/anttasks/Fop.java @@ -70,7 +70,7 @@ public class Fop extends Task { private File xmlFile; private File xsltFile; private String xsltParams; - private List/*<FileSet>*/ filesets = new java.util.ArrayList/*<FileSet>*/(); + private List<FileSet> filesets = new java.util.ArrayList<FileSet>(); private File outFile; private File outDir; private String format; //MIME type diff --git a/fop-events/src/main/java/org/apache/fop/events/DefaultEventBroadcaster.java b/fop-events/src/main/java/org/apache/fop/events/DefaultEventBroadcaster.java index d4e03faea..5801186e3 100644 --- a/fop-events/src/main/java/org/apache/fop/events/DefaultEventBroadcaster.java +++ b/fop-events/src/main/java/org/apache/fop/events/DefaultEventBroadcaster.java @@ -67,7 +67,7 @@ public class DefaultEventBroadcaster implements EventBroadcaster { this.listeners.processEvent(event); } - private static List/*<EventModel>*/ eventModels = new java.util.ArrayList(); + private static List<EventModel> eventModels = new java.util.ArrayList(); private Map proxies = new java.util.HashMap(); /** |