aboutsummaryrefslogtreecommitdiffstats
path: root/src/codegen
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2013-11-19 20:20:11 +0000
committerVincent Hennebert <vhennebert@apache.org>2013-11-19 20:20:11 +0000
commit6b16845a94f22905bab9fe9797f00c924aef7ef7 (patch)
tree3021f3084683260388833a80860a7534a49be204 /src/codegen
parent2318d09b63a801f5d490d688c8636912aa785eb1 (diff)
downloadxmlgraphics-fop-6b16845a94f22905bab9fe9797f00c924aef7ef7.tar.gz
xmlgraphics-fop-6b16845a94f22905bab9fe9797f00c924aef7ef7.zip
Restricted CSOFF filter to LineLength and fixed resulting Checkstyle issues
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1543560 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java13
-rw-r--r--src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java48
2 files changed, 28 insertions, 33 deletions
diff --git a/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java b/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java
index 506629ab2..c6845fb1d 100644
--- a/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java
+++ b/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java
@@ -32,7 +32,6 @@ import java.util.TreeSet;
import org.apache.fop.util.License;
// CSOFF: LineLength
-// CSOFF: NoWhitespaceAfter
/**
* <p>Utility for generating a Java class representing bidirectional
@@ -303,7 +302,7 @@ public final class GenerateBidiClass {
sb.setLength(0);
out.println("private static byte[] bcL1 = {");
for (int i = 0; i < bcL1.length; i++) {
- if (! first) {
+ if (!first) {
sb.append(",");
} else {
first = false;
@@ -327,7 +326,7 @@ public final class GenerateBidiClass {
sb.setLength(0);
out.println("private static byte[] bcR1 = {");
for (int i = 0; i < bcR1.length; i++) {
- if (! first) {
+ if (!first) {
sb.append(",");
} else {
first = false;
@@ -351,7 +350,7 @@ public final class GenerateBidiClass {
sb.setLength(0);
out.println("private static int[] bcS1 = {");
for (int i = 0; i < bcS1.length; i++) {
- if (! first) {
+ if (!first) {
sb.append(",");
} else {
first = false;
@@ -375,7 +374,7 @@ public final class GenerateBidiClass {
sb.setLength(0);
out.println("private static int[] bcE1 = {");
for (int i = 0; i < bcE1.length; i++) {
- if (! first) {
+ if (!first) {
sb.append(",");
} else {
first = false;
@@ -399,7 +398,7 @@ public final class GenerateBidiClass {
sb.setLength(0);
out.println("private static byte[] bcC1 = {");
for (int i = 0; i < bcC1.length; i++) {
- if (! first) {
+ if (!first) {
sb.append(",");
} else {
first = false;
@@ -434,7 +433,7 @@ public final class GenerateBidiClass {
if (k >= 0) {
return ca [ k ];
} else {
- k = - (k + 1);
+ k = -(k + 1);
if (k == 0) {
return BidiConstants.L;
} else if (ch <= ea [ k - 1 ]) {
diff --git a/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java b/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java
index 0c02e305e..d13ab2534 100644
--- a/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java
+++ b/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiTestData.java
@@ -40,10 +40,6 @@ import java.util.TreeMap;
import org.apache.fop.util.License;
// CSOFF: LineLengthCheck
-// CSOFF: NoWhitespaceAfterCheck
-// CSOFF: InnerAssignmentCheck
-// CSOFF: SimplifyBooleanReturnCheck
-// CSOFF: EmptyForIteratorPadCheck
/**
* <p>Utility for generating a Java class and associated data files representing
@@ -202,7 +198,7 @@ public final class GenerateBidiTestData {
String ucName = sa[1];
if (isBlockStart(ucName)) {
String ucBlock = getBlockName(ucName);
- if (! im.containsKey(ucBlock)) {
+ if (!im.containsKey(ucBlock)) {
im.put(ucBlock, new int[] { uc, -1, bc });
} else {
throw new IllegalArgumentException("duplicate start of block '" + ucBlock + "' at entry: " + line);
@@ -223,7 +219,7 @@ public final class GenerateBidiTestData {
} else {
Integer k = Integer.valueOf(bc);
List sl;
- if (! sm.containsKey(k)) {
+ if (!sm.containsKey(k)) {
sl = new ArrayList();
sm.put(k, sl);
} else {
@@ -267,7 +263,7 @@ public final class GenerateBidiTestData {
}
}
// populate intervals from (block) interval map
- if (! im.isEmpty()) {
+ if (!im.isEmpty()) {
for (Iterator it = im.values().iterator(); it.hasNext(); ) {
int[] ba = (int[]) it.next();
assert (ba != null) && (ba.length > 2);
@@ -335,7 +331,7 @@ public final class GenerateBidiTestData {
continue;
} else if (line.startsWith("#")) {
continue;
- } else if (line.startsWith(PFX_TYPE) && ! ignoreDeprecatedTypeData) {
+ } else if (line.startsWith(PFX_TYPE) && !ignoreDeprecatedTypeData) {
List lines = new ArrayList();
if ((n = readType(line, b, lines)) < 0) {
break;
@@ -356,14 +352,14 @@ public final class GenerateBidiTestData {
// dump instrumentation
if (verbose) {
System.out.println();
- if (! ignoreDeprecatedTypeData) {
+ if (!ignoreDeprecatedTypeData) {
System.out.println("Read type ranges : " + numTypeRanges);
}
System.out.println("Read level specs : " + numLevelSpecs);
System.out.println("Read test specs : " + numTestSpecs);
System.out.println("Read lines : " + lineNumber);
}
- if (! ignoreDeprecatedTypeData) {
+ if (!ignoreDeprecatedTypeData) {
td = (int[][]) tdl.toArray(new int [ tdl.size() ] []);
}
ld = (int[][]) ldl.toArray(new int [ ldl.size() ] []);
@@ -378,12 +374,12 @@ public final class GenerateBidiTestData {
boolean done = false;
int n = 0;
lines.add(line);
- while (! done) {
+ while (!done) {
switch (testPrefix(b, PFX_LEVELS)) {
case 0: // within current levels
if ((line = b.readLine()) != null) {
n++;
- if ((line.length() > 0) && ! line.startsWith("#")) {
+ if ((line.length() > 0) && !line.startsWith("#")) {
lines.add(line);
}
} else {
@@ -509,7 +505,7 @@ public final class GenerateBidiTestData {
CharacterIterator ci = new StringCharacterIterator(charRanges);
// read initial list delimiter
skipSpace(ci);
- if (! readStartOfList(ci)) {
+ if (!readStartOfList(ci)) {
badRangeSpec("missing initial list delimiter", charRanges);
}
// read negation token if present
@@ -538,7 +534,7 @@ public final class GenerateBidiTestData {
String s;
skipSpace(ci);
if ((s = maybeReadSeparator(ci)) != null) {
- if ((s.length() != 0) && ! s.equals("||")) {
+ if ((s.length() != 0) && !s.equals("||")) {
badRangeSpec("invalid item separator \"" + s + "\"", charRanges);
}
}
@@ -557,10 +553,10 @@ public final class GenerateBidiTestData {
}
// read terminating list delimiter
skipSpace(ci);
- if (! readEndOfList(ci)) {
+ if (!readEndOfList(ci)) {
badRangeSpec("missing terminating list delimiter", charRanges);
}
- if (! atEnd(ci)) {
+ if (!atEnd(ci)) {
badRangeSpec("extraneous content prior to end of line", ci);
}
if (negated) {
@@ -578,9 +574,9 @@ public final class GenerateBidiTestData {
}
private static void skipSpace(CharacterIterator ci) {
- while (! atEnd(ci)) {
+ while (!atEnd(ci)) {
char c = ci.current();
- if (! Character.isWhitespace(c)) {
+ if (!Character.isWhitespace(c)) {
break;
} else {
ci.next();
@@ -589,7 +585,7 @@ public final class GenerateBidiTestData {
}
private static boolean maybeReadNext(CharacterIterator ci, char next) {
- while (! atEnd(ci)) {
+ while (!atEnd(ci)) {
char c = ci.current();
if (c == next) {
ci.next();
@@ -906,7 +902,7 @@ public final class GenerateBidiTestData {
List ll = new ArrayList();
// read prefix
skipSpace(ci);
- if (! maybeReadToken(ci, PFX_LEVELS)) {
+ if (!maybeReadToken(ci, PFX_LEVELS)) {
badLevelSpec("missing prefix \"" + PFX_LEVELS + "\"", ci);
}
// read level values
@@ -924,7 +920,7 @@ public final class GenerateBidiTestData {
}
// read to end of line
skipSpace(ci);
- if (! atEnd(ci)) {
+ if (!atEnd(ci)) {
badLevelSpec("extraneous content prior to end of line", ci);
}
if (ll.size() == 0) {
@@ -1007,7 +1003,7 @@ public final class GenerateBidiTestData {
List rl = new ArrayList();
// read prefix
skipSpace(ci);
- if (! maybeReadToken(ci, PFX_REORDER)) {
+ if (!maybeReadToken(ci, PFX_REORDER)) {
badReorderSpec("missing prefix \"" + PFX_REORDER + "\"", ci);
}
// read reorder values
@@ -1023,7 +1019,7 @@ public final class GenerateBidiTestData {
}
// read to end of line
skipSpace(ci);
- if (! atEnd(ci)) {
+ if (!atEnd(ci)) {
badReorderSpec("extraneous content prior to end of line", ci);
}
return createReorderArray(rl, levels);
@@ -1066,7 +1062,7 @@ public final class GenerateBidiTestData {
CharacterIterator ci = new StringCharacterIterator(line);
List cl = new ArrayList();
// read bidi class identifier sequence
- while (! atEnd(ci) && ! maybeReadNext(ci, ';')) {
+ while (!atEnd(ci) && !maybeReadNext(ci, ';')) {
skipSpace(ci);
int bc;
if ((bc = maybeReadBidiClass(ci)) >= 0) {
@@ -1086,7 +1082,7 @@ public final class GenerateBidiTestData {
}
// read to end of line
skipSpace(ci);
- if (! atEnd(ci)) {
+ if (!atEnd(ci)) {
badTestSpec("extraneous content prior to end of line", ci);
}
return createTestArray(cl, bs, levels);
@@ -1244,7 +1240,7 @@ public final class GenerateBidiTestData {
ok = false;
}
}
- if (! ok) {
+ if (!ok) {
System.out.println("Usage: GenerateBidiTestData [-v] [-i] [-d <ucdFile>] [-b <bidiFile>] [-o <outputFile>]");
System.out.println(" defaults:");
if (ignoreDeprecatedTypeData) {