Browse Source

enable MultipleVariableDeclarations rule; fix violations

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1296483 13f79535-47bb-0310-9956-ffa450edef68
pull/26/head
Glenn Adams 12 years ago
parent
commit
c8ae711928
38 changed files with 186 additions and 77 deletions
  1. 1
    1
      checkstyle-5.5.xml
  2. 4
    2
      src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java
  3. 3
    1
      src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java
  4. 6
    2
      src/codegen/unicode/java/org/apache/fop/hyphenation/UnicodeClasses.java
  5. 2
    1
      src/codegen/unicode/java/org/apache/fop/text/linebreak/GenerateLineBreakUtils.java
  6. 2
    1
      src/java/org/apache/fop/apps/FOURIResolver.java
  7. 3
    1
      src/java/org/apache/fop/apps/FopFactoryConfigurator.java
  8. 10
    3
      src/java/org/apache/fop/area/CTM.java
  9. 3
    1
      src/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java
  10. 3
    1
      src/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java
  11. 6
    2
      src/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java
  12. 16
    8
      src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java
  13. 20
    10
      src/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java
  14. 5
    1
      src/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java
  15. 9
    4
      src/java/org/apache/fop/complexscripts/scripts/DevanagariScriptProcessor.java
  16. 9
    4
      src/java/org/apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java
  17. 9
    4
      src/java/org/apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java
  18. 5
    1
      src/java/org/apache/fop/complexscripts/util/GlyphSequence.java
  19. 3
    1
      src/java/org/apache/fop/fo/expr/ICCColorFunction.java
  20. 3
    1
      src/java/org/apache/fop/fo/expr/NamedColorFunction.java
  21. 2
    1
      src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
  22. 2
    1
      src/java/org/apache/fop/fo/properties/PropertyCache.java
  23. 2
    1
      src/java/org/apache/fop/fonts/AbstractCodePointMapping.java
  24. 4
    2
      src/java/org/apache/fop/fonts/MultiByteFont.java
  25. 2
    1
      src/java/org/apache/fop/fonts/autodetect/WindowsFontDirFinder.java
  26. 4
    2
      src/java/org/apache/fop/hyphenation/HyphenationTree.java
  27. 5
    2
      src/java/org/apache/fop/hyphenation/TernaryTree.java
  28. 2
    1
      src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
  29. 2
    1
      src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
  30. 2
    1
      src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
  31. 4
    2
      src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
  32. 2
    1
      src/java/org/apache/fop/pdf/PDFDocument.java
  33. 4
    2
      src/java/org/apache/fop/render/intermediate/IFRenderer.java
  34. 7
    2
      src/java/org/apache/fop/render/txt/TXTRenderer.java
  35. 9
    3
      src/java/org/apache/fop/svg/PDFGraphics2D.java
  36. 2
    1
      src/java/org/apache/fop/tools/anttasks/FileCompare.java
  37. 6
    2
      src/java/org/apache/fop/util/ColorUtil.java
  38. 3
    1
      src/java/org/apache/fop/util/XMLResourceBundle.java

+ 1
- 1
checkstyle-5.5.xml View File

@@ -169,7 +169,7 @@
<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->

<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->
<!-- <module name="MultipleVariableDeclarations"/> produces 78 new errors -->
<module name="MultipleVariableDeclarations"/>
<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->

<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->

+ 4
- 2
src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java View File

@@ -211,7 +211,8 @@ public final class GenerateBidiClass {
}
}
// compile interval search data
int ivIndex = 0, niv = intervals.size();
int ivIndex = 0;
int niv = intervals.size();
bcS1 = new int [ niv ];
bcE1 = new int [ niv ];
bcC1 = new byte [ niv ];
@@ -226,7 +227,8 @@ public final class GenerateBidiClass {
}

