From 7158216734a51e311834045f454424feed9927b9 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 23 May 2015 00:29:04 +0200 Subject: [PATCH] Refactor packages for StringList. Remove Concatenator class. Split StringList with StringListUtils. --- src/fr/devinsy/util/FileTools.java | 2 + src/fr/devinsy/util/StringConcatenator.java | 399 ------------------ src/fr/devinsy/util/ToolBox.java | 2 + src/fr/devinsy/util/cmdexec/CmdExec.java | 34 +- src/fr/devinsy/util/rss/RSSCache.java | 2 +- .../util/{ => strings}/StringList.java | 171 +------- .../{ => strings}/StringListCharPosition.java | 2 +- .../devinsy/util/strings/StringListUtils.java | 261 ++++++++++++ .../util/{ => strings}/StringListWriter.java | 2 +- .../devinsy/util/{ => strings}/StringSet.java | 26 +- src/fr/devinsy/util/unix/Unix.java | 4 +- src/fr/devinsy/util/unix/acl/AclManager.java | 4 +- src/fr/devinsy/util/xml/XMLReader.java | 6 +- test/fr/devinsy/util/FileToolsTest.java | 2 + test/fr/devinsy/util/StringListTest.java | 2 + test/fr/devinsy/util/xml/XMLReaderTest.java | 2 +- 16 files changed, 300 insertions(+), 621 deletions(-) delete mode 100755 src/fr/devinsy/util/StringConcatenator.java rename src/fr/devinsy/util/{ => strings}/StringList.java (83%) rename src/fr/devinsy/util/{ => strings}/StringListCharPosition.java (98%) create mode 100644 src/fr/devinsy/util/strings/StringListUtils.java rename src/fr/devinsy/util/{ => strings}/StringListWriter.java (98%) rename src/fr/devinsy/util/{ => strings}/StringSet.java (94%) diff --git a/src/fr/devinsy/util/FileTools.java b/src/fr/devinsy/util/FileTools.java index aecb483..3245c65 100644 --- a/src/fr/devinsy/util/FileTools.java +++ b/src/fr/devinsy/util/FileTools.java @@ -31,6 +31,8 @@ import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import java.net.URL; +import fr.devinsy.util.strings.StringList; + /** * * @author cpm diff --git a/src/fr/devinsy/util/StringConcatenator.java b/src/fr/devinsy/util/StringConcatenator.java deleted file mode 100755 index ef55b82..0000000 --- a/src/fr/devinsy/util/StringConcatenator.java +++ /dev/null @@ -1,399 +0,0 @@ -/** - * Copyright (C) 2008-2010, 2013-2014 Christian Pierre MOMON - * - * This file is part of Devinsy-utils. - * - * Devinsy-utils is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Devinsy-utils is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Devinsy-utils. If not, see - */ -package fr.devinsy.util; - -import java.io.IOException; -import java.util.ArrayList; - -/** - * This class is a collection of String objects with specific methods. It makes - * possible to build a string without any copy. The goal is to optimize the - * building of strings where they are lot of concatenation action. - * - * @deprecated Replaced by StringList. - */ -@Deprecated -public class StringConcatenator extends ArrayList -{ - private static final long serialVersionUID = -1154185934830213732L; - public String LINE_SEPARATOR = "\n"; - - /** - * - */ - public StringConcatenator() - { - super(); - } - - /** - * - */ - public StringConcatenator append(final char character) - { - StringConcatenator result; - - this.add(String.valueOf(character)); - - result = this; - - // - return (result); - } - - /** - * - */ - public StringConcatenator append(final String string) - { - StringConcatenator result; - - if (string != null) - { - this.add(string); - } - - result = this; - - // - return (result); - } - - /** - * - */ - public StringConcatenator append(final StringConcatenator string) - { - StringConcatenator result; - - if (string != null) - { - for (int nString = 0; nString < string.size(); nString++) - { - this.add(string.getByIndex(nString)); - } - } - - result = this; - - // - return (result); - } - - /** - * - */ - public StringConcatenator appendln() - { - StringConcatenator result; - - this.add(this.LINE_SEPARATOR); - - result = this; - - // - return (result); - } - - /** - * - */ - public StringConcatenator appendln(final char character) - { - StringConcatenator result; - - result = this.append(character).appendln(); - - // - return (result); - } - - /** - * - */ - public StringConcatenator appendln(final String string) - { - StringConcatenator result; - - result = this.append(string).appendln(); - - // - return (result); - } - - /** - * - */ - public StringConcatenator appendln(final StringConcatenator string) - { - StringConcatenator result; - - result = this.append(string).appendln(); - - // - return (result); - } - - /** - * - */ - public String getByIndex(final int id) - { - String result; - - result = this.get(id); - - // - return (result); - } - - /** - * - */ - public int lenght() - { - int result = 0; - - for (int nString = 0; nString < this.size(); nString++) - { - result += this.getByIndex(nString).length(); - - } - - // - return (result); - } - - /** - * - */ - @Override - public String toString() - { - String result; - - StringBuffer preResult = new StringBuffer(this.lenght()); - - for (int nString = 0; nString < this.size(); nString++) - { - preResult.append(this.getByIndex(nString)); - } - - result = new String(preResult); - - // - return (result); - } - - /** - * - */ - public void writeInto(final java.io.Writer out) throws IOException - { - for (int nString = 0; nString < this.size(); nString++) - { - out.write(this.getByIndex(nString)); - } - } - - /** - * - */ - static public String toString(final String[] strings) - { - String result; - - if (strings == null) - { - result = null; - } - else - { - StringConcatenator string = new StringConcatenator(); - - for (int nString = 0; nString < strings.length; nString++) - { - string.append(strings[nString]); - - if (nString < strings.length - 1) - { - string.append(' '); - } - } - - result = string.toString(); - } - - // - return (result); - } - - /** - * - */ - static public String toStringNotNull(final String[] strings) - { - String result; - - result = toString(strings); - - if (result == null) - { - result = ""; - } - - // - return (result); - } - - /** - * - */ - static public String toStringWithBracket(final String[] strings) - { - String result; - - if (strings == null) - { - result = null; - } - else - { - StringConcatenator merge = new StringConcatenator(); - - merge.append("["); - merge.append(toStringWithCommas(strings)); - merge.append("]"); - - result = merge.toString(); - } - - // - return (result); - } - - /** - * - */ - static public String toStringWithBracketNotNull(final String[] strings) - { - String result; - - result = toStringWithBrackets(strings); - - if (result == null) - { - result = ""; - } - - // - return (result); - } - - /** - * - */ - static public String toStringWithBrackets(final String[] strings) - { - String result; - - if (strings == null) - { - result = null; - } - else - { - StringConcatenator merge = new StringConcatenator(); - - for (String string : strings) - { - merge.append("[").append(string).append("]"); - } - - result = merge.toString(); - } - - // - return (result); - } - - /** - * - */ - static public String toStringWithCommas(final String[] strings) - { - String result; - - if (strings == null) - { - result = null; - } - else - { - StringConcatenator merge = new StringConcatenator(); - - for (String string : strings) - { - if (merge.size() != 0) - { - merge.append(","); - } - - merge.append(string); - } - - result = merge.toString(); - } - - // - return (result); - } - - /** - * - */ - static public String toStringWithFrenchCommas(final String[] strings) - { - String result; - - if (strings == null) - { - result = null; - } - else - { - StringConcatenator merge = new StringConcatenator(); - - for (String string : strings) - { - if (merge.size() != 0) - { - merge.append(", "); - } - - merge.append(string); - } - - result = merge.toString(); - } - - // - return (result); - } -} diff --git a/src/fr/devinsy/util/ToolBox.java b/src/fr/devinsy/util/ToolBox.java index c0a90f1..adc4b49 100644 --- a/src/fr/devinsy/util/ToolBox.java +++ b/src/fr/devinsy/util/ToolBox.java @@ -24,6 +24,8 @@ import java.util.Set; import org.apache.commons.lang3.StringUtils; +import fr.devinsy.util.strings.StringList; + /** * * @author christian.momon@devinsy.fr diff --git a/src/fr/devinsy/util/cmdexec/CmdExec.java b/src/fr/devinsy/util/cmdexec/CmdExec.java index 31cccbe..c86c672 100644 --- a/src/fr/devinsy/util/cmdexec/CmdExec.java +++ b/src/fr/devinsy/util/cmdexec/CmdExec.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2005-2010, 2013 Christian Pierre MOMON + * Copyright (C) 2005-2010, 2013, 2015 Christian Pierre MOMON * * This file is part of Devinsy-utils. * @@ -21,7 +21,7 @@ package fr.devinsy.util.cmdexec; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import fr.devinsy.util.StringConcatenator; +import fr.devinsy.util.strings.StringListUtils; /** * We must use the isOver method on Gobblers because with short tasks the @@ -195,8 +195,8 @@ public class CmdExec { this.exitValue = 0; - logger.info("CmdExec(commande[]) = [" + StringConcatenator.toString(command) + "]"); - logger.info("CmdExec(commande[]) = [" + StringConcatenator.toStringWithBrackets(command) + "]"); + logger.info("CmdExec(commande[]) = [" + StringListUtils.toString(command) + "]"); + logger.info("CmdExec(commande[]) = [" + StringListUtils.toStringWithBrackets(command) + "]"); try { @@ -316,9 +316,9 @@ public class CmdExec } else { - logger.error("Command=\"" + StringConcatenator.toStringWithBrackets(command)); - logger.error("Command=\"[" + StringConcatenator.toString(command) + "]\n out => [" + cmd.getOutStream() + "]\n " + "err => (" + cmd.getErrStream().length() + ")[" - + cmd.getErrStream() + "]"); + logger.error("Command=\"" + StringListUtils.toStringWithBrackets(command)); + logger.error("Command=\"[" + StringListUtils.toString(command) + "]\n out => [" + cmd.getOutStream() + "]\n " + "err => (" + cmd.getErrStream().length() + ")[" + cmd.getErrStream() + + "]"); throw new Exception(cmd.getErrStream()); } } @@ -371,11 +371,11 @@ public class CmdExec } else if (nullArg) { - throw new Exception("Null parameter detected in position " + nArg + " for " + StringConcatenator.toStringWithBrackets(args) + "."); + throw new Exception("Null parameter detected in position " + nArg + " for " + StringListUtils.toStringWithBrackets(args) + "."); } else if ((args.length < min) || (args.length > max)) { - throw new Exception("Bad number of parameters: " + args.length + " for " + StringConcatenator.toStringWithBrackets(args) + "."); + throw new Exception("Bad number of parameters: " + args.length + " for " + StringListUtils.toStringWithBrackets(args) + "."); } else { @@ -406,24 +406,24 @@ public class CmdExec // boolean nullArg = false; boolean ended = false; - int nArg = 0; + int argumentCounter = 0; while (!ended) { - if (nArg >= args.length) + if (argumentCounter >= args.length) { ended = true; nullArg = false; } else { - if (args[nArg] == null) + if (args[argumentCounter] == null) { ended = true; nullArg = true; } else { - nArg += 1; + argumentCounter += 1; } } } @@ -435,20 +435,20 @@ public class CmdExec } else if (nullArg) { - throw new Exception("Null parameter detected in position " + nArg + " for " + StringConcatenator.toStringWithBrackets(args) + "."); + throw new Exception("Null parameter detected in position " + argumentCounter + " for " + StringListUtils.toStringWithBrackets(args) + "."); } else if ((args.length < min) || (args.length > max)) { - throw new Exception("Bad number of parameters: " + args.length + " for " + StringConcatenator.toStringWithBrackets(args) + "."); + throw new Exception("Bad number of parameters: " + args.length + " for " + StringListUtils.toStringWithBrackets(args) + "."); } else { // String[] command = new String[args.length + 1]; command[0] = program; - for (nArg = 0; nArg < args.length; nArg++) + for (argumentCounter = 0; argumentCounter < args.length; argumentCounter++) { - command[nArg + 1] = args[nArg]; + command[argumentCounter + 1] = args[argumentCounter]; } result = CmdExec.run(command); diff --git a/src/fr/devinsy/util/rss/RSSCache.java b/src/fr/devinsy/util/rss/RSSCache.java index b23723b..939398e 100644 --- a/src/fr/devinsy/util/rss/RSSCache.java +++ b/src/fr/devinsy/util/rss/RSSCache.java @@ -21,7 +21,7 @@ package fr.devinsy.util.rss; import java.util.HashMap; import java.util.Locale; -import fr.devinsy.util.StringList; +import fr.devinsy.util.strings.StringList; /** * diff --git a/src/fr/devinsy/util/StringList.java b/src/fr/devinsy/util/strings/StringList.java similarity index 83% rename from src/fr/devinsy/util/StringList.java rename to src/fr/devinsy/util/strings/StringList.java index f4e4b71..a01766a 100755 --- a/src/fr/devinsy/util/StringList.java +++ b/src/fr/devinsy/util/strings/StringList.java @@ -16,7 +16,7 @@ * You should have received a copy of the GNU Lesser General Public License * along with Devinsy-utils. If not, see */ -package fr.devinsy.util; +package fr.devinsy.util.strings; import java.io.IOException; import java.text.Collator; @@ -843,173 +843,4 @@ public class StringList extends ArrayList implements CharSequence // return (result); } - - /** - * This method converts a string array to a string. - */ - public static String toString(final String[] source) - { - String result; - - if (source == null) - { - result = null; - } - else - { - result = new StringList(source).toString(); - } - - // - return (result); - } - - /** - * This method converts a StringList to an array of String. - */ - public static String[] toStringArray(final StringList source) - { - String[] result; - - if (source == null) - { - result = new String[0]; - } - else - { - result = source.toStringArray(); - } - - // - return (result); - } - - /** - * - */ - public static String toStringNotNull(final String[] strings) - { - String result; - - result = toString(strings); - - if (result == null) - { - result = ""; - } - - // - return (result); - } - - /** - * - */ - public static String toStringWithBracket(final String[] strings) - { - String result; - - if (strings == null) - { - result = null; - } - else - { - StringList merge = new StringList(); - - merge.append("["); - merge.append(toStringWithCommas(strings)); - merge.append("]"); - - result = merge.toString(); - } - - // - return (result); - } - - /** - * - */ - public static String toStringWithBracketNotNull(final String[] strings) - { - String result; - - result = toStringWithBrackets(strings); - - if (result == null) - { - result = ""; - } - - // - return (result); - } - - /** - * - */ - public static String toStringWithBrackets(final String[] source) - { - String result; - - if (source == null) - { - result = null; - } - else - { - StringList merge = new StringList(); - - for (String string : source) - { - merge.append("[").append(string).append("]"); - } - - result = merge.toString(); - } - - // - return (result); - } - - /** - * - */ - public static String toStringWithCommas(final String[] source) - { - String result; - - if (source == null) - { - result = null; - } - else - { - result = new StringList(source).toStringSeparatedBy(","); - } - - // - return (result); - } - - /** - * - */ - public static String toStringWithFrenchCommas(final String[] source) - { - String result; - - if (source == null) - { - result = null; - } - else - { - result = new StringList(source).toStringSeparatedBy(", "); - } - - // - return (result); - } } diff --git a/src/fr/devinsy/util/StringListCharPosition.java b/src/fr/devinsy/util/strings/StringListCharPosition.java similarity index 98% rename from src/fr/devinsy/util/StringListCharPosition.java rename to src/fr/devinsy/util/strings/StringListCharPosition.java index bc74c3b..e0bbaa8 100644 --- a/src/fr/devinsy/util/StringListCharPosition.java +++ b/src/fr/devinsy/util/strings/StringListCharPosition.java @@ -16,7 +16,7 @@ * You should have received a copy of the GNU Lesser General Public License * along with Devinsy-utils. If not, see */ -package fr.devinsy.util; +package fr.devinsy.util.strings; /** * This class manages a char position in a StringList object. diff --git a/src/fr/devinsy/util/strings/StringListUtils.java b/src/fr/devinsy/util/strings/StringListUtils.java new file mode 100644 index 0000000..250abae --- /dev/null +++ b/src/fr/devinsy/util/strings/StringListUtils.java @@ -0,0 +1,261 @@ +/** + * Copyright (C) 2008-2010, 2013-2015 Christian Pierre MOMON + * + * This file is part of Devinsy-utils. + * + * Devinsy-utils is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Devinsy-utils is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Devinsy-utils. If not, see + */ +package fr.devinsy.util.strings; + +/** + * This class is a collection of String objects with specific methods. It makes + * possible to build a string without any copy. The goal is to optimize the + * building of strings where they are lot of concatenation action. + */ +public class StringListUtils +{ + /** + * Builds a string list concatenating several time one string. + * + * @param source + * The string to concatenate several time. + * @param number + * The number of times to multiply. + * @return + */ + public static String multiply(final String source, final int number) + { + String result; + + StringList strings = new StringList(number); + for (int count = 0; count < number; count++) + { + strings.append(source); + } + + result = strings.toString(); + + // + return result; + } + + /** + * Sorts the string list. + * + * @param source + * The string list to sort. + */ + public static void sort(final StringList source) + { + if (source != null) + { + source.sort(); + } + } + + /** + * Concatenates the string from an array to a string. + * + * @param source + * The string array to convert. + * + * @return A string concatenation of the argument. + */ + public static String toString(final String[] source) + { + String result; + + if (source == null) + { + result = null; + } + else + { + result = new StringList(source).toString(); + } + + // + return result; + } + + /** + * Converts a {@code StringList} to an array of {@code String}. + * + * @param source + * The string list to convert. + * + * @return The result of the conversion. + */ + public static String[] toStringArray(final StringList source) + { + String[] result; + + if (source == null) + { + result = new String[0]; + } + else + { + result = source.toStringArray(); + } + + // + return result; + } + + /** + * Concatenates the string from an array to a string. + * + * @param strings + * The string array to convert. + * + * @return If argument is null then returns an empty string, otherwise + * returns a string concatenation of the argument. + */ + public static String toStringNotNull(final String[] strings) + { + String result; + + result = toString(strings); + + if (result == null) + { + result = ""; + } + + // + return result; + } + + /** + * + * @param strings + * @return + */ + public static String toStringWithBracket(final String[] strings) + { + String result; + + if (strings == null) + { + result = null; + } + else + { + StringList merge = new StringList(); + + merge.append("["); + merge.append(toStringWithCommas(strings)); + merge.append("]"); + + result = merge.toString(); + } + + // + return result; + } + + /** + * + * @param strings + * @return + */ + public static String toStringWithBracketNotNull(final String[] strings) + { + String result; + + result = toStringWithBrackets(strings); + + if (result == null) + { + result = ""; + } + + // + return result; + } + + /** + * + * @param source + * @return + */ + public static String toStringWithBrackets(final String[] source) + { + String result; + + if (source == null) + { + result = null; + } + else + { + StringList merge = new StringList(); + + for (String string : source) + { + merge.append("[").append(string).append("]"); + } + + result = merge.toString(); + } + + // + return result; + } + + /** + * + * @param source + * @return + */ + public static String toStringWithCommas(final String[] source) + { + String result; + + if (source == null) + { + result = null; + } + else + { + result = new StringList(source).toStringSeparatedBy(","); + } + + // + return result; + } + + /** + * + * @param source + * @return + */ + public static String toStringWithFrenchCommas(final String[] source) + { + String result; + + if (source == null) + { + result = null; + } + else + { + result = new StringList(source).toStringSeparatedBy(", "); + } + + // + return result; + } +} diff --git a/src/fr/devinsy/util/StringListWriter.java b/src/fr/devinsy/util/strings/StringListWriter.java similarity index 98% rename from src/fr/devinsy/util/StringListWriter.java rename to src/fr/devinsy/util/strings/StringListWriter.java index 641ab96..3ac0067 100755 --- a/src/fr/devinsy/util/StringListWriter.java +++ b/src/fr/devinsy/util/strings/StringListWriter.java @@ -16,7 +16,7 @@ * You should have received a copy of the GNU Lesser General Public License * along with Devinsy-utils. If not, see */ -package fr.devinsy.util; +package fr.devinsy.util.strings; import java.io.IOException; import java.io.Writer; diff --git a/src/fr/devinsy/util/StringSet.java b/src/fr/devinsy/util/strings/StringSet.java similarity index 94% rename from src/fr/devinsy/util/StringSet.java rename to src/fr/devinsy/util/strings/StringSet.java index 29df382..47ab3c9 100644 --- a/src/fr/devinsy/util/StringSet.java +++ b/src/fr/devinsy/util/strings/StringSet.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2014 Christian Pierre MOMON + * Copyright (C) 2015 Christian Pierre MOMON * * This file is part of Devinsy-utils. * @@ -16,7 +16,7 @@ * You should have received a copy of the GNU Lesser General Public License * along with Devinsy-utils. If not, see */ -package fr.devinsy.util; +package fr.devinsy.util.strings; import java.util.HashSet; import java.util.List; @@ -28,7 +28,7 @@ import java.util.List; */ public class StringSet extends HashSet { - private static final long serialVersionUID = 7421460140821150313L; + private static final long serialVersionUID = 6674838743930005326L; /** * @@ -213,24 +213,6 @@ public class StringSet extends HashSet return result; } - /** - * Check null parameter before add. - */ - public StringSet pub(final String string) - { - StringSet result; - - if (string != null) - { - this.add(string); - } - - result = this; - - // - return result; - } - /** * */ @@ -325,7 +307,7 @@ public class StringSet extends HashSet } /** - * + * Check null parameter before add. */ public StringSet put(final String string) { diff --git a/src/fr/devinsy/util/unix/Unix.java b/src/fr/devinsy/util/unix/Unix.java index bfe5c5d..341681b 100644 --- a/src/fr/devinsy/util/unix/Unix.java +++ b/src/fr/devinsy/util/unix/Unix.java @@ -24,8 +24,8 @@ import java.util.Vector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import fr.devinsy.util.StringConcatenator; import fr.devinsy.util.cmdexec.CmdExec; +import fr.devinsy.util.strings.StringListUtils; import fr.devinsy.util.unix.acl.Acl; import fr.devinsy.util.unix.acl.AclManager; @@ -515,7 +515,7 @@ public class Unix } catch (Exception exception) { - throw new Exception("Error running setfacl command for " + StringConcatenator.toStringWithBrackets(args) + ":" + exception.getMessage() + ".", exception); + throw new Exception("Error running setfacl command for " + StringListUtils.toStringWithBrackets(args) + ":" + exception.getMessage() + ".", exception); } } diff --git a/src/fr/devinsy/util/unix/acl/AclManager.java b/src/fr/devinsy/util/unix/acl/AclManager.java index 4e7ff51..c98f4c9 100644 --- a/src/fr/devinsy/util/unix/acl/AclManager.java +++ b/src/fr/devinsy/util/unix/acl/AclManager.java @@ -25,8 +25,8 @@ import java.util.regex.Pattern; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import fr.devinsy.util.StringConcatenator; import fr.devinsy.util.cmdexec.CmdExec; +import fr.devinsy.util.strings.StringListUtils; import fr.devinsy.util.unix.Unix; /** @@ -416,7 +416,7 @@ public class AclManager } catch (Exception exception) { - throw new Exception("Error running setfacl command for " + StringConcatenator.toStringWithBrackets(args) + ":" + exception.getMessage() + "."); + throw new Exception("Error running setfacl command for " + StringListUtils.toStringWithBrackets(args) + ":" + exception.getMessage() + "."); } } } diff --git a/src/fr/devinsy/util/xml/XMLReader.java b/src/fr/devinsy/util/xml/XMLReader.java index 3d474d5..92bb16d 100644 --- a/src/fr/devinsy/util/xml/XMLReader.java +++ b/src/fr/devinsy/util/xml/XMLReader.java @@ -24,7 +24,6 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.InputStream; import java.io.Reader; -import java.io.UnsupportedEncodingException; import javax.xml.namespace.QName; import javax.xml.stream.XMLEventReader; @@ -36,7 +35,7 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import fr.devinsy.util.StringList; +import fr.devinsy.util.strings.StringList; import fr.devinsy.util.xml.XMLTag.TagType; /** @@ -65,7 +64,6 @@ public class XMLReader * @param file * @throws XMLStreamException * @throws FileNotFoundException - * @throws UnsupportedEncodingException */ public XMLReader(final File file) throws FileNotFoundException, XMLStreamException { @@ -79,7 +77,6 @@ public class XMLReader * * @param target * @throws XMLStreamException - * @throws UnsupportedEncodingException */ public XMLReader(final InputStream source) throws XMLStreamException { @@ -93,7 +90,6 @@ public class XMLReader * * @param target * @throws XMLStreamException - * @throws UnsupportedEncodingException */ public XMLReader(final Reader source) throws XMLStreamException { diff --git a/test/fr/devinsy/util/FileToolsTest.java b/test/fr/devinsy/util/FileToolsTest.java index 42ed2c5..2653b83 100644 --- a/test/fr/devinsy/util/FileToolsTest.java +++ b/test/fr/devinsy/util/FileToolsTest.java @@ -27,6 +27,8 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import fr.devinsy.util.strings.StringList; + /** * * @author Christian P. Momon diff --git a/test/fr/devinsy/util/StringListTest.java b/test/fr/devinsy/util/StringListTest.java index 00ba13d..4dbac59 100644 --- a/test/fr/devinsy/util/StringListTest.java +++ b/test/fr/devinsy/util/StringListTest.java @@ -25,6 +25,8 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import fr.devinsy.util.strings.StringList; + /** * * @author Christian P. Momon diff --git a/test/fr/devinsy/util/xml/XMLReaderTest.java b/test/fr/devinsy/util/xml/XMLReaderTest.java index 71a2089..02e4f1a 100644 --- a/test/fr/devinsy/util/xml/XMLReaderTest.java +++ b/test/fr/devinsy/util/xml/XMLReaderTest.java @@ -28,7 +28,7 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.junit.Before; -import fr.devinsy.util.StringList; +import fr.devinsy.util.strings.StringList; /** *