Index: lutinutil/src/java/org/codelutin/i18n/I18nFileReader.java diff -u lutinutil/src/java/org/codelutin/i18n/I18nFileReader.java:1.1 lutinutil/src/java/org/codelutin/i18n/I18nFileReader.java:1.2 --- lutinutil/src/java/org/codelutin/i18n/I18nFileReader.java:1.1 Wed Oct 4 14:51:55 2006 +++ lutinutil/src/java/org/codelutin/i18n/I18nFileReader.java Sat Nov 17 10:33:28 2007 @@ -23,10 +23,10 @@ * Created: Nov 22, 2004 * * @author Cédric Pineau - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * - * Last update : $Date: 2006-10-04 14:51:55 $ - * by : $Author: bpoussin $ + * Last update : $Date: 2007-11-17 10:33:28 $ + * by : $Author: tchemit $ */ package org.codelutin.i18n; @@ -37,24 +37,20 @@ import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; -import java.nio.charset.CharsetDecoder; -import java.nio.charset.spi.CharsetProvider; import java.util.Properties; -import java.util.Set; import java.util.regex.Pattern; -import sun.nio.cs.AbstractCharsetProvider; import sun.nio.cs.StandardCharsets; -import sun.nio.cs.ext.ExtendedCharsets; /** * Classe assurant la lecture et les possibles traitement nécessaires à I18n. */ public class I18nFileReader extends Properties { - private static Pattern commentPattern = Pattern.compile("[^\\\\]#"); + protected static final Pattern commentPattern = Pattern.compile("[^\\\\]#"); - private static Pattern splitPattern = Pattern.compile("[^\\\\]="); + protected static final Pattern splitPattern = Pattern.compile("[^\\\\]="); + private static final long serialVersionUID = 3611718334066783394L; public void load(InputStream inStream, String encoding) throws IOException { int available = inStream.available(); @@ -68,7 +64,7 @@ super.load(new ByteArrayInputStream(byteBuf.array())); } - private String interpretBackslashes(String message) { + protected String interpretBackslashes(String message) { int backslashIndex = -1; while ((backslashIndex = message.indexOf("\\", backslashIndex+1)) != -1) { if (message.length() >= backslashIndex + 1) { @@ -114,7 +110,7 @@ // writer.write(line + "\n"); // } // -// for (Iterator iter = super.keySet().iterator(); iter.hasNext();) { +// for (Iterator iter = super.keys().iterator(); iter.hasNext();) { // String key = (String) iter.next(); // String value = super.getProperty(key); // key = serializeBackslashes(key); @@ -126,7 +122,7 @@ private static char[] chars = {'\\', '\n', '\t', ' ', '=', ':'}; - private String serializeBackslashes(String message) { + protected String serializeBackslashes(String message) { for (char c : chars) { int charIndex = -1; while ((charIndex = message.indexOf(c, charIndex+2)) != -1) {