Author: tchemit Date: 2010-04-22 10:47:40 +0200 (Thu, 22 Apr 2010) New Revision: 1833 Log: - improve license headers - remove deprecated api in Stringutil - little clean Modified: trunk/pom.xml trunk/src/license/project.xml trunk/src/main/java/org/nuiton/util/ListenerSet.java trunk/src/main/java/org/nuiton/util/StringUtil.java trunk/src/main/java/org/nuiton/util/Transformer.java trunk/src/site/apt/ApplicationConfig.apt trunk/src/site/apt/Warlauncher.apt trunk/src/site/apt/index.apt trunk/src/site/apt/nuitonUtil.apt Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-04-20 13:07:48 UTC (rev 1832) +++ trunk/pom.xml 2010-04-22 08:47:40 UTC (rev 1833) @@ -2,23 +2,22 @@ <!-- #%L Nuiton Utils - $Id$ $HeadURL$ %% Copyright (C) 2004 - 2010 CodeLutin %% This program 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 + 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. - + This program 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 General Lesser Public License for more details. - - You should have received a copy of the GNU General Lesser Public + + You should have received a copy of the GNU General Lesser Public License along with this program. If not, see <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% @@ -196,8 +195,9 @@ </profile> + <!-- create assemblies at release time --> <profile> - <id>release-profile</id> + <id>release-assembly-profile</id> <activation> <property> <name>performRelease</name> Modified: trunk/src/license/project.xml =================================================================== --- trunk/src/license/project.xml 2010-04-20 13:07:48 UTC (rev 1832) +++ trunk/src/license/project.xml 2010-04-22 08:47:40 UTC (rev 1833) @@ -2,24 +2,23 @@ <!-- #%L Nuiton Utils - - $Author$ + $Id$ $HeadURL$ %% Copyright (C) 2004 - 2010 CodeLutin %% This program 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 + 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. - + This program 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 General Lesser Public License for more details. - - You should have received a copy of the GNU General Lesser Public + + You should have received a copy of the GNU General Lesser Public License along with this program. If not, see <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% @@ -48,18 +47,27 @@ <header> <commentStyle>apt</commentStyle> - <fileSet> - <basedir>src/site</basedir> - <include>**/*.apt</include> - </fileSet> + <fileSet> + <basedir>src/site</basedir> + <include>**/*.apt</include> + </fileSet> </header> <header> <commentStyle>xml</commentStyle> + <fileSets> <fileSet> <basedir>src/site</basedir> <include>**/*.xml</include> </fileSet> + <fileSet> + <basedir>/</basedir> + <includes> + <include>pom.xml</include> + <include>src/license/project.xml</include> + </includes> + </fileSet> + </fileSets> </header> </headers> Modified: trunk/src/main/java/org/nuiton/util/ListenerSet.java =================================================================== --- trunk/src/main/java/org/nuiton/util/ListenerSet.java 2010-04-20 13:07:48 UTC (rev 1832) +++ trunk/src/main/java/org/nuiton/util/ListenerSet.java 2010-04-22 08:47:40 UTC (rev 1833) @@ -73,7 +73,7 @@ * * @param <L> listeners type * - * @see org.nuiton.util.CategorisedListenerSet + * @see CategorisedListenerSet */ public class ListenerSet<L> implements Iterable<L> { // ListenerSet Modified: trunk/src/main/java/org/nuiton/util/StringUtil.java =================================================================== --- trunk/src/main/java/org/nuiton/util/StringUtil.java 2010-04-20 13:07:48 UTC (rev 1832) +++ trunk/src/main/java/org/nuiton/util/StringUtil.java 2010-04-22 08:47:40 UTC (rev 1833) @@ -46,6 +46,7 @@ import java.util.Arrays; import java.util.Date; import java.util.List; +import java.util.Locale; /** * Classe contenant un ensemle de methode static utiles pour la manipulation des @@ -55,7 +56,8 @@ * @author poussin * created 21 octobre 2003 */ -public class StringUtil { // StringUtil +public class StringUtil { + public static final String[] EMPTY_STRING_ARRAY = new String[0]; // StringUtil /** Constructor for the StringUtil object */ protected StringUtil() { @@ -109,13 +111,13 @@ } /** - * Contract to use in {@link #join(java.util.Collection, org.nuiton.util.StringUtil.ToString, java.lang.String, boolean) } + * Contract to use in {@link StringUtil#join(Iterable , ToString, String, boolean) } * method. This will provide a toString method to convert an object in a * string. * * @param <O> type of object manipulated */ - static public interface ToString<O> { + public interface ToString<O> { /** * Convert an object o in a string. @@ -158,7 +160,7 @@ * @param trim if trim() method need to by apply on each object string * @return the String chain of all elements separated by separator, never * return null, will return an empty String for an empty list. - * @throws NullPointerException + * @throws NullPointerException if iterable is {@code null}. */ static public <O> String join(Iterable<O> iterable, ToString<O> ts, String separator, boolean trim) throws NullPointerException { @@ -216,54 +218,6 @@ return result; } - /** - * Met en majuscule le premier caractere de la chaine passee en parametre - * - * @param word La chaine a capitaliser - * @return La chaine capitalisee - * @deprecated you must use - * org.apache.commons.lang.StringUtils.capitalise(String) - */ - @Deprecated - public static String capitalize(String word) { - return word.substring(0, 1).toUpperCase() + word.substring(1); - } - - /** - * Met en minuscule le premier caractere de la chaine passe en parametre - * - * @param word La chaine a decapitaliser - * @return La chaine decapitalisee - * @deprecated you must use - * org.apache.commons.lang.StringUtils.uncapitalise(String) - */ - @Deprecated - public static String uncapitalize(String word) { - return word.substring(0, 1).toLowerCase() + word.substring(1); - } - - /** - * Concatène un tableau de chaine de caracteres en une seul chaine. - * - * @param s le tableau de chaines - * @param sep le separateur a utiliser pour separer chaque chaine. - * @return la chaine resultante de la concatenation. Si le tableau est null - * ou vide, la chaine resultante est une chaine vide. - * @deprecated you must use org.apache.commons.lang.StringUtils.join - */ - @Deprecated - public static String unsplit(String[] s, String sep) { - if (s == null || s.length <= 0) { - return ""; - } - - StringBuffer result = new StringBuffer(s[0]); - for (int i = 1; i < s.length; i++) { - result.append(sep).append(s[i]); - } - return result.toString(); - } - private static final Character[] openingChars = {'(', '{', '['}; private static final Character[] closingChars = {')', '}', ']'}; @@ -312,7 +266,7 @@ Character[] closingChars, String args, String separator) { if (args == null) { - return new String[0]; + return EMPTY_STRING_ARRAY; } List<String> result = new ArrayList<String>(); Modified: trunk/src/main/java/org/nuiton/util/Transformer.java =================================================================== --- trunk/src/main/java/org/nuiton/util/Transformer.java 2010-04-20 13:07:48 UTC (rev 1832) +++ trunk/src/main/java/org/nuiton/util/Transformer.java 2010-04-22 08:47:40 UTC (rev 1833) @@ -44,8 +44,8 @@ */ public interface Transformer<E, F> extends Serializable { // Transformer - public F transform(E e); + F transform(E e); - public E untransform(F f); + E untransform(F f); } // Transformer Modified: trunk/src/site/apt/ApplicationConfig.apt =================================================================== --- trunk/src/site/apt/ApplicationConfig.apt 2010-04-20 13:07:48 UTC (rev 1832) +++ trunk/src/site/apt/ApplicationConfig.apt 2010-04-22 08:47:40 UTC (rev 1833) @@ -8,7 +8,7 @@ ~~~ ~~ #%L ~~ Nuiton Utils -~~ +~~ ~~ $Id$ ~~ $HeadURL$ ~~ %% @@ -18,7 +18,7 @@ ~~ 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. -~~ +~~ ~~ This program 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 Modified: trunk/src/site/apt/Warlauncher.apt =================================================================== --- trunk/src/site/apt/Warlauncher.apt 2010-04-20 13:07:48 UTC (rev 1832) +++ trunk/src/site/apt/Warlauncher.apt 2010-04-22 08:47:40 UTC (rev 1833) @@ -5,7 +5,7 @@ ~~~ ~~ #%L ~~ Nuiton Utils -~~ +~~ ~~ $Id$ ~~ $HeadURL$ ~~ %% Modified: trunk/src/site/apt/index.apt =================================================================== (Binary files differ) Modified: trunk/src/site/apt/nuitonUtil.apt =================================================================== --- trunk/src/site/apt/nuitonUtil.apt 2010-04-20 13:07:48 UTC (rev 1832) +++ trunk/src/site/apt/nuitonUtil.apt 2010-04-22 08:47:40 UTC (rev 1833) @@ -8,7 +8,7 @@ ~~~ ~~ #%L ~~ Nuiton Utils -~~ +~~ ~~ $Id$ ~~ $HeadURL$ ~~ %%