Browse Source

Fixed Checkstyle warnings and replaced a java 1.5 class


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@808166 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_0
Simon Pepping 15 years ago
parent
commit
4bd1866092

+ 8
- 8
src/java/org/apache/fop/hyphenation/PatternParser.java View File

@@ -47,14 +47,14 @@ import javax.xml.parsers.SAXParserFactory;
*/
public class PatternParser extends DefaultHandler implements PatternConsumer {

XMLReader parser;
int currElement;
PatternConsumer consumer;
StringBuffer token;
ArrayList exception;
char hyphenChar;
String errMsg;
boolean hasClasses = false;
private XMLReader parser;
private int currElement;
private PatternConsumer consumer;
private StringBuffer token;
private ArrayList exception;
private char hyphenChar;
private String errMsg;
private boolean hasClasses = false;

static final int ELEM_CLASSES = 1;
static final int ELEM_EXCEPTIONS = 2;

+ 11
- 5
src/java/org/apache/fop/hyphenation/SerializeHyphPattern.java View File

@@ -42,19 +42,21 @@ public class SerializeHyphPattern {
}

/**
* {@inheritDoc}
* Compile all xml files in sourceDir, and write output hyp files in targetDir
* @param sourceDir Directory with pattern xml files
* @param targetDir Directory to which compiled pattern hyp files should be written
*/
public void serializeDir(File sourceDir, File targetDir) {
final String extension = ".xml";
String[] sourceFiles = sourceDir.list(new FilenameFilter() {
public boolean accept(File dir, String name) {
return(name.endsWith(extension));
return name.endsWith(extension);
}
});
for (int j = 0; j < sourceFiles.length; j++) {
File infile = new File(sourceDir, sourceFiles[j]);
String outfilename =
sourceFiles[j].substring(0, sourceFiles[j].length() - extension.length()) + ".hyp";
String outfilename = sourceFiles[j].substring(0, sourceFiles[j].length()
- extension.length()) + ".hyp";
File outfile = new File(targetDir, outfilename);
serializeFile(infile, outfile);
}
@@ -124,7 +126,11 @@ public class SerializeHyphPattern {
} // end rebuild


public static void main (String args[]) {
/**
* Entry point for ant java task
* @param args sourceDir, targetDir
*/
public static void main (String[] args) {
SerializeHyphPattern ser = new SerializeHyphPattern();
ser.serializeDir(new File(args[0]), new File(args[1]));
}

+ 1
- 1
src/java/org/apache/fop/hyphenation/UnicodeClasses.java View File

@@ -211,7 +211,7 @@ public final class UnicodeClasses {
if (!"".equals(fields[SIMPLE_TITLECASE_MAPPING])) {
titlecode = Integer.parseInt(fields[SIMPLE_TITLECASE_MAPPING], 16);
}
StringBuilder s = new StringBuilder();
StringBuffer s = new StringBuffer();
if (hexcode) {
s.append("0x" + fields[UNICODE].replaceFirst("^0+", "").toLowerCase() + " ");
}

Loading…
Cancel
Save