[FOray-commit] SF.net SVN: foray: [7808] trunk/foray/foray-common
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-07-22 19:42:39
|
Revision: 7808 Author: victormote Date: 2006-07-22 12:42:06 -0700 (Sat, 22 Jul 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7808&view=rev Log Message: ----------- Implement standard use of "final" modifier on local variables and parameters. Modified Paths: -------------- trunk/foray/foray-common/.project trunk/foray/foray-common/src/java/org/foray/common/ClassService.java trunk/foray/foray-common/src/java/org/foray/common/ColorSpaceCMYK.java trunk/foray/foray-common/src/java/org/foray/common/Configuration.java trunk/foray/foray-common/src/java/org/foray/common/Environment.java trunk/foray/foray-common/src/java/org/foray/common/IOUtil.java trunk/foray/foray-common/src/java/org/foray/common/ISO639.java trunk/foray/foray-common/src/java/org/foray/common/Logging.java trunk/foray/foray-common/src/java/org/foray/common/MUserAgent.java trunk/foray/foray-common/src/java/org/foray/common/OrderedTreeNode.java trunk/foray/foray-common/src/java/org/foray/common/RandomReader.java trunk/foray/foray-common/src/java/org/foray/common/RandomReaderArray.java trunk/foray/foray-common/src/java/org/foray/common/RandomReaderRAFile.java trunk/foray/foray-common/src/java/org/foray/common/RandomReaderURL.java trunk/foray/foray-common/src/java/org/foray/common/SVGUserAgent.java trunk/foray/foray-common/src/java/org/foray/common/StringUtil.java trunk/foray/foray-common/src/java/org/foray/common/StringUtilPre5.java trunk/foray/foray-common/src/java/org/foray/common/XMLCharacter.java trunk/foray/foray-common/src/java/org/foray/common/XMLParser.java trunk/foray/foray-common/src/java/org/foray/common/XMLUtil.java trunk/foray/foray-common/src/java/org/foray/common/sax/DocumentInputSource.java trunk/foray/foray-common/src/java/org/foray/common/sax/DocumentReader.java trunk/foray/foray-common/src/java/org/foray/common/url/AbstractProtocolRegistration.java trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java trunk/foray/foray-common/src/java/org/foray/common/url/FactoryProtocolRegistration.java trunk/foray/foray-common/src/java/org/foray/common/url/PropertyProtocolRegistration.java trunk/foray/foray-common/src/java/org/foray/common/url/ProtocolRegistrationBroker.java trunk/foray/foray-common/src/java/org/foray/common/url/URLFactory.java trunk/foray/foray-common/src/java/org/foray/common/url/URLUtil.java trunk/foray/foray-common/src/java/org/foray/common/url/UniversalProtocolRegistration.java trunk/foray/foray-common/src/java/org/foray/common/url/classpath/Handler.java Modified: trunk/foray/foray-common/.project =================================================================== --- trunk/foray/foray-common/.project 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/.project 2006-07-22 19:42:06 UTC (rev 7808) @@ -6,12 +6,12 @@ </projects> <buildSpec> <buildCommand> - <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name> + <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> + <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name> <arguments> </arguments> </buildCommand> Modified: trunk/foray/foray-common/src/java/org/foray/common/ClassService.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/ClassService.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/ClassService.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -43,14 +43,14 @@ static HashMap providerMap = new HashMap(); - public static synchronized Enumeration providers(Class cls) { + public static synchronized Enumeration providers(final Class cls) { ClassLoader cl = cls.getClassLoader(); // null if loaded by bootstrap class loader if(cl == null) { cl = ClassLoader.getSystemClassLoader(); } - String serviceFile = "META-INF/services/" + cls.getName(); + final String serviceFile = "META-INF/services/" + cls.getName(); Vector v = (Vector)providerMap.get(serviceFile); if (v != null) { @@ -63,23 +63,23 @@ Enumeration e; try { e = cl.getResources(serviceFile); - } catch (IOException ioe) { + } catch (final IOException ioe) { return v.elements(); } while (e.hasMoreElements()) { try { - URL u = (URL)e.nextElement(); + final URL u = (URL)e.nextElement(); - InputStream is = u.openStream(); - InputStreamReader r = new InputStreamReader(is, "UTF-8"); - BufferedReader br = new BufferedReader(r); + final InputStream is = u.openStream(); + final InputStreamReader r = new InputStreamReader(is, "UTF-8"); + final BufferedReader br = new BufferedReader(r); String line = br.readLine(); while (line != null) { try { // First strip any comment... - int idx = line.indexOf('#'); + final int idx = line.indexOf('#'); if (idx != -1) { line = line.substring(0, idx); } @@ -97,13 +97,13 @@ // Object obj = cl.loadClass(line).newInstance(); // stick it into our vector... v.add(line); - } catch (Exception ex) { + } catch (final Exception ex) { // Just try the next line } line = br.readLine(); } - } catch (Exception ex) { + } catch (final Exception ex) { // Just try the next file... } Modified: trunk/foray/foray-common/src/java/org/foray/common/ColorSpaceCMYK.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/ColorSpaceCMYK.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/ColorSpaceCMYK.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -41,45 +41,45 @@ /** * {@inheritDoc} */ - public float[] toRGB(float[] colorvalue) { + public float[] toRGB(final float[] colorvalue) { if (colorvalue == null) { return null; } if (colorvalue.length < this.getNumComponents()) { throw new ArrayIndexOutOfBoundsException(); } - float cyan = colorvalue[0]; - float magenta = colorvalue[1]; - float yellow = colorvalue[2]; - float black = colorvalue[3]; + final float cyan = colorvalue[0]; + final float magenta = colorvalue[1]; + final float yellow = colorvalue[2]; + final float black = colorvalue[3]; - float red = 1.0f - cyan + (black / BLACK_FACTOR); - float green = 1.0f - magenta + (black / BLACK_FACTOR); - float blue = 1.0f - yellow + (black / BLACK_FACTOR); + final float red = 1.0f - cyan + (black / BLACK_FACTOR); + final float green = 1.0f - magenta + (black / BLACK_FACTOR); + final float blue = 1.0f - yellow + (black / BLACK_FACTOR); return new float[] {red, green, blue}; } /** * {@inheritDoc} */ - public float[] fromRGB(float[] rgbvalue) { + public float[] fromRGB(final float[] rgbvalue) { if (rgbvalue == null) { return null; } if (rgbvalue.length < 3) { throw new ArrayIndexOutOfBoundsException(); } - float red = rgbvalue[0]; - float green = rgbvalue[1]; - float blue = rgbvalue[2]; + final float red = rgbvalue[0]; + final float green = rgbvalue[1]; + final float blue = rgbvalue[2]; - float cyan = 1.0f - red; - float magenta = 1.0f - green; - float yellow = 1.0f - blue; + final float cyan = 1.0f - red; + final float magenta = 1.0f - green; + final float yellow = 1.0f - blue; /* Pick the lowest color. */ - float temp = Math.min(red, Math.min(green, blue)); - float black = temp / BLACK_FACTOR; + final float temp = Math.min(red, Math.min(green, blue)); + final float black = temp / BLACK_FACTOR; return new float[] {cyan, magenta, yellow, black}; } @@ -87,7 +87,7 @@ /** * {@inheritDoc} */ - public float[] toCIEXYZ(float[] colorvalue) { + public float[] toCIEXYZ(final float[] colorvalue) { /* TODO: Implement this. */ return null; } @@ -95,7 +95,7 @@ /** * {@inheritDoc} */ - public float[] fromCIEXYZ(float[] colorvalue) { + public float[] fromCIEXYZ(final float[] colorvalue) { /* TODO: Implement this. */ return null; } @@ -107,9 +107,9 @@ return THE_INSTANCE; } - public static Color makeColor(float cyan, float magenta, float yellow, - float black) { - float[] cmykArray = new float[] {cyan, magenta, yellow, black}; + public static Color makeColor(final float cyan, final float magenta, + final float yellow, final float black) { + final float[] cmykArray = new float[] {cyan, magenta, yellow, black}; return new Color(ColorSpaceCMYK.theInstance(), cmykArray, 0); } Modified: trunk/foray/foray-common/src/java/org/foray/common/Configuration.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/Configuration.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/Configuration.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -73,7 +73,7 @@ */ private Map precedence = new HashMap(30); - protected Configuration(Log logger) { + protected Configuration(final Log logger) { this.logger = logger; setDefaults(); } @@ -95,7 +95,7 @@ * convenience methods, which return the correct form, * null if the key is not defined. */ - protected Object getValue(String key) { + protected Object getValue(final String key) { return options.get(key); } @@ -105,8 +105,8 @@ * @return String a string containing the value, * null if the key is not defined. */ - protected String getStringValue(String key) { - Object obj = getValue(key); + protected String getStringValue(final String key) { + final Object obj = getValue(key); if (obj instanceof String) { return (String)obj; } @@ -119,8 +119,8 @@ * @return int a int containing the value, * -1 if the key is not defined. */ - protected int getIntValue(String key) { - Object obj = getValue(key); + protected int getIntValue(final String key) { + final Object obj = getValue(key); if (obj instanceof String) { return Integer.parseInt((String)obj); } @@ -133,8 +133,8 @@ * @return Boolean true or false as value, * null if the key is not defined. */ - protected Boolean getBooleanValue(String key) { - Object obj = getValue(key); + protected Boolean getBooleanValue(final String key) { + final Object obj = getValue(key); if (obj instanceof String) { return new Boolean((String)obj); } else if (obj instanceof Boolean) { @@ -150,8 +150,8 @@ * @return List a List containing the values, * null if the key is not defined. */ - protected List getListValue(String key) { - Object obj = getValue(key); + protected List getListValue(final String key) { + final Object obj = getValue(key); if (obj instanceof List) { return (List)obj; } @@ -168,8 +168,9 @@ * @param key A string containing the key value for the configuration value. * @param value The object containing the configuration value. */ - protected void put(String key, Object value, int precedenceValue) { - Integer oldPrecedence = (Integer) this.precedence.get(key); + protected void put(final String key, final Object value, + final int precedenceValue) { + final Integer oldPrecedence = (Integer) this.precedence.get(key); if (oldPrecedence == null) { // Key does not already exist. Add it. putInMap(key, value, precedenceValue); @@ -199,18 +200,19 @@ * Adds an item to the configuration without giving the subclass an * opportunity to validate it. */ - protected void addUnvalidatedOption(String key, Object value, - int precedenceValue) { + protected void addUnvalidatedOption(final String key, final Object value, + final int precedenceValue) { put(key, value, precedenceValue); } - private void putInMap(String key, Object value, int precedenceValue) { - Integer newPrecedence = new Integer(precedenceValue); + private void putInMap(final String key, final Object value, + final int precedenceValue) { + final Integer newPrecedence = new Integer(precedenceValue); this.precedence.put(key, newPrecedence); this.options.put(key, value); } - protected Boolean parseBoolean(String key, String value) { + protected Boolean parseBoolean(final String key, final String value) { if (value.equalsIgnoreCase("true")) { return Boolean.TRUE; } @@ -222,49 +224,50 @@ return null; } - protected URL parseURLDirectory(String key, String directory) { + protected URL parseURLDirectory(final String key, final String directory) { URL baseURL = null; try { if (directory == null) { return URLFactory.createURL("."); } - File dir = new File(directory); + final File dir = new File(directory); if (dir.isDirectory()) { return dir.toURL(); } baseURL = URLFactory.createURL(directory); - } catch (MalformedURLException e) { + } catch (final MalformedURLException e) { this.getLogger().error("Invalid " + key + ": " + directory + " (" + e.getMessage() + ")"); } return baseURL; } - protected URL parseURLFile(String key, String fileName) { + protected URL parseURLFile(final String key, final String fileName) { URL url = null; if (fileName == null) { return null; } try { - File file = new File(fileName); + final File file = new File(fileName); if (file.isFile()) { url = file.toURL(); } else { this.getLogger().error("Invalid URL (" + key + "): " + fileName); } - } catch (MalformedURLException mfue) { + } catch (final MalformedURLException mfue) { this.getLogger().error("Invalid " + key + ": " + fileName + " (" + mfue.getMessage() + ")"); } return url; } - protected ArrayList parseSpaceDelimitedList(String key, String value) { - ArrayList list = new ArrayList(); - StringTokenizer tokenizer = new StringTokenizer(value); + protected ArrayList parseSpaceDelimitedList(final String key, + final String value) { + final ArrayList list = new ArrayList(); + final StringTokenizer tokenizer = new StringTokenizer(value); while (tokenizer.hasMoreTokens()) { - String item = tokenizer.nextToken(); + final String item = tokenizer.nextToken(); list.add(item); } return list; @@ -276,19 +279,19 @@ */ public void dumpConfiguration() { logger.info("Dumping configuration: " + getName()); - Iterator iterator = options.keySet().iterator(); + final Iterator iterator = options.keySet().iterator(); while (iterator.hasNext()) { - String key = (String)iterator.next(); + final String key = (String)iterator.next(); logger.info("key: " + key); - Object value = options.get(key); + final Object value = options.get(key); if (value instanceof String) { logger.info(" value: " + value); } else if (value instanceof List) { - StringBuffer valueString = new StringBuffer(); - List list = (List) value; + final StringBuffer valueString = new StringBuffer(); + final List list = (List) value; valueString.append(" value: "); for (int i = 0; i < list.size(); i++) { - String item = (String) list.get(i); + final String item = (String) list.get(i); valueString.append(item + " "); } logger.info(valueString.toString()); Modified: trunk/foray/foray-common/src/java/org/foray/common/Environment.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/Environment.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/Environment.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -54,9 +54,9 @@ GraphicsEnvironment ge = null; try { ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); - } catch (LinkageError e) { + } catch (final LinkageError e) { return false; - } catch (InternalError e1) { + } catch (final InternalError e1) { return false; } return (ge != null); @@ -75,9 +75,9 @@ /* TODO: Remove this method and replace all dependencies on it with * System.getenv(String name) after Java 1.5 is the lowest supported * runtime. */ - public static String getenv(String name) { + public static String getenv(final String name) { String[] command = null; - String fileSeparator = System.getProperty("file.separator"); + final String fileSeparator = System.getProperty("file.separator"); if (fileSeparator.equals("/")) { command = new String[2]; command[0] = "printenv"; @@ -92,23 +92,23 @@ String value = null; Process process = null; try { - Runtime runtime = Runtime.getRuntime(); + final Runtime runtime = Runtime.getRuntime(); process = runtime.exec(command); if (process == null) { return null; } - InputStream stdout = process.getInputStream(); - InputStreamReader isr = new InputStreamReader(stdout); - BufferedReader br = new BufferedReader(isr); + final InputStream stdout = process.getInputStream(); + final InputStreamReader isr = new InputStreamReader(stdout); + final BufferedReader br = new BufferedReader(isr); value = br.readLine(); - int exitValue = process.waitFor(); + final int exitValue = process.waitFor(); if (exitValue != 0) { return null; } - } catch (IOException e) { + } catch (final IOException e) { // Punt. return null; - } catch (InterruptedException e) { + } catch (final InterruptedException e) { // Punt. return null; } finally { Modified: trunk/foray/foray-common/src/java/org/foray/common/IOUtil.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/IOUtil.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/IOUtil.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -47,7 +47,7 @@ * @param out OutputStream to write to * @throws IOException In case of an I/O problem */ - public static void copyStream(InputStream in, OutputStream out) + public static void copyStream(final InputStream in, final OutputStream out) throws IOException { final int bufferSize = 2048; final byte[] buf = new byte[bufferSize]; @@ -67,9 +67,9 @@ * @return byte[] the array of bytes requested * @throws IOException In case of an I/O problem */ - public static byte[] toByteArray(InputStream in, - int initialTargetBufferSize) throws IOException { - ByteArrayOutputStream baout = + public static byte[] toByteArray(final InputStream in, + final int initialTargetBufferSize) throws IOException { + final ByteArrayOutputStream baout = new ByteArrayOutputStream(initialTargetBufferSize); try { copyStream(in, baout); Modified: trunk/foray/foray-common/src/java/org/foray/common/ISO639.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/ISO639.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/ISO639.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -627,7 +627,7 @@ * @return True iff <code>languageCode</code> is a valid 2- or 3-character * ISO 639 language code. */ - public static boolean validLanguage(String languageCode) { + public static boolean validLanguage(final String languageCode) { int index = Arrays.binarySearch(codes3Letter, languageCode); if (index >= 0) { return true; Modified: trunk/foray/foray-common/src/java/org/foray/common/Logging.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/Logging.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/Logging.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -43,22 +43,22 @@ } public static Log makeDefaultLogger() { - Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO); + final Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO); return new AvalonLogger(logger); } public static Log makeDebugLogger() { - Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG); + final Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG); return new AvalonLogger(logger); } public static Log makeQuietLogger() { - Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_ERROR); + final Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_ERROR); return new AvalonLogger(logger); } public static Log makeWarningLogger() { - Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_WARN); + final Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_WARN); return new AvalonLogger(logger); } Modified: trunk/foray/foray-common/src/java/org/foray/common/MUserAgent.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/MUserAgent.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/MUserAgent.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -43,14 +43,14 @@ /** * Creates a new SVGUserAgent. */ - public MUserAgent(AffineTransform at) { + public MUserAgent(final AffineTransform at) { super(at); } /** * Opens a link in a new component. */ - public void openLink(SVGAElement elt) { + public void openLink(final SVGAElement elt) { // application.openLink(uri); } @@ -58,7 +58,7 @@ return new Point(0, 0); } - public void setSVGCursor(Cursor cursor) {} + public void setSVGCursor(final Cursor cursor) {} public Dimension2D getViewportSize() { return new Dimension(100, 100); Modified: trunk/foray/foray-common/src/java/org/foray/common/OrderedTreeNode.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/OrderedTreeNode.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/OrderedTreeNode.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -64,7 +64,7 @@ List children; int nextIndex = 0; - ListEnumeration(List children) { + ListEnumeration(final List children) { this.children = children; nextIndex = 0; } @@ -80,7 +80,7 @@ if (! hasMoreElements()) { throw new NoSuchElementException("No more elements"); } - Object nextElement = children.get(this.nextIndex); + final Object nextElement = children.get(this.nextIndex); this.nextIndex ++; return nextElement; } @@ -88,7 +88,7 @@ private OrderedTreeNode parent; - public OrderedTreeNode(OrderedTreeNode parent) { + public OrderedTreeNode(final OrderedTreeNode parent) { this.parent = parent; } @@ -115,7 +115,7 @@ /** * {@inheritDoc} */ - public TreeNode getChildAt(int childIndex) { + public TreeNode getChildAt(final int childIndex) { if (childIndex < 0) { return null; } @@ -138,7 +138,7 @@ /** * {@inheritDoc} */ - public int getIndex(TreeNode node) { + public int getIndex(final TreeNode node) { if (getChildren() == null) { return -1; } @@ -169,7 +169,7 @@ if (parent == null) { return null; } - List children = parent.getChildren(); + final List children = parent.getChildren(); if (children == null) { return null; } @@ -180,7 +180,7 @@ * {@inheritDoc} */ public int siblingIndex() { - List siblings = getSiblings(); + final List siblings = getSiblings(); if (siblings == null) { return -1; } @@ -191,7 +191,7 @@ * {@inheritDoc} */ public org.axsl.common.OrderedTreeNode getPreviousSibling() { - int mySiblingIndex = siblingIndex(); + final int mySiblingIndex = siblingIndex(); if (mySiblingIndex < 1) { return null; } @@ -202,7 +202,7 @@ * {@inheritDoc} */ public org.axsl.common.OrderedTreeNode getNextSibling() { - int mySiblingIndex = siblingIndex(); + final int mySiblingIndex = siblingIndex(); if (mySiblingIndex < 0) { return null; } @@ -217,7 +217,7 @@ * Changes this nodes parent. * @param newParent The new parent of this node. */ - public void setParent(OrderedTreeNode newParent) { + public void setParent(final OrderedTreeNode newParent) { this.parent = newParent; } @@ -235,7 +235,7 @@ * {@inheritDoc} */ public org.axsl.common.OrderedTreeNode getFirstChild() { - List children = getChildren(); + final List children = getChildren(); if (children == null) { return null; } @@ -249,7 +249,7 @@ * {@inheritDoc} */ public org.axsl.common.OrderedTreeNode getLastChild() { - List children = getChildren(); + final List children = getChildren(); if (children == null) { return null; } @@ -310,7 +310,7 @@ */ public org.axsl.common.OrderedTreeNode getNextLeaf() { org.axsl.common.OrderedTreeNode nextSibling; - OrderedTreeNode myParent = (OrderedTreeNode) getParent(); + final OrderedTreeNode myParent = (OrderedTreeNode) getParent(); if (myParent == null) { return null; } @@ -327,7 +327,7 @@ */ public org.axsl.common.OrderedTreeNode getPreviousLeaf() { org.axsl.common.OrderedTreeNode previousSibling; - OrderedTreeNode myParent = (OrderedTreeNode) getParent(); + final OrderedTreeNode myParent = (OrderedTreeNode) getParent(); if (myParent == null) { return null; } Modified: trunk/foray/foray-common/src/java/org/foray/common/RandomReader.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/RandomReader.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/RandomReader.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -73,7 +73,7 @@ * Constructor suitable for a local file. * @param url The URL to the file that will be read. */ - public RandomReader(URL url) throws IOException { + public RandomReader(final URL url) throws IOException { this.realReader = randomInputFactory(url); } @@ -84,15 +84,15 @@ * <code>byteArray</code>. * @param byteArray The byte array that should be read. */ - public RandomReader(String description, byte[] byteArray) { + public RandomReader(final String description, final byte[] byteArray) { this.realReader = randomInputFactory(description, byteArray); } - private RandomInput randomInputFactory(URL url) throws IOException { + private RandomInput randomInputFactory(final URL url) throws IOException { if (url == null) { throw new IOException("URL is null."); } - File file = new File(url.getFile()); + final File file = new File(url.getFile()); if (! file.canRead()) { /* If we can't get a readable file out of it, we need to use the URL * implementation instead. */ @@ -101,8 +101,8 @@ return new RandomReaderRAFile(file); } - private RandomInput randomInputFactory(String description, - byte[] byteArray) { + private RandomInput randomInputFactory(final String description, + final byte[] byteArray) { /* Right now, there is only one available implementation. */ return new RandomReaderArray(description, byteArray); } @@ -110,7 +110,7 @@ /** * {@inheritDoc} */ - public void seek(long pos) throws IOException { + public void seek(final long pos) throws IOException { realReader.seek(pos); } @@ -131,21 +131,22 @@ /** * {@inheritDoc} */ - public void readFully(byte[] b) throws IOException { + public void readFully(final byte[] b) throws IOException { realReader.readFully(b); } /** * {@inheritDoc} */ - public void readFully(byte[] b, int off, int len) throws IOException { + public void readFully(final byte[] b, final int off, final int len) + throws IOException { realReader.readFully(b, off, len); } /** * {@inheritDoc} */ - public int skipBytes(int n) throws IOException { + public int skipBytes(final int n) throws IOException { return realReader.skipBytes(n); } @@ -260,10 +261,10 @@ * @return The unsigned integral. */ public long readUnsignedIntLoHi() throws IOException { - int byte1 = readUnsignedByte(); - int byte2 = readUnsignedByte(); - int byte3 = readUnsignedByte(); - int byte4 = readUnsignedByte(); + final int byte1 = readUnsignedByte(); + final int byte2 = readUnsignedByte(); + final int byte3 = readUnsignedByte(); + final int byte4 = readUnsignedByte(); return ((byte4 << 24) + (byte3 << 16) + (byte2 << 8) + (byte1 << 0)); } @@ -275,8 +276,8 @@ * @return The unsigned integral. */ public int readUnsignedShortLoHi() throws IOException { - int byte1 = readUnsignedByte(); - int byte2 = readUnsignedByte(); + final int byte1 = readUnsignedByte(); + final int byte2 = readUnsignedByte(); return ((byte2 << 8) + (byte1 << 0)); } @@ -287,8 +288,8 @@ * @return The unsigned integral. */ public int readShortLoHi() throws IOException { - int byte1 = readByte(); - int byte2 = readByte(); + final int byte1 = readByte(); + final int byte2 = readByte(); return ((byte2 << 8) + (byte1 << 0)); } @@ -298,14 +299,14 @@ * @param charEncoding The encoding scheme to be used for interpreting the * characters in the string. */ - public String readString(int stringSize, String charEncoding) + public String readString(final int stringSize, String charEncoding) throws IOException { if ((stringSize + getFilePointer()) > length()) { throw new EOFException("Reached EOF, file size=" + length()); } charEncoding = stringEncodingToUse(charEncoding); - byte[] tmp = new byte[stringSize]; + final byte[] tmp = new byte[stringSize]; for (int i = 0; i < stringSize; i++) { tmp[i] = readByte(); } @@ -318,10 +319,10 @@ * * @return The string read. */ - public String readTerminatedString(byte terminatingChar, - String charEncoding) throws IOException { + public String readTerminatedString(final byte terminatingChar, + final String charEncoding) throws IOException { // We're going to read ahead here, so save the location - long saveLocation = getFilePointer(); + final long saveLocation = getFilePointer(); int stringSize = 0; byte inByte = readByte(); while (inByte != terminatingChar) { @@ -347,7 +348,7 @@ * @return charEncoding, if it is valid. Otherwise, the best valid character * encoding scheme found. */ - private String stringEncodingToUse(String charEncoding) { + private String stringEncodingToUse(final String charEncoding) { if (charEncoding == null) { return CHAR_ENCODE_US_ASCII; } @@ -397,11 +398,11 @@ public long searchBytes(final byte[] bytesToFind, final long startRange, final long endRange, final boolean readBackward) throws IOException { - ByteSearcher bSearcher = new ByteSearcher(bytesToFind, startRange, + final ByteSearcher bSearcher = new ByteSearcher(bytesToFind, startRange, endRange, readBackward); try { return bSearcher.searchBytes(); - } catch (IOException e) { + } catch (final IOException e) { return -1; } } @@ -416,8 +417,8 @@ * to be matched in bytesToSearch. * @return True if the contents match, false otherwise. */ - public static final boolean byteArrayCompare(byte[] bytesToSearch, - int bytesToSearchOffset, byte[] bytesToFind) { + public static final boolean byteArrayCompare(final byte[] bytesToSearch, + final int bytesToSearchOffset, final byte[] bytesToFind) { // Make sure we don't go off the end of bytesToSearch if (bytesToSearchOffset + bytesToFind.length > bytesToSearch.length) { return false; @@ -436,11 +437,11 @@ * @param urlArray An array containing a list of URLs to be tested. * @return The first qualifying URL, or null if there are none. */ - public static URL resolveURLInput(URL[] urlArray) { + public static URL resolveURLInput(final URL[] urlArray) { for (int i = 0; i < urlArray.length; i++) { - URL url = urlArray[i]; + final URL url = urlArray[i]; if (url != null) { - File file = new File(url.getFile()); + final File file = new File(url.getFile()); if (file.exists()) { return url; } @@ -604,7 +605,7 @@ } } - private void computeOffsetToContent(int i) { + private void computeOffsetToContent(final int i) { offsetToContent = lastReadStart - lastViewboxTarget + i; } Modified: trunk/foray/foray-common/src/java/org/foray/common/RandomReaderArray.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/RandomReaderArray.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/RandomReaderArray.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -45,7 +45,8 @@ * useful in user messages. * @byteArray The byte array which will be "read" by this reader. */ - protected RandomReaderArray(String description, byte[] byteArray) { + protected RandomReaderArray(final String description, + final byte[] byteArray) { this.description = description; this.byteArray = byteArray; } @@ -53,14 +54,14 @@ /** * {@inheritDoc} */ - public void seek(long offset) throws IOException { + public void seek(final long offset) throws IOException { arrayIndex = (int) offset; } /** * {@inheritDoc} */ - public int skipBytes(int add) throws IOException { + public int skipBytes(final int add) throws IOException { return arrayIndex += add; } @@ -78,7 +79,7 @@ if (arrayIndex >= this.byteArray.length) { throw new EOFException(); } - byte theByte = this.byteArray[arrayIndex]; + final byte theByte = this.byteArray[arrayIndex]; arrayIndex ++; return theByte; } @@ -90,7 +91,7 @@ if (this.arrayIndex >= this.byteArray.length) { throw new EOFException(); } - char c = (char) this.byteArray[this.arrayIndex]; + final char c = (char) this.byteArray[this.arrayIndex]; this.arrayIndex ++; return c; } @@ -99,8 +100,8 @@ * {@inheritDoc} */ public final short readShort() throws IOException { - int byte1 = readUnsignedByte(); - int byte2 = readUnsignedByte(); + final int byte1 = readUnsignedByte(); + final int byte2 = readUnsignedByte(); return (short)((byte1 << 8) + (byte2 << 0)); } @@ -108,8 +109,8 @@ * {@inheritDoc} */ public final int readUnsignedShort() throws IOException { - int byte1 = readUnsignedByte(); - int byte2 = readUnsignedByte(); + final int byte1 = readUnsignedByte(); + final int byte2 = readUnsignedByte(); return (byte1 << 8) + (byte2 << 0); } @@ -124,21 +125,22 @@ * {@inheritDoc} */ public final boolean readBoolean() throws IOException { - int ch = readUnsignedByte(); + final int ch = readUnsignedByte(); return (ch != 0); } /** * {@inheritDoc} */ - public final void readFully(byte[] b) throws IOException { + public final void readFully(final byte[] b) throws IOException { readFully(b, 0, b.length); } /** * {@inheritDoc} */ - public final void readFully(byte[] b, int off, int len) throws IOException { + public final void readFully(final byte[] b, final int off, int len) + throws IOException { boolean eofDetected = false; if (this.arrayIndex + len >= this.byteArray.length) { eofDetected = true; @@ -169,8 +171,8 @@ * {@inheritDoc} */ public final char readChar() throws IOException { - int byte1 = this.readUnsignedByte(); - int byte2 = this.readUnsignedByte(); + final int byte1 = this.readUnsignedByte(); + final int byte2 = this.readUnsignedByte(); return (char)((byte1 << 8) + (byte2 << 0)); } @@ -185,10 +187,10 @@ * {@inheritDoc} */ public final int readInt() throws IOException { - int byte1 = this.readUnsignedByte(); - int byte2 = this.readUnsignedByte(); - int byte3 = this.readUnsignedByte(); - int byte4 = this.readUnsignedByte(); + final int byte1 = this.readUnsignedByte(); + final int byte2 = this.readUnsignedByte(); + final int byte3 = this.readUnsignedByte(); + final int byte4 = this.readUnsignedByte(); return ((byte1 << 24) + (byte2 << 16) + (byte3 << 8) + (byte4 << 0)); } @@ -196,7 +198,7 @@ * {@inheritDoc} */ public final String readLine() throws IOException { - StringBuffer input = new StringBuffer(); + final StringBuffer input = new StringBuffer(); int byteRead = -1; boolean eol = false; @@ -213,7 +215,7 @@ } case '\r': { eol = true; - long cur = getFilePointer(); + final long cur = getFilePointer(); if (this.arrayIndex >= this.length()) { eol = true; break; Modified: trunk/foray/foray-common/src/java/org/foray/common/RandomReaderRAFile.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/RandomReaderRAFile.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/RandomReaderRAFile.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -43,7 +43,7 @@ /** * Constructor. */ - protected RandomReaderRAFile(File file) throws IOException { + protected RandomReaderRAFile(final File file) throws IOException { this.file = file; if (file == null) { return; @@ -52,11 +52,11 @@ seek(0); } - public void seek(long offset) throws IOException { + public void seek(final long offset) throws IOException { raFile.seek(offset); } - public int skipBytes(int add) throws IOException { + public int skipBytes(final int add) throws IOException { return raFile.skipBytes(add); } @@ -88,11 +88,12 @@ return raFile.readBoolean(); } - public final void readFully(byte[] b) throws IOException { + public final void readFully(final byte[] b) throws IOException { raFile.readFully(b); } - public final void readFully(byte[] b, int off, int len) throws IOException { + public final void readFully(final byte[] b, final int off, final int len) + throws IOException { raFile.readFully(b, off, len); } Modified: trunk/foray/foray-common/src/java/org/foray/common/RandomReaderURL.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/RandomReaderURL.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/RandomReaderURL.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -46,7 +46,7 @@ * Constructor. * @param url The URL which contains the stream to be used. */ - protected RandomReaderURL(URL url) { + protected RandomReaderURL(final URL url) { this.url = url; } @@ -54,15 +54,15 @@ if (this.array != null) { return; } - InputStream input = this.getInputStream(); - byte[] theBytes = IOUtil.toByteArray(input, 20000); + final InputStream input = this.getInputStream(); + final byte[] theBytes = IOUtil.toByteArray(input, 20000); this.array = new RandomReaderArray(this.url.toExternalForm(), theBytes); } /** * {@inheritDoc} */ - public void seek(long offset) throws IOException { + public void seek(final long offset) throws IOException { checkArray(); this.array.seek(offset); } @@ -70,7 +70,7 @@ /** * {@inheritDoc} */ - public int skipBytes(int add) throws IOException { + public int skipBytes(final int add) throws IOException { checkArray(); return this.array.skipBytes(add); } @@ -134,7 +134,7 @@ /** * {@inheritDoc} */ - public final void readFully(byte[] b) throws IOException { + public final void readFully(final byte[] b) throws IOException { checkArray(); this.array.readFully(b); } @@ -142,7 +142,8 @@ /** * {@inheritDoc} */ - public final void readFully(byte[] b, int off, int len) throws IOException { + public final void readFully(final byte[] b, final int off, final int len) + throws IOException { checkArray(); this.array.readFully(b, off, len); } @@ -209,7 +210,7 @@ public String getDescription() { try { checkArray(); - } catch (IOException e) { + } catch (final IOException e) { return this.url.toExternalForm(); } return this.array.getDescription(); @@ -228,7 +229,7 @@ public void reset() { try { checkArray(); - } catch (IOException e) { + } catch (final IOException e) { /* Nothing to do here. */ } this.array = null; Modified: trunk/foray/foray-common/src/java/org/foray/common/SVGUserAgent.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/SVGUserAgent.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/SVGUserAgent.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -41,25 +41,25 @@ /** * Creates a new SVGUserAgent. */ - public SVGUserAgent(AffineTransform at) { + public SVGUserAgent(final AffineTransform at) { currentTransform = at; } - public void setLogger(Log logger) { + public void setLogger(final Log logger) { log = logger; } /** * Displays an error message. */ - public void displayError(String message) { + public void displayError(final String message) { log.error(message); } /** * Displays an error resulting from the specified Exception. */ - public void displayError(Exception ex) { + public void displayError(final Exception ex) { log.error("SVG Error" + ex.getMessage()); log.error(ex.getMessage()); } @@ -68,7 +68,7 @@ * Displays a message in the User Agent interface. * The given message is typically displayed in a status bar. */ - public void displayMessage(String message) { + public void displayMessage(final String message) { log.info(message); } Modified: trunk/foray/foray-common/src/java/org/foray/common/StringUtil.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/StringUtil.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/StringUtil.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -41,7 +41,7 @@ * @param input The character to be tested. * @return True iff the character is a valid hexadecimal character. */ - public static boolean isASCIIHex(char input) { + public static boolean isASCIIHex(final char input) { // "0" thru "9" if (input >= 0x30 && input <= 0x39) { return true; @@ -60,7 +60,7 @@ /** * Same as {@link #isASCIIHex(byte)}, except with a char as input. */ - public static boolean isASCIIHex(byte input) { + public static boolean isASCIIHex(final byte input) { // Make sure the byte is not negative before casting as char. if (input < 0x00) { return false; @@ -78,7 +78,7 @@ * @return The byte containing the hex value of the 2 input bytes, or -1 if * the input is valid. */ - public static byte asciiHexBytesToHex(byte byte1, byte byte2) { + public static byte asciiHexBytesToHex(final byte byte1, final byte byte2) { if (! isASCIIHex(byte1)) { return -1; } @@ -86,9 +86,9 @@ return -1; } // Convert the high-order byte and shift it into the high position. - byte convert1 = (byte) (asciiHexByteToHex(byte1) << 4); + final byte convert1 = (byte) (asciiHexByteToHex(byte1) << 4); // Convert the low-order byte. - byte convert2 = asciiHexByteToHex(byte2); + final byte convert2 = asciiHexByteToHex(byte2); // "Or" the two half-bytes together and return it. return (byte) (convert1 | convert2); } @@ -99,7 +99,7 @@ * @param inputByte The ASCII Hex byte to convert. * @return The hex equivalent of inputByte. */ - public static byte asciiHexByteToHex(byte inputByte) { + public static byte asciiHexByteToHex(final byte inputByte) { if (inputByte >= 0x30 && inputByte <= 0x39) { // numerals return (byte) (inputByte - 0x30); } @@ -125,8 +125,8 @@ * @return The index (0 through stringArray.length - 1) of the matching * element, or -1 if no match is found. */ - public static int indexOfSortedCharArray(char[] charArray, - char inputChar, int startIndex, int endIndex) { + public static int indexOfSortedCharArray(final char[] charArray, + final char inputChar, final int startIndex, final int endIndex) { if (charArray == null) { return -1; } @@ -136,8 +136,8 @@ int bottom = startIndex; int top = endIndex; while (top >= bottom) { - int mid = (bottom + top) / 2; - char testChar = charArray[mid]; + final int mid = (bottom + top) / 2; + final char testChar = charArray[mid]; if (inputChar == testChar) { // This is the item we are looking for. Return it. return mid; @@ -166,8 +166,8 @@ * ensure this size. * @return The String representing c's hex value. */ - public static String charToHexString(char c, boolean upperCase, - int minimumSize) { + public static String charToHexString(final char c, final boolean upperCase, + final int minimumSize) { String returnString = Integer.toHexString(c); if (upperCase) { returnString.toUpperCase(); @@ -190,7 +190,8 @@ * ensure this size. * @return The String representing c's octal value. */ - public static String charToOctalString(char c, int minimumSize) { + public static String charToOctalString(final char c, + final int minimumSize) { String returnString = Integer.toOctalString(c); int bytesToPad = minimumSize - returnString.length(); while (bytesToPad > 0) { @@ -208,12 +209,12 @@ * spaces to the end of eol. * @param length The maximum length that a line should contain. */ - public static void lineBreakStringBuffer(StringBuffer buffer, String eol, - int length) { + public static void lineBreakStringBuffer(final StringBuffer buffer, + final String eol, final int length) { int currentLineStarts = 0; int lastOpportunity = -1; for (int i = 0; i < buffer.length(); i++) { - int currentLineLength = i - currentLineStarts; + final int currentLineLength = i - currentLineStarts; if (currentLineLength > length && lastOpportunity > 0) { buffer.replace(lastOpportunity, lastOpportunity + 1, eol); @@ -221,7 +222,7 @@ lastOpportunity = -1; i =+ eol.length() - 1; } - char c = buffer.charAt(i); + final char c = buffer.charAt(i); if (c == ' ') { lastOpportunity = i; } @@ -233,13 +234,14 @@ * @param input The CharSequence to be converted. * @return An array of Unicode code points. */ - public static int[] toCodePoints(CharSequence input) { + public static int[] toCodePoints(final CharSequence input) { if (input == null || input.length() < 1) { return new int[0]; } - int length = StringUtilPre5.codePointCount(input, 0, input.length()); - int[] output = new int[length]; + final int length = StringUtilPre5.codePointCount(input, 0, + input.length()); + final int[] output = new int[length]; int outputIndex = 0; for (int i = 0; i < input.length(); i++) { output[outputIndex] = StringUtilPre5.codePointAt(input, i); @@ -256,13 +258,14 @@ * @param input The char[] to be converted. * @return An array of Unicode code points. */ - public static int[] toCodePoints(char[] input) { + public static int[] toCodePoints(final char[] input) { if (input == null || input.length < 1) { return new int[0]; } - int length = StringUtilPre5.codePointCount(input, 0, input.length); - int[] output = new int[length]; + final int length = StringUtilPre5.codePointCount(input, 0, + input.length); + final int[] output = new int[length]; int outputIndex = 0; for (int i = 0; i < input.length; i++) { output[outputIndex] = StringUtilPre5.codePointAt(input, i); @@ -282,12 +285,13 @@ * @return The index to the first character in the Strings that is * different. If the Strings are identical, returns -1. */ - public static int firstDifferent(String string1, String string2) { + public static int firstDifferent(final String string1, + final String string2) { if (string2.equals(string1)) { return -1; } - char[] chars1 = string1.toCharArray(); - char[] chars2 = string2.toCharArray(); + final char[] chars1 = string1.toCharArray(); + final char[] chars2 = string2.toCharArray(); for (int i = 0; i < chars1.length; i++) { if (i >= chars2.length) { return i; @@ -309,13 +313,13 @@ * @param newString The substring that should replace oldString. * @return The number of replacements that were made. */ - public static int replace(StringBuffer buffer, String oldString, - String newString) { + public static int replace(final StringBuffer buffer, final String oldString, + final String newString) { int numChanges = 0; boolean anyChanges = true; while (anyChanges) { anyChanges = false; - int index = buffer.indexOf(oldString); + final int index = buffer.indexOf(oldString); if (index > -1) { buffer.replace(index, index + oldString.length(), newString); anyChanges = true; Modified: trunk/foray/foray-common/src/java/org/foray/common/StringUtilPre5.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/StringUtilPre5.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/StringUtilPre5.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -42,65 +42,67 @@ /** * Mimics Java 5.0: Character.charCount(int). */ - public static int charCount(int codePoint) { + public static int charCount(final int codePoint) { return UCharacter.charCount(codePoint); } /** * Mimics Java 5.0: Character.codePointAt(char[], int). */ - public static int codePointAt(char[] chars, int index) { + public static int codePointAt(final char[] chars, final int index) { return UCharacter.codePointAt(chars, index); } /** * Mimics Java 5.0: Character.codePointAt(CharSequence, int). */ - public static int codePointAt(CharSequence chars, int index) { + public static int codePointAt(final CharSequence chars, final int index) { return UCharacter.codePointAt(chars, index); } /** * Mimics Java 5.0: Character.codePointCount(char[], int, int). */ - public static int codePointCount(char[] input, int offset, int count) { + public static int codePointCount(final char[] input, final int offset, + final int count) { return UTF16.countCodePoint(input, offset, count); } /** * Mimics Java 5.0: Character.codePointCount(char[], int, int). */ - public static int codePointCount(CharSequence input, int beginIndex, - int endIndex) { - char[] array = input.toString().toCharArray(); + public static int codePointCount(final CharSequence input, + final int beginIndex, final int endIndex) { + final char[] array = input.toString().toCharArray(); return codePointCount(array, beginIndex, endIndex); } /** * Mimics Java 5.0: Character.isHighSurrogate(char). */ - public static boolean isHighSurrogate(char ch) { + public static boolean isHighSurrogate(final char ch) { return UCharacter.isHighSurrogate(ch); } /** * Mimics Java 5.0: Character.isLetter(int). */ - public static boolean isLetter(int codePoint) { + public static boolean isLetter(final int codePoint) { return UCharacter.isLetter(codePoint); } /** * Mimics Java 5.0: Character.isSupplementaryCodePoint(int). */ - public static boolean isSupplementaryCodePoint(int codePoint) { + public static boolean isSupplementaryCodePoint(final int codePoint) { return UCharacter.isSupplementaryCodePoint(codePoint); } /** * Mimics Java 5.0: String(int[], int, int). */ - public static String newString(int[] codePoints, int offset, int count) { + public static String newString(final int[] codePoints, final int offset, + final int count) { return UTF16.newString(codePoints, offset, count); } Modified: trunk/foray/foray-common/src/java/org/foray/common/XMLCharacter.java =================================================================== --- trunk/foray/foray-common/src/java/org/foray/common/XMLCharacter.java 2006-07-22 19:16:29 UTC (rev 7807) +++ trunk/foray/foray-common/src/java/org/foray/common/XMLCharacter.java 2006-07-22 19:42:06 UTC (rev 7808) @@ -382,7 +382,7 @@ */ private XMLCharacter() { } - private static boolean isInClass(char[] charArray, char c) { + private static boolean isInClass(final char[] charArray, final char c) { for (int i = 0; i < charArray.length; i += 2) { if (c >= charArray[i] && c <= charArray[i + 1]) { return true; @@ -391,27 +391,27 @@ return false; } - public static boolean isBaseChar(char c) { + public static boolean isBaseChar(final char c) { return isInClass(BASE_CHAR, c); } - public static boolean isIdeographic(char c) { + public static boolean isIdeographic(final char c) { return isInClass(IDEOGRAPHIC, c); } - public static boolean isCombiningChar(char c) { + public static boolean isCombiningChar(final char c) { return isInClass(COMBINING_CHAR, c); } - public static boolean isDigit(char c) { + public static boolean isDigit(final char c) { return isInClass(DIGIT, c); } - public static boolean isExtender(char c) { + public static boolean isExtender(final char c) { return isInClass(EXTENDER, c); } - public static boolean isLetter(char c) { + public static boolean isLetter(final char c) { if (isBaseChar(c)) { return true; } @@ -427,7 +427,7 @@ * http://www.w3.org/TR/REC-xml-names/#NT-NCName * @param c The character to check */ - private static boolean isNameStartChar(char c) { + private static boolean isNameStartChar(final char c) { if (isLetter(c)) { return true; } @@ -443,7 +443,7 @@ * http://www.w3.org/TR/REC-xml-names/#NT-NCNameChar * @param c The character to check */ - private static boolean isNameChar(char c) { + private static boolean isNameChar(final char c) { if (isLetter(c)) { return true; } @@ -475,7 +475,7 @@ * @pa... [truncated message content] |