private static int[] parseInterval ( String interval ) throws Exception {
int s, e;
int s;
int e;
String[] fa = interval.split("\\.\\.");
if ( fa.length == 1 ) {
s = Integer.parseInt ( fa[0], 16 );

+ 3
- 1
src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java View File

@@ -715,7 +715,9 @@ public final class GenerateBidiTestData {
rm.put ( Integer.valueOf ( r[0] ), Integer.valueOf ( r[1] ) );
}
// add complement ranges save last
int s, e, cs = 0;
int s;
int e;
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();

+ 6
- 2
src/codegen/unicode/java/org/apache/fop/hyphenation/UnicodeClasses.java View File

@@ -258,7 +258,8 @@ public final class UnicodeClasses {
continue;
}

int uppercode = -1, titlecode = -1;
int uppercode = -1;
int titlecode = -1;
if (!"".equals(fields[SIMPLE_UPPERCASE_MAPPING])) {
uppercode = Integer.parseInt(fields[SIMPLE_UPPERCASE_MAPPING], 16);
}
@@ -355,7 +356,10 @@ public final class UnicodeClasses {
* @throws URISyntaxException if the input URI is incorrect
*/
public static void main(String[] args) throws IOException, URISyntaxException {
String type = "ucd", prefix = "--", infile = null, outfile = null;
String type = "ucd";
String prefix = "--";
String infile = null;
String outfile = null;
boolean hexcode = false;
int i;
for (i = 0; i < args.length && args[i].startsWith(prefix); ++i) {

+ 2
- 1
src/codegen/unicode/java/org/apache/fop/text/linebreak/GenerateLineBreakUtils.java View File

@@ -558,7 +558,8 @@ public final class GenerateLineBreakUtils {
throw new Exception(lineBreakFileName + ':' + lineNumber + ": Unknown property value in " + line);
}
String codepoint = line.substring(0, idx);
int low, high;
int low;
int high;
idx = codepoint.indexOf("..");
try {
if (idx >= 0) {

+ 2
- 1
src/java/org/apache/fop/apps/FOURIResolver.java View File

@@ -183,7 +183,8 @@ public class FOURIResolver implements javax.xml.transform.URIResolver {
if (source == null) {
URL absoluteURL = null;
int hashPos = href.indexOf('#');
String fileURL, fragment;
String fileURL;
String fragment;
if (hashPos >= 0) {
fileURL = href.substring(0, hashPos);
fragment = href.substring(hashPos);

+ 3
- 1
src/java/org/apache/fop/apps/FopFactoryConfigurator.java View File

@@ -168,7 +168,9 @@ public class FopFactoryConfigurator {
if (hyphPatConfig.length != 0) {
Map/*<String,String>*/ hyphPatNames = new HashMap/*<String,String>*/();
for (int i = 0; i < hyphPatConfig.length; ++i) {
String lang, country, filename;
String lang;
String country;
String filename;
StringBuffer error = new StringBuffer();
String location = hyphPatConfig[i].getLocation();


+ 10
- 3
src/java/org/apache/fop/area/CTM.java View File

@@ -41,7 +41,12 @@ public class CTM implements Serializable {

private static final long serialVersionUID = -8743287485623778341L;

private double a, b, c, d, e, f;
private double a;
private double b;
private double c;
private double d;
private double e;
private double f;

private static final CTM CTM_LRTB = new CTM(1, 0, 0, 1, 0, 0);
private static final CTM CTM_RLTB = new CTM(1, 0, 0, 1, 0, 0);
@@ -175,7 +180,8 @@ public class CTM implements Serializable {
* @return CTM The result of rotating this CTM.
*/
public CTM rotate(double angle) {
double cos, sin;
double cos;
double sin;
if (angle == 90.0 || angle == -270.0) {
cos = 0.0;
sin = 1.0;
@@ -286,7 +292,8 @@ public class CTM implements Serializable {
WritingMode writingMode,
Rectangle2D absVPrect,
FODimension reldims) {
int width, height;
int width;
int height;
// We will use the absolute reference-orientation to set up the CTM.
// The value here is relative to its ancestor reference area.
if (absRefOrient % 180 == 0) {

+ 3
- 1
src/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java View File

@@ -203,7 +203,9 @@ public final class GlyphClassTable extends GlyphMappingTable implements GlyphCla
}
}
// extract glyph class array
int i = 0, n = entries.size() - 1, gcMax = -1;
int i = 0;
int n = entries.size() - 1;
int gcMax = -1;
int[] gca = new int [ n ];
while ( it.hasNext() ) {
Object o = it.next();

+ 3
- 1
src/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java View File

@@ -174,7 +174,9 @@ public final class GlyphCoverageTable extends GlyphMappingTable implements Glyph
return getMappedIndex ( gid );
}
private void populate ( List entries ) {
int i = 0, n = entries.size(), gidMax = -1;
int i = 0;
int n = entries.size();
int gidMax = -1;
int[] map = new int [ n ];
for ( Iterator it = entries.iterator(); it.hasNext();) {
Object o = it.next();

+ 6
- 2
src/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java View File

@@ -157,7 +157,8 @@ public class GlyphMappingTable {
}
/** {@inheritDoc} */
public int getMappedIndex ( int gid ) {
int i, mi;
int i;
int mi;
if ( ( i = Arrays.binarySearch ( sa, gid ) ) >= 0 ) {
mi = getMappedIndex ( gid, sa [ i ], ma [ i ] ); // matches start of (some) range
} else if ( ( i = - ( i + 1 ) ) == 0 ) {
@@ -179,7 +180,10 @@ public class GlyphMappingTable {
*/
public abstract int getMappedIndex ( int gid, int s, int m );
private void populate ( List entries ) {
int i = 0, n = entries.size(), gidMax = -1, miMax = -1;
int i = 0;
int n = entries.size();
int gidMax = -1;
int miMax = -1;
int[] sa = new int [ n ];
int[] ea = new int [ n ];
int[] ma = new int [ n ];

+ 16
- 8
src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java View File

@@ -258,7 +258,8 @@ public class GlyphPositioningTable extends GlyphTable {
}
/** {@inheritDoc} */
public boolean position ( GlyphPositioningState ps ) {
int gi = ps.getGlyph(), ci;
int gi = ps.getGlyph();
int ci;
if ( ( ci = getCoverageIndex ( gi ) ) < 0 ) {
return false;
} else {
@@ -396,7 +397,8 @@ public class GlyphPositioningTable extends GlyphTable {
/** {@inheritDoc} */
public boolean position ( GlyphPositioningState ps ) {
boolean applied = false;
int gi = ps.getGlyph(0), ci;
int gi = ps.getGlyph(0);
int ci;
if ( ( ci = getCoverageIndex ( gi ) ) >= 0 ) {
int[] counts = ps.getGlyphsAvailable ( 0 );
int nga = counts[0];
@@ -587,7 +589,8 @@ public class GlyphPositioningTable extends GlyphTable {
/** {@inheritDoc} */
public boolean position ( GlyphPositioningState ps ) {
boolean applied = false;
int gi = ps.getGlyph(0), ci;
int gi = ps.getGlyph(0);
int ci;
if ( ( ci = getCoverageIndex ( gi ) ) >= 0 ) {
int[] counts = ps.getGlyphsAvailable ( 0 );
int nga = counts[0];
@@ -703,7 +706,8 @@ public class GlyphPositioningTable extends GlyphTable {
/** {@inheritDoc} */
public boolean position ( GlyphPositioningState ps ) {
boolean applied = false;
int giMark = ps.getGlyph(), ciMark;
int giMark = ps.getGlyph();
int ciMark;
if ( ( ciMark = getCoverageIndex ( giMark ) ) >= 0 ) {
MarkAnchor ma = getMarkAnchor ( ciMark, giMark );
if ( ma != null ) {
@@ -846,7 +850,8 @@ public class GlyphPositioningTable extends GlyphTable {
/** {@inheritDoc} */
public boolean position ( GlyphPositioningState ps ) {
boolean applied = false;
int giMark = ps.getGlyph(), ciMark;
int giMark = ps.getGlyph();
int ciMark;
if ( ( ciMark = getCoverageIndex ( giMark ) ) >= 0 ) {
MarkAnchor ma = getMarkAnchor ( ciMark, giMark );
int mxc = getMaxComponentCount();
@@ -1004,7 +1009,8 @@ public class GlyphPositioningTable extends GlyphTable {
/** {@inheritDoc} */
public boolean position ( GlyphPositioningState ps ) {
boolean applied = false;
int giMark1 = ps.getGlyph(), ciMark1;
int giMark1 = ps.getGlyph();
int ciMark1;
if ( ( ciMark1 = getCoverageIndex ( giMark1 ) ) >= 0 ) {
MarkAnchor ma = getMark1Anchor ( ciMark1, giMark1 );
if ( ma != null ) {
@@ -1134,7 +1140,8 @@ public class GlyphPositioningTable extends GlyphTable {
/** {@inheritDoc} */
public boolean position ( GlyphPositioningState ps ) {
boolean applied = false;
int gi = ps.getGlyph(), ci;
int gi = ps.getGlyph();
int ci;
if ( ( ci = getCoverageIndex ( gi ) ) >= 0 ) {
int[] rv = new int[1];
RuleLookup[] la = getLookups ( ci, gi, ps, rv );
@@ -1460,7 +1467,8 @@ public class GlyphPositioningTable extends GlyphTable {
/** {@inheritDoc} */
public boolean position ( GlyphPositioningState ps ) {
boolean applied = false;
int gi = ps.getGlyph(), ci;
int gi = ps.getGlyph();
int ci;
if ( ( ci = getCoverageIndex ( gi ) ) >= 0 ) {
int[] rv = new int[1];
RuleLookup[] la = getLookups ( ci, gi, ps, rv );

+ 20
- 10
src/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java View File

@@ -246,7 +246,8 @@ public class GlyphSubstitutionTable extends GlyphTable {
}
/** {@inheritDoc} */
public boolean substitute ( GlyphSubstitutionState ss ) {
int gi = ss.getGlyph(), ci;
int gi = ss.getGlyph();
int ci;
if ( ( ci = getCoverageIndex ( gi ) ) < 0 ) {
return false;
} else {
@@ -341,7 +342,8 @@ public class GlyphSubstitutionTable extends GlyphTable {
}
}
private void populate ( List entries ) {
int i = 0, n = entries.size();
int i = 0;
int n = entries.size();
int[] glyphs = new int [ n ];
for ( Iterator it = entries.iterator(); it.hasNext();) {
Object o = it.next();
@@ -376,7 +378,8 @@ public class GlyphSubstitutionTable extends GlyphTable {
}
/** {@inheritDoc} */
public boolean substitute ( GlyphSubstitutionState ss ) {
int gi = ss.getGlyph(), ci;
int gi = ss.getGlyph();
int ci;
if ( ( ci = getCoverageIndex ( gi ) ) < 0 ) {
return false;
} else {
@@ -461,7 +464,8 @@ public class GlyphSubstitutionTable extends GlyphTable {
}
/** {@inheritDoc} */
public boolean substitute ( GlyphSubstitutionState ss ) {
int gi = ss.getGlyph(), ci;
int gi = ss.getGlyph();
int ci;
if ( ( ci = getCoverageIndex ( gi ) ) < 0 ) {
return false;
} else {
@@ -523,7 +527,8 @@ public class GlyphSubstitutionTable extends GlyphTable {
}
}
private void populate ( List entries ) {
int i = 0, n = entries.size();
int i = 0;
int n = entries.size();
int[][] gaa = new int [ n ][];
for ( Iterator it = entries.iterator(); it.hasNext();) {
Object o = it.next();
@@ -553,7 +558,8 @@ public class GlyphSubstitutionTable extends GlyphTable {
}
/** {@inheritDoc} */
public boolean substitute ( GlyphSubstitutionState ss ) {
int gi = ss.getGlyph(), ci;
int gi = ss.getGlyph();
int ci;
if ( ( ci = getCoverageIndex ( gi ) ) < 0 ) {
return false;
} else {
@@ -562,7 +568,8 @@ public class GlyphSubstitutionTable extends GlyphTable {
boolean reverse = false;
GlyphTester ignores = ss.getIgnoreDefault();
int[] counts = ss.getGlyphsAvailable ( 0, reverse, ignores );
int nga = counts[0], ngi;
int nga = counts[0];
int ngi;
if ( nga > 1 ) {
int[] iga = ss.getGlyphs ( 0, nga, reverse, ignores, null, counts );
Ligature l = findLigature ( ls, iga );
@@ -653,7 +660,8 @@ public class GlyphSubstitutionTable extends GlyphTable {
}
}
private void populate ( List entries ) {
int i = 0, n = entries.size();
int i = 0;
int n = entries.size();
LigatureSet[] ligatureSets = new LigatureSet [ n ];
for ( Iterator it = entries.iterator(); it.hasNext();) {
Object o = it.next();
@@ -683,7 +691,8 @@ public class GlyphSubstitutionTable extends GlyphTable {
}
/** {@inheritDoc} */
public boolean substitute ( GlyphSubstitutionState ss ) {
int gi = ss.getGlyph(), ci;
int gi = ss.getGlyph();
int ci;
if ( ( ci = getCoverageIndex ( gi ) ) < 0 ) {
return false;
} else {
@@ -1009,7 +1018,8 @@ public class GlyphSubstitutionTable extends GlyphTable {
}
/** {@inheritDoc} */
public boolean substitute ( GlyphSubstitutionState ss ) {
int gi = ss.getGlyph(), ci;
int gi = ss.getGlyph();
int ci;
if ( ( ci = getCoverageIndex ( gi ) ) < 0 ) {
return false;
} else {

+ 5
- 1
src/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java View File

@@ -1678,7 +1678,11 @@ public final class OTFAdvancedTypographicTableReader {
int es = in.readTTFUShort();
// read delta format
int df = in.readTTFUShort();
int s1, m1, dm, dd, s2;
int s1;
int m1;
int dm;
int dd;
int s2;
if ( df == 1 ) {
s1 = 14;
m1 = 0x3;

+ 9
- 4
src/java/org/apache/fop/complexscripts/scripts/DevanagariScriptProcessor.java View File

@@ -238,8 +238,10 @@ public class DevanagariScriptProcessor extends IndicScriptProcessor {
if ( s < 0 ) {
return -1;
} else {
int c, i = 0;
int nc = 0, nh = 0;
int c;
int i = 0;
int nc = 0;
int nh = 0;
do {
// C
if ( ( s + i ) < e ) {
@@ -277,8 +279,11 @@ public class DevanagariScriptProcessor extends IndicScriptProcessor {
if ( s < 0 ) {
return -1;
} else {
int c, i = 0;
int nc = 0, nv = 0, nx = 0;
int c;
int i = 0;
int nc = 0;
int nv = 0;
int nx = 0;
do {
// C
if ( ( s + i ) < e ) {

+ 9
- 4
src/java/org/apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java View File

@@ -238,8 +238,10 @@ public class GujaratiScriptProcessor extends IndicScriptProcessor {
if ( s < 0 ) {
return -1;
} else {
int c, i = 0;
int nc = 0, nh = 0;
int c;
int i = 0;
int nc = 0;
int nh = 0;
do {
// C
if ( ( s + i ) < e ) {
@@ -277,8 +279,11 @@ public class GujaratiScriptProcessor extends IndicScriptProcessor {
if ( s < 0 ) {
return -1;
} else {
int c, i = 0;
int nc = 0, nv = 0, nx = 0;
int c;
int i = 0;
int nc = 0;
int nv = 0;
int nx = 0;
do {
// C
if ( ( s + i ) < e ) {

+ 9
- 4
src/java/org/apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java View File

@@ -239,8 +239,10 @@ public class GurmukhiScriptProcessor extends IndicScriptProcessor {
if ( s < 0 ) {
return -1;
} else {
int c, i = 0;
int nc = 0, nh = 0;
int c;
int i = 0;
int nc = 0;
int nh = 0;
do {
// C
if ( ( s + i ) < e ) {
@@ -278,8 +280,11 @@ public class GurmukhiScriptProcessor extends IndicScriptProcessor {
if ( s < 0 ) {
return -1;
} else {
int c, i = 0;
int nc = 0, nv = 0, nx = 0;
int c;
int i = 0;
int nc = 0;
int nv = 0;
int nx = 0;
do {
// C
if ( ( s + i ) < e ) {

+ 5
- 1
src/java/org/apache/fop/complexscripts/util/GlyphSequence.java View File

@@ -1033,7 +1033,11 @@ public class GlyphSequence implements Cloneable {
*/
private static int[] mergeIntervals ( int[] ia ) {
int ni = ia.length;
int i, n, nm, is, ie;
int i;
int n;
int nm;
int is;
int ie;
// count merged sub-intervals
for ( i = 0, n = ni, nm = 0, is = ie = -1; i < n; i += 2 ) {
int s = ia [ i + 0 ];

+ 3
- 1
src/java/org/apache/fop/fo/expr/ICCColorFunction.java View File

@@ -79,7 +79,9 @@ class ICCColorFunction extends FunctionBase {
}
String src = (cp != null ? cp.getSrc() : "");

float red = 0, green = 0, blue = 0;
float red = 0;
float green = 0;
float blue = 0;
red = args[0].getNumber().floatValue();
green = args[1].getNumber().floatValue();
blue = args[2].getNumber().floatValue();

+ 3
- 1
src/java/org/apache/fop/fo/expr/NamedColorFunction.java View File

@@ -66,7 +66,9 @@ class NamedColorFunction extends FunctionBase {
throw pe;
}

float red = 0, green = 0, blue = 0;
float red = 0;
float green = 0;
float blue = 0;
red = args[0].getNumber().floatValue();
green = args[1].getNumber().floatValue();
blue = args[2].getNumber().floatValue();

+ 2
- 1
src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java View File

@@ -223,7 +223,8 @@ public class RelativeNumericProperty extends Property implements Length {
* specification.
*/
public double getTableUnits() {
double tu1 = 0.0, tu2 = 0.0;
double tu1 = 0.0;
double tu2 = 0.0;
if (op1 instanceof RelativeNumericProperty) {
tu1 = ((RelativeNumericProperty) op1).getTableUnits();
} else if (op1 instanceof TableColLength) {

+ 2
- 1
src/java/org/apache/fop/fo/properties/PropertyCache.java View File

@@ -263,7 +263,8 @@ public final class PropertyCache {

CacheEntry[] newTable = new CacheEntry[newLength];

int hash, idx;
int hash;
int idx;
Object o;
newLength--;
for (int i = table.length; --i >= 0;) {

+ 2
- 1
src/java/org/apache/fop/fonts/AbstractCodePointMapping.java View File

@@ -125,7 +125,8 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
return latin1;
}
}
int bot = 0, top = characters.length - 1;
int bot = 0;
int top = characters.length - 1;
while (top >= bot) {
int mid = (bot + top) / 2;
char mc = characters[mid];

+ 4
- 2
src/java/org/apache/fop/fonts/MultiByteFont.java View File

@@ -489,7 +489,8 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl
private GlyphSequence mapCharsToGlyphs ( CharSequence cs ) {
IntBuffer cb = IntBuffer.allocate ( cs.length() );
IntBuffer gb = IntBuffer.allocate ( cs.length() );
int gi, giMissing = findGlyphIndex ( Typeface.NOT_FOUND );
int gi;
int giMissing = findGlyphIndex ( Typeface.NOT_FOUND );
for ( int i = 0, n = cs.length(); i < n; i++ ) {
int cc = cs.charAt ( i );
if ( ( cc >= 0xD800 ) && ( cc < 0xDC00 ) ) {
@@ -548,7 +549,8 @@ public class MultiByteFont extends CIDFont implements Substitutable, Positionabl
+ (char) cc + "'");
}
if ( cc > 0x00FFFF ) {
int sh, sl;
int sh;
int sl;
cc -= 0x10000;
sh = ( ( cc >> 10 ) & 0x3FF ) + 0xD800;
sl = ( ( cc >> 0 ) & 0x3FF ) + 0xDC00;

+ 2
- 1
src/java/org/apache/fop/fonts/autodetect/WindowsFontDirFinder.java View File

@@ -67,7 +67,8 @@ public class WindowsFontDirFinder implements FontDirFinder {
// should continue if this fails
}
}
File osFontsDir = null, psFontsDir = null;
File osFontsDir = null;
File psFontsDir = null;
if (windir != null) {
// remove any trailing '/'
if (windir.endsWith("/")) {

+ 4
- 2
src/java/org/apache/fop/hyphenation/HyphenationTree.java View File

@@ -84,7 +84,8 @@ public class HyphenationTree extends TernaryTree
* are stored.
*/
protected int packValues(String values) {
int i, n = values.length();
int i;
int n = values.length();
int m = (n & 1) == 1 ? (n >> 1) + 2 : (n >> 1) + 1;
int offset = vspace.alloc(m);
byte[] va = vspace.getArray();
@@ -247,7 +248,8 @@ public class HyphenationTree extends TernaryTree
protected void searchPatterns(char[] word, int index, byte[] il) {
byte[] values;
int i = index;
char p, q;
char p;
char q;
char sp = word[i];
p = root;


+ 5
- 2
src/java/org/apache/fop/hyphenation/TernaryTree.java View File

@@ -271,7 +271,9 @@ public class TernaryTree implements Cloneable, Serializable {
* @return an integer
*/
public static int strcmp(String str, char[] a, int start) {
int i, d, len = str.length();
int i;
int d;
int len = str.length();
for (i = 0; i < len; i++) {
d = (int)str.charAt(i) - a[start + i];
if (d != 0) {
@@ -448,7 +450,8 @@ public class TernaryTree implements Cloneable, Serializable {
public void balance() {
// System.out.print("Before root splitchar = "); System.out.println(sc[root]);

int i = 0, n = length;
int i = 0;
int n = length;
String[] k = new String[n];
char[] v = new char[n];
Iterator iter = new Iterator();

+ 2
- 1
src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java View File

@@ -423,7 +423,8 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager

boolean bpDirectionChanges = blockProgressionDirectionChanges();
Point offset = getAbsOffset();
int allocBPD, allocIPD;
int allocBPD;
int allocIPD;
if (height.getEnum() == EN_AUTO
|| (!height.isAbsolute() && getAncestorBlockAreaBPD() <= 0)) {
//auto height when height="auto" or "if that dimension is not specified explicitly

+ 2
- 1
src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java View File

@@ -70,7 +70,8 @@ public class InlineKnuthSequence extends KnuthSequence {
return false;
}
// does the first element of the first paragraph add to an existing word?
ListElement lastOldElement, firstNewElement;
ListElement lastOldElement;
ListElement firstNewElement;
lastOldElement = getLast();
firstNewElement = sequence.getElement(0);
if (firstNewElement.isBox() && !((KnuthElement) firstNewElement).isAuxiliary()

+ 2
- 1
src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java View File

@@ -1231,7 +1231,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager
ListIterator currParIterator = currPar.listIterator(currPar.ignoreAtStart);
// list of TLM involved in hyphenation
List updateList = new LinkedList();
KnuthElement firstElement, nextElement;
KnuthElement firstElement;
KnuthElement nextElement;
// current InlineLevelLayoutManager
InlineLevelLayoutManager currLM = null;
// number of KnuthBox elements containing word fragments

+ 4
- 2
src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java View File

@@ -1320,7 +1320,8 @@ public class TextLayoutManager extends LeafNodeLayoutManager {

// Find the first and last positions in oldList that point to an AreaInfo
// (i.e. getLeafPos() != -1)
LeafPosition startPos = null, endPos = null;
LeafPosition startPos = null;
LeafPosition endPos = null;
ListIterator oldListIter;
for (oldListIter = oldList.listIterator(); oldListIter.hasNext();) {
Position pos = ((KnuthElement) oldListIter.next()).getPosition();
@@ -1346,7 +1347,8 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
int areaInfosRemoved = 0;

if (!changeList.isEmpty()) {
int oldIndex = -1, changeIndex;
int oldIndex = -1;
int changeIndex;
PendingChange currChange;
ListIterator changeListIterator = changeList.listIterator();
while (changeListIterator.hasNext()) {

+ 2
- 1
src/java/org/apache/fop/pdf/PDFDocument.java View File

@@ -1025,7 +1025,8 @@ public class PDFDocument {
pdf.append(this.objectcount + 1);
pdf.append("\n0000000000 65535 f \n");

String s, loc;
String s;
String loc;
for (int count = 0; count < this.location.size(); count++) {
final String padding = "0000000000";
s = this.location.get(count).toString();

+ 4
- 2
src/java/org/apache/fop/render/intermediate/IFRenderer.java View File

@@ -1146,8 +1146,10 @@ public class IFRenderer extends AbstractPathOrientedRenderer {
private int[][] dp = new int[INITIAL_BUFFER_SIZE][4];
// private int lastDPPos = 0; // TBD - not yet used
private final StringBuffer text = new StringBuffer();
private int startx, starty;
private int tls, tws;
private int startx;
private int starty;
private int tls;
private int tws;
private final boolean combined = false;

void addChar(char ch) {

+ 7
- 2
src/java/org/apache/fop/render/txt/TXTRenderer.java View File

@@ -508,7 +508,8 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
int borderStartX = bm.getStartX();
int borderStartY = bm.getStartY();

int x, y;
int x;
int y;
if (horz && startOrBefore) { // BEFORE
x = borderStartX;
y = borderStartY;
@@ -523,7 +524,11 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
y = borderStartY;
}

int dx, dy, length, startType, endType;
int dx;
int dy;
int length;
int startType;
int endType;
if (horz) {
length = borderWidth;
dx = 1;

+ 9
- 3
src/java/org/apache/fop/svg/PDFGraphics2D.java View File

@@ -1064,7 +1064,8 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand
preparePainting();

Shape clip = getClip();
Rectangle2D usrClipBounds, usrBounds;
Rectangle2D usrClipBounds;
Rectangle2D usrBounds;
usrBounds = shape.getBounds2D();
if (clip != null) {
usrClipBounds = clip.getBounds2D();
@@ -1078,7 +1079,9 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand
double usrW = usrBounds.getWidth();
double usrH = usrBounds.getHeight();

Rectangle devShapeBounds, devClipBounds, devBounds;
Rectangle devShapeBounds;
Rectangle devClipBounds;
Rectangle devBounds;
AffineTransform at = getTransform();
devShapeBounds = at.createTransformedShape(shape).getBounds();
if (clip != null) {
@@ -1117,7 +1120,10 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand
final byte[] rgb = new byte[devW * devH * 3];
final int[] line = new int[devW];
final byte[] mask;
int x, y, val, rgbIdx = 0;
int x;
int y;
int val;
int rgbIdx = 0;

if (pcm.hasAlpha()) {
mask = new byte[devW * devH];

+ 2
- 1
src/java/org/apache/fop/tools/anttasks/FileCompare.java View File

@@ -38,7 +38,8 @@ import java.text.DateFormat;

public class FileCompare {

private String referenceDirectory, testDirectory;
private String referenceDirectory;
private String testDirectory;
private String[] filenameList;
private String filenames;


+ 6
- 2
src/java/org/apache/fop/util/ColorUtil.java View File

@@ -183,7 +183,9 @@ public final class ColorUtil {
*/
private static Color parseAsJavaAWTColor(String value)
throws PropertyException {
float red = 0.0f, green = 0.0f, blue = 0.0f;
float red = 0.0f;
float green = 0.0f;
float blue = 0.0f;
int poss = value.indexOf("[");
int pose = value.indexOf("]");
try {
@@ -315,7 +317,9 @@ public final class ColorUtil {
} else {
alpha = 0xFF;
}
int red = 0, green = 0, blue = 0;
int red = 0;
int green = 0;
int blue = 0;
if ((len == 4) || (len == 5)) {
//multiply by 0x11 = 17 = 255/15
red = Integer.parseInt(value.substring(1, 2), 16) * 0x11;

+ 3
- 1
src/java/org/apache/fop/util/XMLResourceBundle.java View File

@@ -227,7 +227,9 @@ public class XMLResourceBundle extends ResourceBundle {
}

private void setLocale(String name) {
String language = "", country = "", variant = "";
String language = "";
String country = "";
String variant = "";
if (name.length() > 1) {
int nextIndex = name.indexOf('_', 1);
if (nextIndex == -1) {

Loading…
Cancel
Save