svn commit: r1154726 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java
Author: ggregory Date: Sun Aug 7 17:09:04 2011 New Revision: 1154726 URL: http://svn.apache.org/viewvc?rev=1154726view=rev Log: Factor out constant answer in a singleton to save lots of memory on start up. Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java?rev=1154726r1=1154725r2=1154726view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java Sun Aug 7 17:09:04 2011 @@ -81,7 +81,7 @@ import java.util.regex.Pattern; public class Rule { private static class AppendableCharSeqeuence implements CharSequence { - + private final CharSequence left; private final CharSequence right; private final int length; @@ -213,6 +213,16 @@ public class Rule { boolean find(); } +private static class TrueRMatcher implements RMatcher { + +static TrueRMatcher INSTANCE = new TrueRMatcher(); + +public boolean find() { +return true; +} + +} + /** * A minimal wrapper around the functionality of Pattern that we use, to allow for alternate implementations. */ @@ -497,11 +507,7 @@ public class Rule { // matches every string return new RPattern() { public RMatcher matcher(CharSequence input) { -return new RMatcher() { -public boolean find() { -return true; -} -}; +return TrueRMatcher.INSTANCE; } }; } else if (startsWith) { @@ -695,7 +701,7 @@ public class Rule { if (i 0) { throw new IndexOutOfBoundsException(Can not match pattern at negative indexes); } - + int patternLength = this.pattern.length(); int ipl = i + patternLength;
svn commit: r1154729 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java
Author: ggregory Date: Sun Aug 7 17:10:34 2011 New Revision: 1154729 URL: http://svn.apache.org/viewvc?rev=1154729view=rev Log: Factor out constant answer in a singleton to save lots of memory on start up. Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java?rev=1154729r1=1154728r2=1154729view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java Sun Aug 7 17:10:34 2011 @@ -215,7 +215,7 @@ public class Rule { private static class TrueRMatcher implements RMatcher { -static TrueRMatcher INSTANCE = new TrueRMatcher(); +private static TrueRMatcher INSTANCE = new TrueRMatcher(); public boolean find() { return true;
svn commit: r1154730 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java
Author: ggregory Date: Sun Aug 7 17:11:32 2011 New Revision: 1154730 URL: http://svn.apache.org/viewvc?rev=1154730view=rev Log: Factor out constant answer in a singleton to save lots of memory on start up. Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java?rev=1154730r1=1154729r2=1154730view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java Sun Aug 7 17:11:32 2011 @@ -213,10 +213,16 @@ public class Rule { boolean find(); } +/** + * Always returns true. + */ private static class TrueRMatcher implements RMatcher { private static TrueRMatcher INSTANCE = new TrueRMatcher(); +/** + * Always returns true. + */ public boolean find() { return true; }
svn commit: r1154949 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java
Author: ggregory Date: Mon Aug 8 13:06:51 2011 New Revision: 1154949 URL: http://svn.apache.org/viewvc?rev=1154949view=rev Log: [CODEC-125] Implement a Beider-Morse phonetic matching codec. No need to create 7000+ of the same object on startup and keep it around. Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java?rev=1154949r1=1154948r2=1154949view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java Mon Aug 8 13:06:51 2011 @@ -229,6 +229,16 @@ public class Rule { } +private static class AllStringsRMatcher implements RPattern { + +private static AllStringsRMatcher INSTANCE = new AllStringsRMatcher(); + +public RMatcher matcher(CharSequence input) { +return TrueRMatcher.INSTANCE; +} + +} + /** * A minimal wrapper around the functionality of Pattern that we use, to allow for alternate implementations. */ @@ -511,11 +521,7 @@ public class Rule { } } else if ((startsWith || endsWith) content.length() == 0) { // matches every string -return new RPattern() { -public RMatcher matcher(CharSequence input) { -return TrueRMatcher.INSTANCE; -} -}; +return AllStringsRMatcher.INSTANCE; } else if (startsWith) { // matches from start return new RPattern() {
svn commit: r1155027 - /commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java
Author: ggregory Date: Mon Aug 8 17:49:50 2011 New Revision: 1155027 URL: http://svn.apache.org/viewvc?rev=1155027view=rev Log: Renamed testSpeedCheck to testSpeedCheckRandom. Made testSpeedCheck deterministic. Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java?rev=1155027r1=1155026r2=1155027view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java Mon Aug 8 17:49:50 2011 @@ -34,6 +34,8 @@ import org.junit.Test; * @since 2.0 */ public class BeiderMorseEncoderTest extends StringEncoderAbstractTest { +private static final char[] TEST_CHARS = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'o', 'u' }; + private void assertNotEmpty(BeiderMorseEncoder bmpm, final String value) throws EncoderException { Assert.assertFalse(value, bmpm.encode(value).equals()); } @@ -164,23 +166,32 @@ public class BeiderMorseEncoderTest exte /** * Runs between 1.1 and 13 seconds at length 40 for me (Gary Gregory, 2011/08/06) - * + * * @throws EncoderException */ @Test(/* timeout = 2L */) -public void testSpeedCheck() throws EncoderException { -char[] chars = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'o', 'u' }; -BeiderMorseEncoder bmpm = createGenericApproxEncoder(); +public void testSpeedCheckRandom() throws EncoderException { +BeiderMorseEncoder bmpm = this.createGenericApproxEncoder(); StringBuffer stringBuffer = new StringBuffer(); Random rand = new Random(); -stringBuffer.append(chars[rand.nextInt(chars.length)]); -long start; +stringBuffer.append(TEST_CHARS[rand.nextInt(TEST_CHARS.length)]); for (int i = 0; i 40; i++) { -start = System.currentTimeMillis(); -// System.out.println(i + String to encode: + stringBuffer.toString()); bmpm.encode(stringBuffer.toString()); -stringBuffer.append(chars[rand.nextInt(chars.length)]); -// System.out.println(i + Elapsed time in ms: + (System.currentTimeMillis() - start)); +stringBuffer.append(TEST_CHARS[rand.nextInt(TEST_CHARS.length)]); +} +} + +@Test(/* timeout = 2L */) +public void testSpeedCheck() throws EncoderException { +BeiderMorseEncoder bmpm = this.createGenericApproxEncoder(); +StringBuffer stringBuffer = new StringBuffer(); +stringBuffer.append(TEST_CHARS[0]); +for (int i = 0, j = 1; i 40; i++, j++) { +if (j == TEST_CHARS.length) { +j = 0; +} +bmpm.encode(stringBuffer.toString()); +stringBuffer.append(TEST_CHARS[j]); } } }
svn commit: r1155040 - /commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java
Author: ggregory Date: Mon Aug 8 18:25:34 2011 New Revision: 1155040 URL: http://svn.apache.org/viewvc?rev=1155040view=rev Log: Add testSpeedCheckAZ Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java?rev=1155040r1=1155039r2=1155040view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java Mon Aug 8 18:25:34 2011 @@ -165,23 +165,11 @@ public class BeiderMorseEncoderTest exte } /** - * Runs between 1.1 and 13 seconds at length 40 for me (Gary Gregory, 2011/08/06) + * (Un)luckily, the worse performing test because of the data in {@link TEST_CHARS} * * @throws EncoderException */ @Test(/* timeout = 2L */) -public void testSpeedCheckRandom() throws EncoderException { -BeiderMorseEncoder bmpm = this.createGenericApproxEncoder(); -StringBuffer stringBuffer = new StringBuffer(); -Random rand = new Random(); -stringBuffer.append(TEST_CHARS[rand.nextInt(TEST_CHARS.length)]); -for (int i = 0; i 40; i++) { -bmpm.encode(stringBuffer.toString()); -stringBuffer.append(TEST_CHARS[rand.nextInt(TEST_CHARS.length)]); -} -} - -@Test(/* timeout = 2L */) public void testSpeedCheck() throws EncoderException { BeiderMorseEncoder bmpm = this.createGenericApproxEncoder(); StringBuffer stringBuffer = new StringBuffer(); @@ -194,4 +182,35 @@ public class BeiderMorseEncoderTest exte stringBuffer.append(TEST_CHARS[j]); } } + +/** + * Another odd performance edge case. + * + * @throws EncoderException + */ +@Test(/* timeout = 2L */) +public void testSpeedCheckAZ() throws EncoderException { +BeiderMorseEncoder bmpm = this.createGenericApproxEncoder(); +String phrase = abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz; +for (int i = 1; i = phrase.length(); i++) { +bmpm.encode(phrase.subSequence(0, i)); +} +} + +/** + * Runs between 1.6 and 13 seconds at length 40 for me (Gary Gregory, 2011/08/06) + * + * @throws EncoderException + */ +@Test(/* timeout = 2L */) +public void testSpeedCheckRandom() throws EncoderException { +BeiderMorseEncoder bmpm = this.createGenericApproxEncoder(); +StringBuffer stringBuffer = new StringBuffer(); +Random rand = new Random(); +stringBuffer.append(TEST_CHARS[rand.nextInt(TEST_CHARS.length)]); +for (int i = 0; i 40; i++) { +bmpm.encode(stringBuffer.toString()); +stringBuffer.append(TEST_CHARS[rand.nextInt(TEST_CHARS.length)]); +} +} }
svn commit: r1155135 - in /commons/proper/codec/trunk/src: java/org/apache/commons/codec/language/bm/ test/org/apache/commons/codec/language/bm/
Author: ggregory Date: Mon Aug 8 22:47:24 2011 New Revision: 1155135 URL: http://svn.apache.org/viewvc?rev=1155135view=rev Log: [CODEC-125] Implement a Beider-Morse phonetic matching codec. Applied patch https://issues.apache.org/jira/secure/attachment/12489755/fightingMemoryChurn.patch Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Lang.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Languages.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/NameType.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Lang.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Lang.java?rev=1155135r1=1155134r2=1155135view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Lang.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Lang.java Mon Aug 8 22:47:24 2011 @@ -24,6 +24,7 @@ import java.util.Collections; import java.util.EnumMap; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Scanner; import java.util.Set; @@ -71,7 +72,7 @@ import java.util.regex.Pattern; */ public class Lang { -private static class LangRule { +private static final class LangRule { private final boolean acceptOnMatch; private final SetString languages; private final Pattern pattern; @@ -199,7 +200,7 @@ public class Lang { */ public String guessLanguage(String text) { Languages.LanguageSet ls = guessLanguages(text); -return ls.isSingleton() ? ls.getAny() : Languages.ANY; +return ls.isSingleton() ? ls.getAny() : Languages.ANY; } /** @@ -210,7 +211,7 @@ public class Lang { * @return a Set of Strings of language names that are potential matches for the input word */ public Languages.LanguageSet guessLanguages(String input) { -String text = input.toLowerCase(); // todo: locale? +String text = input.toLowerCase(Locale.ENGLISH); // System.out.println(Testing text: ' + text + '); SetString langs = new HashSetString(this.languages.getLanguages()); Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Languages.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Languages.java?rev=1155135r1=1155134r2=1155135view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Languages.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Languages.java Mon Aug 8 22:47:24 2011 @@ -58,9 +58,9 @@ public class Languages { * A set of languages. */ public static abstract class LanguageSet { - + public static LanguageSet from(SetString langs) { -return langs.isEmpty() ? NO_LANGUAGES : new SomeLanguages(langs); +return langs.isEmpty() ? NO_LANGUAGES : new SomeLanguages(langs); } public abstract boolean contains(String language); @@ -77,7 +77,7 @@ public class Languages { /** * Some languages, explicitly enumerated. */ -public static class SomeLanguages extends LanguageSet { +public static final class SomeLanguages extends LanguageSet { private final SetString languages; private SomeLanguages(SetString languages) { @@ -116,9 +116,13 @@ public class Languages { return this; } else { SomeLanguages sl = (SomeLanguages) other; -SetString ls = new HashSetString(this.languages); -ls.retainAll(sl.languages); -return from(ls); +if (sl.languages.containsAll(languages)) { +return this; +} else { +SetString ls = new HashSetString(this.languages); +ls.retainAll(sl.languages); +return from(ls); +} } } Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/NameType.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/NameType.java?rev=1155135r1=1155134r2
svn commit: r1155182 - in /commons/proper/codec/trunk/src: java/org/apache/commons/codec/language/bm/PhoneticEngine.java java/org/apache/commons/codec/language/bm/Rule.java test/org/apache/commons/cod
Author: ggregory Date: Tue Aug 9 01:16:09 2011 New Revision: 1155182 URL: http://svn.apache.org/viewvc?rev=1155182view=rev Log: [CODEC-125] Implement a Beider-Morse phonetic matching codec. Applied patch https://issues.apache.org/jira/secure/attachment/12489767/comparator.patch Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java?rev=1155182r1=1155181r2=1155182view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java Tue Aug 9 01:16:09 2011 @@ -251,7 +251,7 @@ public class PhoneticEngine { return phonemeBuilder; } -SetRule.Phoneme phonemes = new TreeSetRule.Phoneme(); +SetRule.Phoneme phonemes = new TreeSetRule.Phoneme(Rule.Phoneme.COMPARATOR); for (Rule.Phoneme phoneme : phonemeBuilder.getPhonemes()) { PhonemeBuilder subBuilder = PhonemeBuilder.empty(phoneme.getLanguages()); Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java?rev=1155182r1=1155181r2=1155182view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java Tue Aug 9 01:16:09 2011 @@ -21,6 +21,7 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Comparator; import java.util.EnumMap; import java.util.HashMap; import java.util.HashSet; @@ -80,7 +81,26 @@ import java.util.regex.Pattern; */ public class Rule { -public static final class Phoneme implements PhonemeExpr, ComparablePhoneme { +public static final class Phoneme implements PhonemeExpr { +public static final ComparatorPhoneme COMPARATOR = new ComparatorPhoneme() { +public int compare(Phoneme o1, Phoneme o2) { +for (int i = 0; i o1.phonemeText.length(); i++) { +if (i = o2.phonemeText.length()) { +return +1; +} +int c = o1.phonemeText.charAt(i) - o2.phonemeText.charAt(i); +if (c != 0) { +return c; +} +} + +if (o1.phonemeText.length() o2.phonemeText.length()) { +return -1; +} + +return 0; +} +}; private final CharSequence phonemeText; private final Languages.LanguageSet languages; @@ -94,24 +114,6 @@ public class Rule { return new Phoneme(this.phonemeText.toString() + str.toString(), this.languages); } -public int compareTo(Phoneme o) { -for (int i = 0; i phonemeText.length(); i++) { -if (i = o.phonemeText.length()) { -return +1; -} -int c = phonemeText.charAt(i) - o.phonemeText.charAt(i); -if (c != 0) { -return c; -} -} - -if (phonemeText.length() o.phonemeText.length()) { -return -1; -} - -return 0; -} - public Languages.LanguageSet getLanguages() { return this.languages; } Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java?rev=1155182r1=1155181r2=1155182view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java Tue Aug 9 01:16:09 2011 @@ -63,7 +63,7 @@ public class RuleTest { for (Rule.Phoneme[] phs : makePhonemes()) { for (int i = 0; i phs.length; i++) { for (int j = i + 1; j phs.length; j++) { -int c = phs[i].compareTo(phs[j
svn commit: r1155183 - /commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java
Author: ggregory Date: Tue Aug 9 01:17:26 2011 New Revision: 1155183 URL: http://svn.apache.org/viewvc?rev=1155183view=rev Log: Prefix @Test method names with test. Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java?rev=1155183r1=1155182r2=1155183view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/bm/RuleTest.java Tue Aug 9 01:17:26 2011 @@ -59,7 +59,7 @@ public class RuleTest { } @Test -public void phonemeComparedToLaterIsNegative() { +public void testPhonemeComparedToLaterIsNegative() { for (Rule.Phoneme[] phs : makePhonemes()) { for (int i = 0; i phs.length; i++) { for (int j = i + 1; j phs.length; j++) { @@ -73,7 +73,7 @@ public class RuleTest { } @Test -public void phonemeComparedToSelfIsZero() { +public void testPhonemeComparedToSelfIsZero() { for (Rule.Phoneme[] phs : makePhonemes()) { for (Rule.Phoneme ph : phs) { assertEquals(Phoneme compared to itself should be zero: + ph.getPhonemeText(), 0, @@ -83,7 +83,7 @@ public class RuleTest { } @Test -public void subSequenceWorks() { +public void testSubSequenceWorks() { // AppendableCharSequence is private to Rule. We can only make it through a Phoneme. Rule.Phoneme a = new Rule.Phoneme(a, null);
svn commit: r1156841 [2/2] - in /commons/proper/codec/trunk: ./ src/java/org/apache/commons/codec/ src/java/org/apache/commons/codec/binary/ src/java/org/apache/commons/codec/digest/ src/java/org/apac
Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/BaseNCodecTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/BaseNCodecTest.java?rev=1156841r1=1156698r2=1156841view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/BaseNCodecTest.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/BaseNCodecTest.java Thu Aug 11 21:33:42 2011 @@ -16,7 +16,7 @@ * */ -package org.apache.commons.codec.binary; +package org.apache.commons.codec2.binary; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/BinaryCodecTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/BinaryCodecTest.java?rev=1156841r1=1156698r2=1156841view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/BinaryCodecTest.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/BinaryCodecTest.java Thu Aug 11 21:33:42 2011 @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.commons.codec.binary; +package org.apache.commons.codec2.binary; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import java.io.UnsupportedEncodingException; -import org.apache.commons.codec.DecoderException; -import org.apache.commons.codec.EncoderException; +import org.apache.commons.codec2.DecoderException; +import org.apache.commons.codec2.EncoderException; import org.junit.After; import org.junit.Before; import org.junit.Test; Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/Codec105ErrorInputStream.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/Codec105ErrorInputStream.java?rev=1156841r1=1156698r2=1156841view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/Codec105ErrorInputStream.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/Codec105ErrorInputStream.java Thu Aug 11 21:33:42 2011 @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.commons.codec.binary; +package org.apache.commons.codec2.binary; import java.io.IOException; import java.io.InputStream; Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/HexTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/HexTest.java?rev=1156841r1=1156698r2=1156841view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/HexTest.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/HexTest.java Thu Aug 11 21:33:42 2011 @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.commons.codec.binary; +package org.apache.commons.codec2.binary; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -29,12 +29,12 @@ import java.util.Random; import junit.framework.Assert; -import org.apache.commons.codec.DecoderException; -import org.apache.commons.codec.EncoderException; +import org.apache.commons.codec2.DecoderException; +import org.apache.commons.codec2.EncoderException; import org.junit.Test; /** - * Tests {@link org.apache.commons.codec.binary.Hex}. + * Tests {@link org.apache.commons.codec2.binary.Hex}. * * @author Apache Software Foundation * @version $Id$ Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/StringUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/StringUtilsTest.java?rev=1156841r1=1156698r2=1156841view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/StringUtilsTest.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec2/binary/StringUtilsTest.java Thu Aug 11 21:33:42 2011 @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.commons.codec.binary; +package org.apache.commons.codec2.binary; import java.io.UnsupportedEncodingException; import java.util.Arrays; Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec2/digest/DigestUtilsTest.java URL:
svn commit: r1157192 - in /commons/proper/codec/trunk: ./ src/java/org/apache/commons/codec/ src/java/org/apache/commons/codec/binary/ src/java/org/apache/commons/codec/digest/ src/java/org/apache/com
Author: ggregory Date: Fri Aug 12 17:27:38 2011 New Revision: 1157192 URL: http://svn.apache.org/viewvc?rev=1157192view=rev Log: Revert previous commit. update C:/svn/org/apache/commons/trunks-proper/codec -r HEAD --force At revision 1157191. merge --depth=infinity -r1156841:1156840 https://svn.apache.org/repos/asf/commons/proper/codec/trunk C:/svn/org/apache/commons/trunks-proper/codec Status against revision: 1157191 --- Reverse-merging r1156841 through r1156840 into C:/svn/org/apache/commons/trunks-proper/codec U C:/svn/org/apache/commons/trunks-proper/codec/default.properties A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/digest A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/digest/DigestUtilsTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/ColognePhoneticTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/MetaphoneTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/RefinedSoundexTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/SoundexTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/Caverphone1Test.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/Caverphone2Test.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/DoubleMetaphone2Test.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/bm A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/bm/PhoneticEngineTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/bm/RuleTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/language/bm/LanguageGuessingTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/CharEncodingTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/DecoderExceptionTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/Base32Test.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/Base64InputStreamTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/Base64OutputStreamTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/BinaryCodecTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/Base64Test.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/HexTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/Base64Codec13Test.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/BaseNCodecTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/StringUtilsTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/Base32TestData.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/Codec105ErrorInputStream.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/Base32OutputStreamTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/binary/Base64TestData.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/net A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/net/BCodecTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/net/QuotedPrintableCodecTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/net/URLCodecTest.java A C:/svn/org/apache/commons/trunks-proper/codec/src/test/org/apache/commons/codec/net
svn commit: r1157194 - /commons/proper/codec/branches/generics/
Author: ggregory Date: Fri Aug 12 17:33:18 2011 New Revision: 1157194 URL: http://svn.apache.org/viewvc?rev=1157194view=rev Log: Branch for adding generics. Added: commons/proper/codec/branches/generics/ - copied from r1157192, commons/proper/codec/trunk/
svn commit: r1157231 [2/5] - in /commons/proper/codec/branches/generics: ./ src/java/org/apache/commons/codec/ src/java/org/apache/commons/codec/binary/ src/java/org/apache/commons/codec/language/ src
Added: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/binary/HexByteCodec.java URL: http://svn.apache.org/viewvc/commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/binary/HexByteCodec.java?rev=1157231view=auto == --- commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/binary/HexByteCodec.java (added) +++ commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/binary/HexByteCodec.java Fri Aug 12 19:50:56 2011 @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.codec.binary; + +import java.io.UnsupportedEncodingException; + +public class HexByteCodec extends Hex { + +public HexByteCodec() { +super(); +} + +public HexByteCodec(String charsetName) { +super(charsetName); +} + +/** + * Converts an array of bytes into an array of bytes for the characters representing the hexadecimal values of each byte in order. The + * returned array will be double the length of the passed array, as it takes two characters to represent any given byte. + * p + * The conversion from hexadecimal characters to the returned bytes is performed with the charset named by {@link #getCharsetName()}. + * /p + * + * @param array + *a byte[] to convert to Hex characters + * @return A byte[] containing the bytes of the hexadecimal characters + * @throws IllegalStateException + * if the charsetName is invalid. This API throws {@link IllegalStateException} instead of + * {@link UnsupportedEncodingException} for backward compatibility. + * @see #encodeHex(byte[]) + */ +public byte[] encode(byte[] array) { +return StringUtils.getBytesUnchecked(encodeHexString(array), getCharsetName()); +} + +} \ No newline at end of file Added: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/binary/HexCharCodec.java URL: http://svn.apache.org/viewvc/commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/binary/HexCharCodec.java?rev=1157231view=auto == --- commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/binary/HexCharCodec.java (added) +++ commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/binary/HexCharCodec.java Fri Aug 12 19:50:56 2011 @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.codec.binary; + +import org.apache.commons.codec.Encoder; + +public class HexCharCodec extends Hex implements Encoderbyte[], char[] { + +public HexCharCodec() { +super(); +} + +public HexCharCodec(String charsetName) { +super(charsetName); +} + +/** + * Converts a String or an array of bytes into an array of characters representing the hexadecimal values of each byte in order. The + * returned array will be double the length of the passed String or array, as it takes two characters to represent any given byte. + * p + * The conversion from hexadecimal characters to bytes to be encoded to performed with the charset named by {@link #getCharsetName()}. + * /p + * + * @param byteArray + *a String, or byte[] to convert to Hex
svn commit: r1157231 [3/5] - in /commons/proper/codec/branches/generics: ./ src/java/org/apache/commons/codec/ src/java/org/apache/commons/codec/binary/ src/java/org/apache/commons/codec/language/ src
Added: commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/BinaryByteCodecTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/BinaryByteCodecTest.java?rev=1157231view=auto == --- commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/BinaryByteCodecTest.java (added) +++ commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/BinaryByteCodecTest.java Fri Aug 12 19:50:56 2011 @@ -0,0 +1,1166 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.codec.binary; + +import static org.junit.Assert.assertEquals; + +import java.io.UnsupportedEncodingException; + +import org.apache.commons.codec.DecoderException; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * TestCase for BinaryByteCodec class. + * + * @author Apache Software Foundation + * @version $Id: BinaryCharCodecTest.java 1156841 2011-08-11 21:33:42Z ggregory $ + */ +public class BinaryByteCodecTest { +/** mask with bit zero based index 0 raised */ +private static final int BIT_0 = 0x01; + +/** mask with bit zero based index 0 raised */ +private static final int BIT_1 = 0x02; + +/** mask with bit zero based index 0 raised */ +private static final int BIT_2 = 0x04; + +/** mask with bit zero based index 0 raised */ +private static final int BIT_3 = 0x08; + +/** mask with bit zero based index 0 raised */ +private static final int BIT_4 = 0x10; + +/** mask with bit zero based index 0 raised */ +private static final int BIT_5 = 0x20; + +/** mask with bit zero based index 0 raised */ +private static final int BIT_6 = 0x40; + +/** mask with bit zero based index 0 raised */ +private static final int BIT_7 = 0x80; + +/** an instance of the binary codec */ +BinaryByteCodec instance = null; + +@Before +public void setUp() throws Exception { +this.instance = new BinaryByteCodec(); +} + +@After +public void tearDown() throws Exception { +this.instance = null; +} + +/** + * Tests for Object decode(Object) + */ +@Test +public void testDecodeObject() throws Exception { +byte[] bits; +// With a single raw binary +bits = new byte[1]; +assertDecodeObject(bits, ); +bits = new byte[1]; +bits[0] = BIT_0; +assertDecodeObject(bits, 0001); +bits = new byte[1]; +bits[0] = BIT_0 | BIT_1; +assertDecodeObject(bits, 0011); +bits = new byte[1]; +bits[0] = BIT_0 | BIT_1 | BIT_2; +assertDecodeObject(bits, 0111); +bits = new byte[1]; +bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3; +assertDecodeObject(bits, ); +bits = new byte[1]; +bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4; +assertDecodeObject(bits, 0001); +bits = new byte[1]; +bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5; +assertDecodeObject(bits, 0011); +bits = new byte[1]; +bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6; +assertDecodeObject(bits, 0111); +bits = new byte[1]; +bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7); +assertDecodeObject(bits, ); +// With a two raw binaries +bits = new byte[2]; +bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7); +assertDecodeObject(bits, ); +bits = new byte[2]; +bits[1] = BIT_0; +bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7); +assertDecodeObject(bits, 0001); +bits = new byte[2]; +bits[1] = BIT_0 | BIT_1; +bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7); +assertDecodeObject(bits, 0011); +bits = new byte[2]; +bits[1] = BIT_0 | BIT_1 | BIT_2
svn commit: r1157545 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java
Author: ggregory Date: Sun Aug 14 15:23:41 2011 New Revision: 1157545 URL: http://svn.apache.org/viewvc?rev=1157545view=rev Log: [CODEC-127] Non-ascii characters in source files Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java?rev=1157545r1=1157544r2=1157545view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java Sun Aug 14 15:23:41 2011 @@ -262,10 +262,11 @@ public class ColognePhonetic implements } } -private static final char[][] PREPROCESS_MAP = new char[][]{{'\u00C4', 'A'}, // Ãâ -{'\u00DC', 'U'}, // ÃÅ -{'\u00D6', 'O'}, // Ãâ -{'\u00DF', 'S'} // ß +private static final char[][] PREPROCESS_MAP = new char[][]{ +{'\u00C4', 'A'}, // capital a, umlaut mark +{'\u00DC', 'U'}, // capital u, umlaut mark +{'\u00D6', 'O'}, // capital o, umlaut mark +{'\u00DF', 'S'} // small sharp s, German }; /*
svn commit: r1157546 - /commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java
Author: ggregory Date: Sun Aug 14 15:24:07 2011 New Revision: 1157546 URL: http://svn.apache.org/viewvc?rev=1157546view=rev Log: [CODEC-127] Non-ascii characters in source files Modified: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java Modified: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java URL: http://svn.apache.org/viewvc/commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java?rev=1157546r1=1157545r2=1157546view=diff == --- commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java (original) +++ commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java Sun Aug 14 15:24:07 2011 @@ -261,10 +261,11 @@ public class ColognePhonetic implements } } -private static final char[][] PREPROCESS_MAP = new char[][]{{'\u00C4', 'A'}, // Ãâ -{'\u00DC', 'U'}, // ÃÅ -{'\u00D6', 'O'}, // Ãâ -{'\u00DF', 'S'} // ß +private static final char[][] PREPROCESS_MAP = new char[][]{ +{'\u00C4', 'A'}, // capital a, umlaut mark +{'\u00DC', 'U'}, // capital u, umlaut mark +{'\u00D6', 'O'}, // capital o, umlaut mark +{'\u00DF', 'S'} // small sharp s, German }; /*
svn commit: r1157549 - /commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java
Author: ggregory Date: Sun Aug 14 15:33:13 2011 New Revision: 1157549 URL: http://svn.apache.org/viewvc?rev=1157549view=rev Log: [CODEC-127] Non-ascii characters in source files Modified: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java Modified: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java URL: http://svn.apache.org/viewvc/commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java?rev=1157549r1=1157548r2=1157549view=diff == --- commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java (original) +++ commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/ColognePhonetic.java Sun Aug 14 15:33:13 2011 @@ -261,11 +261,20 @@ public class ColognePhonetic implements } } -private static final char[][] PREPROCESS_MAP = new char[][]{ -{'\u00C4', 'A'}, // capital a, umlaut mark -{'\u00DC', 'U'}, // capital u, umlaut mark -{'\u00D6', 'O'}, // capital o, umlaut mark -{'\u00DF', 'S'} // small sharp s, German +/** + * Maps some Germanic characters to plain for internal processing. The following characters are mapped: + * ul + * licapital a, umlaut mark/li + * licapital u, umlaut mark/li + * licapital o, umlaut mark/li + * lismall sharp s, German/li + * /ul + */ +private static final char[][] PREPROCESS_MAP = new char[][] { +{ '\u00C4', 'A' }, // capital a, umlaut mark +{ '\u00DC', 'U' }, // capital u, umlaut mark +{ '\u00D6', 'O' }, // capital o, umlaut mark +{ '\u00DF', 'S' } // small sharp s, German }; /* @@ -385,8 +394,8 @@ public class ColognePhonetic implements return colognePhonetic(text1).equals(colognePhonetic(text2)); } -/* - * Converts the string to upper case and replaces germanic umlauts, and the ââ¬Åßââ¬ï¿½. +/** + * Converts the string to upper case and replaces germanic characters as defined in {@link #PREPROCESS_MAP}. */ private String preprocess(String text) { text = text.toUpperCase(Locale.GERMAN);
svn commit: r1158278 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharUtilsTest.java
Author: ggregory Date: Tue Aug 16 14:04:52 2011 New Revision: 1158278 URL: http://svn.apache.org/viewvc?rev=1158278view=rev Log: Port to JUnit 4. Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharUtilsTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharUtilsTest.java?rev=1158278r1=1158277r2=1158278view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharUtilsTest.java Tue Aug 16 14:04:52 2011 @@ -16,27 +16,28 @@ */ package org.apache.commons.lang3; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; -import junit.framework.TestCase; +import org.junit.Test; /** * Unit tests {@link org.apache.commons.lang3.CharUtils}. * * @version $Id$ */ -public class CharUtilsTest extends TestCase { +public class CharUtilsTest { private static final Character CHARACTER_A = new Character('A'); private static final Character CHARACTER_B = new Character('B'); private static final char CHAR_COPY = '\u00a9'; -public CharUtilsTest(String name) { -super(name); -} - -//--- +@Test public void testConstructor() { assertNotNull(new CharUtils()); Constructor?[] cons = CharUtils.class.getDeclaredConstructors(); @@ -46,7 +47,7 @@ public class CharUtilsTest extends TestC assertEquals(false, Modifier.isFinal(BooleanUtils.class.getModifiers())); } -//--- +@Test public void testToCharacterObject_char() { assertEquals(new Character('a'), CharUtils.toCharacterObject('a')); assertSame(CharUtils.toCharacterObject('a'), CharUtils.toCharacterObject('a')); @@ -67,6 +68,7 @@ public class CharUtilsTest extends TestC } } +@Test public void testToCharacterObject_String() { assertEquals(null, CharUtils.toCharacterObject(null)); assertEquals(null, CharUtils.toCharacterObject()); @@ -76,7 +78,7 @@ public class CharUtilsTest extends TestC assertSame(CharUtils.toCharacterObject(a), CharUtils.toCharacterObject('a')); } -//--- +@Test public void testToChar_Character() { assertEquals('A', CharUtils.toChar(CHARACTER_A)); assertEquals('B', CharUtils.toChar(CHARACTER_B)); @@ -85,13 +87,14 @@ public class CharUtilsTest extends TestC } catch (IllegalArgumentException ex) {} } +@Test public void testToChar_Character_char() { assertEquals('A', CharUtils.toChar(CHARACTER_A, 'X')); assertEquals('B', CharUtils.toChar(CHARACTER_B, 'X')); assertEquals('X', CharUtils.toChar((Character) null, 'X')); } -//--- +@Test public void testToChar_String() { assertEquals('A', CharUtils.toChar(A)); assertEquals('B', CharUtils.toChar(BA)); @@ -103,6 +106,7 @@ public class CharUtilsTest extends TestC } catch (IllegalArgumentException ex) {} } +@Test public void testToChar_String_char() { assertEquals('A', CharUtils.toChar(A, 'X')); assertEquals('B', CharUtils.toChar(BA, 'X')); @@ -110,7 +114,7 @@ public class CharUtilsTest extends TestC assertEquals('X', CharUtils.toChar((String) null, 'X')); } -//--- +@Test public void testToIntValue_char() { assertEquals(0, CharUtils.toIntValue('0')); assertEquals(1, CharUtils.toIntValue('1')); @@ -127,13 +131,14 @@ public class CharUtilsTest extends TestC } catch (IllegalArgumentException ex) {} } +@Test public void testToIntValue_char_int() { assertEquals(0, CharUtils.toIntValue('0', -1)); assertEquals(3, CharUtils.toIntValue('3', -1)); assertEquals(-1, CharUtils.toIntValue('a', -1)); } -//--- +@Test public void testToIntValue_Character() { assertEquals(0, CharUtils.toIntValue(new Character('0'))); assertEquals(3, CharUtils.toIntValue(new Character('3'))); @@ -145,6 +150,7 @@ public class CharUtilsTest extends TestC
svn commit: r1158279 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java
Author: ggregory Date: Tue Aug 16 14:06:45 2011 New Revision: 1158279 URL: http://svn.apache.org/viewvc?rev=1158279view=rev Log: [LANG-736] CharUtils static final array CHAR_STRING is not needed to compute CHAR_STRING_ARRAY. Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java?rev=1158279r1=1158278r2=1158279view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharUtils.java Tue Aug 16 14:06:45 2011 @@ -29,24 +29,6 @@ package org.apache.commons.lang3; */ public class CharUtils { -private static final String CHAR_STRING = -\u\u0001\u0002\u0003\u0004\u0005\u0006\u0007 + -\b\t\n\u000b\f\r\u000e\u000f + -\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017 + -\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f + -\u0020\u0021\\u0023\u0024\u0025\u0026\u0027 + -\u0028\u0029\u002a\u002b\u002c\u002d\u002e\u002f + -\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037 + -\u0038\u0039\u003a\u003b\u003c\u003d\u003e\u003f + -\u0040\u0041\u0042\u0043\u0044\u0045\u0046\u0047 + -\u0048\u0049\u004a\u004b\u004c\u004d\u004e\u004f + -\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057 + -\u0058\u0059\u005a\u005b\\\u005d\u005e\u005f + -\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067 + -\u0068\u0069\u006a\u006b\u006c\u006d\u006e\u006f + -\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077 + -\u0078\u0079\u007a\u007b\u007c\u007d\u007e\u007f; - private static final String[] CHAR_STRING_ARRAY = new String[128]; /** @@ -69,8 +51,8 @@ public class CharUtils { static { -for (int i = 127; i = 0; i--) { -CHAR_STRING_ARRAY[i] = CHAR_STRING.substring(i, i + 1); +for (char c = 0; c CHAR_STRING_ARRAY.length; c++) { +CHAR_STRING_ARRAY[c] = String.valueOf(c); } }
svn commit: r1158282 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java
Author: ggregory Date: Tue Aug 16 14:09:15 2011 New Revision: 1158282 URL: http://svn.apache.org/viewvc?rev=1158282view=rev Log: Port to JUnit 4. Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java?rev=1158282r1=1158281r2=1158282view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsAddTest.java Tue Aug 16 14:09:15 2011 @@ -17,17 +17,25 @@ package org.apache.commons.lang3; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.util.Arrays; -import junit.framework.TestCase; +import org.junit.Test; /** * Tests ArrayUtils add methods. * * @version $Id$ */ -public class ArrayUtilsAddTest extends TestCase { +public class ArrayUtilsAddTest { +@Test public void testJira567(){ Number[] n; // Valid array construction @@ -42,6 +50,7 @@ public class ArrayUtilsAddTest extends T } } +@Test public void testAddObjectArrayBoolean() { boolean[] newArray; newArray = ArrayUtils.add((boolean[])null, false); @@ -56,6 +65,7 @@ public class ArrayUtilsAddTest extends T assertEquals(Boolean.TYPE, newArray.getClass().getComponentType()); } +@Test public void testAddObjectArrayByte() { byte[] newArray; newArray = ArrayUtils.add((byte[])null, (byte)0); @@ -73,6 +83,7 @@ public class ArrayUtilsAddTest extends T assertEquals(Byte.TYPE, newArray.getClass().getComponentType()); } +@Test public void testAddObjectArrayChar() { char[] newArray; newArray = ArrayUtils.add((char[])null, (char)0); @@ -90,6 +101,7 @@ public class ArrayUtilsAddTest extends T assertEquals(Character.TYPE, newArray.getClass().getComponentType()); } +@Test public void testAddObjectArrayDouble() { double[] newArray; newArray = ArrayUtils.add((double[])null, 0); @@ -107,6 +119,7 @@ public class ArrayUtilsAddTest extends T assertEquals(Double.TYPE, newArray.getClass().getComponentType()); } +@Test public void testAddObjectArrayFloat() { float[] newArray; newArray = ArrayUtils.add((float[])null, 0); @@ -124,6 +137,7 @@ public class ArrayUtilsAddTest extends T assertEquals(Float.TYPE, newArray.getClass().getComponentType()); } +@Test public void testAddObjectArrayInt() { int[] newArray; newArray = ArrayUtils.add((int[])null, 0); @@ -141,6 +155,7 @@ public class ArrayUtilsAddTest extends T assertEquals(Integer.TYPE, newArray.getClass().getComponentType()); } +@Test public void testAddObjectArrayLong() { long[] newArray; newArray = ArrayUtils.add((long[])null, 0); @@ -158,6 +173,7 @@ public class ArrayUtilsAddTest extends T assertEquals(Long.TYPE, newArray.getClass().getComponentType()); } +@Test public void testAddObjectArrayShort() { short[] newArray; newArray = ArrayUtils.add((short[])null, (short)0); @@ -175,6 +191,7 @@ public class ArrayUtilsAddTest extends T assertEquals(Short.TYPE, newArray.getClass().getComponentType()); } +@Test public void testAddObjectArrayObject() { Object[] newArray; @@ -210,6 +227,7 @@ public class ArrayUtilsAddTest extends T assertEquals(Float.class, newArray.getClass().getComponentType()); } +@Test public void testLANG571(){ String[] stringArray=null; String aString=null; @@ -229,6 +247,7 @@ public class ArrayUtilsAddTest extends T } } +@Test public void testAddObjectArrayToObjectArray() { assertNull(ArrayUtils.addAll((Object[]) null, (Object[]) null)); Object[] newArray; @@ -346,6 +365,7 @@ public class ArrayUtilsAddTest extends T } +@Test public void testAddObjectAtIndex() { Object[] newArray; newArray = ArrayUtils.add((Object[])null, 0, a);
svn commit: r1158284 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsRemoveTest.java
Author: ggregory Date: Tue Aug 16 14:11:31 2011 New Revision: 1158284 URL: http://svn.apache.org/viewvc?rev=1158284view=rev Log: Port to JUnit 4. Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsRemoveTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsRemoveTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsRemoveTest.java?rev=1158284r1=1158283r2=1158284view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsRemoveTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsRemoveTest.java Tue Aug 16 14:11:31 2011 @@ -17,17 +17,23 @@ package org.apache.commons.lang3; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.util.Arrays; -import junit.framework.TestCase; +import org.junit.Test; /** * Tests ArrayUtils remove and removeElement methods. * * @version $Id$ */ -public class ArrayUtilsRemoveTest extends TestCase { +public class ArrayUtilsRemoveTest { +@Test public void testRemoveObjectArray() { Object[] array; array = ArrayUtils.remove(new Object[] {a}, 0); @@ -56,6 +62,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } +@Test public void testRemoveNumberArray(){ Number[] inarray = {Integer.valueOf(1),Long.valueOf(2),Byte.valueOf((byte) 3)}; assertEquals(3, inarray.length); @@ -71,6 +78,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Number.class, outarray.getClass().getComponentType()); } +@Test public void testRemoveBooleanArray() { boolean[] array; array = ArrayUtils.remove(new boolean[] {true}, 0); @@ -99,6 +107,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } +@Test public void testRemoveByteArray() { byte[] array; array = ArrayUtils.remove(new byte[] {1}, 0); @@ -127,6 +136,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } +@Test public void testRemoveCharArray() { char[] array; array = ArrayUtils.remove(new char[] {'a'}, 0); @@ -155,6 +165,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } +@Test public void testRemoveDoubleArray() { double[] array; array = ArrayUtils.remove(new double[] {1}, 0); @@ -183,6 +194,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } +@Test public void testRemoveFloatArray() { float[] array; array = ArrayUtils.remove(new float[] {1}, 0); @@ -211,6 +223,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } +@Test public void testRemoveIntArray() { int[] array; array = ArrayUtils.remove(new int[] {1}, 0); @@ -239,6 +252,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } +@Test public void testRemoveLongArray() { long[] array; array = ArrayUtils.remove(new long[] {1}, 0); @@ -267,6 +281,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } +@Test public void testRemoveShortArray() { short[] array; array = ArrayUtils.remove(new short[] {1}, 0); @@ -295,6 +310,7 @@ public class ArrayUtilsRemoveTest extend } catch (IndexOutOfBoundsException e) {} } +@Test public void testRemoveElementObjectArray() { Object[] array; array = ArrayUtils.removeElement((Object[]) null, a); @@ -313,6 +329,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Object.class, array.getClass().getComponentType()); } +@Test public void testRemoveElementBooleanArray() { boolean[] array; array = ArrayUtils.removeElement((boolean[]) null, true); @@ -331,6 +348,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Boolean.TYPE, array.getClass().getComponentType()); } +@Test public void testRemoveElementByteArray() { byte[] array; array = ArrayUtils.removeElement((byte[]) null, (byte) 1); @@ -349,6 +367,7 @@ public class ArrayUtilsRemoveTest extend assertEquals(Byte.TYPE, array.getClass().getComponentType()); } +@Test public void testRemoveElementCharArray() { char[] array; array = ArrayUtils.removeElement((char
svn commit: r1158984 - /commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/Rule.java
Author: ggregory Date: Thu Aug 18 01:28:58 2011 New Revision: 1158984 URL: http://svn.apache.org/viewvc?rev=1158984view=rev Log: Port change from trunk by Sebb. Modified: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/Rule.java Modified: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/Rule.java URL: http://svn.apache.org/viewvc/commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/Rule.java?rev=1158984r1=1158983r2=1158984view=diff == --- commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/Rule.java (original) +++ commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/Rule.java Thu Aug 18 01:28:58 2011 @@ -369,14 +369,14 @@ public class Rule { PhonemeExpr ph = parsePhonemeExpr(stripQuotes(parts[3])); final int cLine = currentLine; Rule r = new Rule(pat, lCon, rCon, ph) { -private final int line = cLine; +private final int myLine = cLine; private final String loc = location; @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append(Rule); -sb.append({line=).append(line); +sb.append({line=).append(myLine); sb.append(, loc=').append(loc).append('\''); sb.append('}'); return sb.toString();
svn commit: r1161342 - in /commons/proper/codec/trunk/src: java/org/apache/commons/codec/language/bm/ test/org/apache/commons/codec/binary/
Author: ggregory Date: Thu Aug 25 00:34:24 2011 New Revision: 1161342 URL: http://svn.apache.org/viewvc?rev=1161342view=rev Log: Use blocks. Refer to constants where they are defined in BaseNCodec instead of the Base32 and Base64 subclasses. Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Lang.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base32OutputStreamTest.java commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64InputStreamTest.java commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64OutputStreamTest.java commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Lang.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Lang.java?rev=1161342r1=1161341r2=1161342view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Lang.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Lang.java Thu Aug 25 00:34:24 2011 @@ -158,8 +158,9 @@ public class Lang { // trim leading-trailing whitespace line = line.trim(); -if (line.length() == 0) +if (line.length() == 0) { continue; // empty lines can be safely skipped +} // split it up String[] parts = line.split(\\s+); Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java?rev=1161342r1=1161341r2=1161342view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java Thu Aug 25 00:34:24 2011 @@ -189,8 +189,9 @@ public class PhoneticEngine { } public CharSequence subSequence(int start, int end) { -if (start == end) +if (start == end) { return ; +} CharSequence res = cache[start][end - 1]; if (res == null) { Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java?rev=1161342r1=1161341r2=1161342view=diff == --- commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java (original) +++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java Thu Aug 25 00:34:24 2011 @@ -128,7 +128,7 @@ public class Base32InputStreamTest { */ @Test public void testBase32EmptyInputStreamMimeChuckSize() throws Exception { -testBase32EmptyInputStream(Base32.MIME_CHUNK_SIZE); +testBase32EmptyInputStream(BaseNCodec.MIME_CHUNK_SIZE); } /** @@ -139,7 +139,7 @@ public class Base32InputStreamTest { */ @Test public void testBase32EmptyInputStreamPemChuckSize() throws Exception { -testBase32EmptyInputStream(Base32.PEM_CHUNK_SIZE); +testBase32EmptyInputStream(BaseNCodec.PEM_CHUNK_SIZE); } private void testBase32EmptyInputStream(int chuckSize) throws Exception { @@ -160,12 +160,12 @@ public class Base32InputStreamTest { // Hello World test. byte[] encoded = StringUtils.getBytesUtf8(Base32TestData.BASE32_FIXTURE); byte[] decoded = StringUtils.getBytesUtf8(Base32TestData.STRING_FIXTURE); -testByChunk(encoded, decoded, Base32.MIME_CHUNK_SIZE, CRLF); +testByChunk(encoded, decoded, BaseNCodec.MIME_CHUNK_SIZE, CRLF); // Single Byte test. encoded = StringUtils.getBytesUtf8(AA==\r\n); decoded = new byte[]{(byte) 0}; -testByChunk(encoded, decoded, Base32.MIME_CHUNK_SIZE, CRLF); +testByChunk(encoded, decoded, BaseNCodec.MIME_CHUNK_SIZE, CRLF); //// OpenSSL interop test. //encoded = StringUtils.getBytesUtf8(Base32TestData.ENCODED_32_CHARS_PER_LINE); @@ -199,12 +199,12 @@ public class Base32InputStreamTest { // Hello World test
svn commit: r1161343 [1/2] - in /commons/proper/codec/branches/generics/src: java/org/apache/commons/codec/language/bm/ java/org/apache/commons/codec/net/ test/org/apache/commons/codec/binary/ test/or
Author: ggregory Date: Thu Aug 25 00:35:31 2011 New Revision: 1161343 URL: http://svn.apache.org/viewvc?rev=1161343view=rev Log: Use blocks. Refer to constants and methods where they are defined in BaseNCodec instead of the Base32 and Base64 subclasses (and other classes.) Modified: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/Lang.java commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/net/URLStringCodec.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/Base32InputStreamTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/Base32OutputStreamTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/Base64InputStreamTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/Base64OutputStreamTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/Base64Test.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/BinaryByteCodecTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/BinaryCharCodecTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/HexByteTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/HexCharTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/net/BCodecTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/net/QCodecTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/net/QuotedPrintableBinaryCodecTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/net/QuotedPrintableStringCodecTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/net/URLCodecBinaryTest.java commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/net/URLCodecStringTest.java Modified: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/Lang.java URL: http://svn.apache.org/viewvc/commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/Lang.java?rev=1161343r1=1161342r2=1161343view=diff == --- commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/Lang.java (original) +++ commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/Lang.java Thu Aug 25 00:35:31 2011 @@ -158,8 +158,9 @@ public class Lang { // trim leading-trailing whitespace line = line.trim(); -if (line.length() == 0) +if (line.length() == 0) { continue; // empty lines can be safely skipped +} // split it up String[] parts = line.split(\\s+); Modified: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java URL: http://svn.apache.org/viewvc/commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java?rev=1161343r1=1161342r2=1161343view=diff == --- commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java (original) +++ commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/language/bm/PhoneticEngine.java Thu Aug 25 00:35:31 2011 @@ -189,8 +189,9 @@ public class PhoneticEngine { } public CharSequence subSequence(int start, int end) { -if (start == end) +if (start == end) { return ; +} CharSequence res = cache[start][end - 1]; if (res == null) { Modified: commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/net/URLStringCodec.java URL: http://svn.apache.org/viewvc/commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/net/URLStringCodec.java?rev=1161343r1=1161342r2=1161343view=diff == --- commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/net/URLStringCodec.java (original) +++ commons/proper/codec/branches/generics/src/java/org/apache/commons/codec/net/URLStringCodec.java Thu Aug 25 00:35:31 2011 @@ -52,6 +52,7 @@ public class URLStringCodec extends URLC * * @return the default string charset. */ +@Override public String getDefaultCharset
svn commit: r1161343 [2/2] - in /commons/proper/codec/branches/generics/src: java/org/apache/commons/codec/language/bm/ java/org/apache/commons/codec/net/ test/org/apache/commons/codec/binary/ test/or
Modified: commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/BinaryCharCodecTest.java URL: http://svn.apache.org/viewvc/commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/BinaryCharCodecTest.java?rev=1161343r1=1161342r2=1161343view=diff == --- commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/BinaryCharCodecTest.java (original) +++ commons/proper/codec/branches/generics/src/test/org/apache/commons/codec/binary/BinaryCharCodecTest.java Thu Aug 25 00:35:31 2011 @@ -157,7 +157,7 @@ public class BinaryCharCodecTest { */ void assertDecodeObject(byte[] bits, String encodeMe) throws DecoderException, UnsupportedEncodingException { byte[] decoded; -decoded = (byte[]) instance.decode(encodeMe); +decoded = instance.decode(encodeMe); assertEquals(new String(bits), new String(decoded)); if (encodeMe == null) { decoded = instance.decode((byte[]) null); @@ -365,90 +365,90 @@ public class BinaryCharCodecTest { */ @Test public void testFromAsciiCharArray() { -assertEquals(0, BinaryCharCodec.fromAscii((char[]) null).length); -assertEquals(0, BinaryCharCodec.fromAscii(new char[0]).length); +assertEquals(0, BinaryCodec.fromAscii((char[]) null).length); +assertEquals(0, BinaryCodec.fromAscii(new char[0]).length); // With a single raw binary byte[] bits = new byte[1]; -byte[] decoded = BinaryCharCodec.fromAscii(.toCharArray()); +byte[] decoded = BinaryCodec.fromAscii(.toCharArray()); assertEquals(new String(bits), new String(decoded)); bits = new byte[1]; bits[0] = BIT_0; -decoded = BinaryCharCodec.fromAscii(0001.toCharArray()); +decoded = BinaryCodec.fromAscii(0001.toCharArray()); assertEquals(new String(bits), new String(decoded)); bits = new byte[1]; bits[0] = BIT_0 | BIT_1; -decoded = BinaryCharCodec.fromAscii(0011.toCharArray()); +decoded = BinaryCodec.fromAscii(0011.toCharArray()); assertEquals(new String(bits), new String(decoded)); bits = new byte[1]; bits[0] = BIT_0 | BIT_1 | BIT_2; -decoded = BinaryCharCodec.fromAscii(0111.toCharArray()); +decoded = BinaryCodec.fromAscii(0111.toCharArray()); assertEquals(new String(bits), new String(decoded)); bits = new byte[1]; bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3; -decoded = BinaryCharCodec.fromAscii(.toCharArray()); +decoded = BinaryCodec.fromAscii(.toCharArray()); assertEquals(new String(bits), new String(decoded)); bits = new byte[1]; bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4; -decoded = BinaryCharCodec.fromAscii(0001.toCharArray()); +decoded = BinaryCodec.fromAscii(0001.toCharArray()); assertEquals(new String(bits), new String(decoded)); bits = new byte[1]; bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5; -decoded = BinaryCharCodec.fromAscii(0011.toCharArray()); +decoded = BinaryCodec.fromAscii(0011.toCharArray()); assertEquals(new String(bits), new String(decoded)); bits = new byte[1]; bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6; -decoded = BinaryCharCodec.fromAscii(0111.toCharArray()); +decoded = BinaryCodec.fromAscii(0111.toCharArray()); assertEquals(new String(bits), new String(decoded)); bits = new byte[1]; bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7); -decoded = BinaryCharCodec.fromAscii(.toCharArray()); +decoded = BinaryCodec.fromAscii(.toCharArray()); assertEquals(new String(bits), new String(decoded)); // With a two raw binaries bits = new byte[2]; bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7); -decoded = BinaryCharCodec.fromAscii(.toCharArray()); +decoded = BinaryCodec.fromAscii(.toCharArray()); assertEquals(new String(bits), new String(decoded)); bits = new byte[2]; bits[1] = BIT_0; bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7); -decoded = BinaryCharCodec.fromAscii(0001.toCharArray()); +decoded = BinaryCodec.fromAscii(0001.toCharArray()); assertEquals(new String(bits), new String(decoded)); bits = new byte[2]; bits[1] = BIT_0 | BIT_1; bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7); -decoded =
svn commit: r1161545 - /commons/proper/codec/trunk/src/changes/changes.xml
Author: ggregory Date: Thu Aug 25 12:48:08 2011 New Revision: 1161545 URL: http://svn.apache.org/viewvc?rev=1161545view=rev Log: Move most changes to release 1.6 from 2.0. Use 2 spaces instead of 4 for indent. Modified: commons/proper/codec/trunk/src/changes/changes.xml Modified: commons/proper/codec/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/changes/changes.xml?rev=1161545r1=1161544r2=1161545view=diff == --- commons/proper/codec/trunk/src/changes/changes.xml (original) +++ commons/proper/codec/trunk/src/changes/changes.xml Thu Aug 25 12:48:08 2011 @@ -17,297 +17,298 @@ -- !-- $Id$ -- document -properties -titleChanges/title -authorGary D. Gregory/author -/properties -body -release version=2.0 date=TBA description=Feature and fix release. -action dev=ggregory, sebb type=fix issue=CODEC-127 - Fix various character encoding issues in comments and test cases. -/action -action dev=ggregory type=fix issue=CODEC-126 - Make org.apache.commons.codec.net.URLCodec charset field final. -/action -action dev=ggregory, matthewpocock type=update issue=CODEC-125 - Implement a Beider-Morse phonetic matching codec. -/action -action dev=ggregory type=update issue=CODEC-119 - Migrate to Java 5. -/action -action dev=ggregory type=update issue=CODEC-120 - Migrate to JUnit 4. -/action -action dev=ggregory type=fix issue=CODEC-123 - ColognePhonetic Javadoc should use HTML entities for special characters. -/action - /release -release version=1.5 date=29 March 2011 description=Feature and fix release. -action dev=sebb type=fix issue=CODEC-89 - new Base64().encode() appends a CRLF, and chunks results into 76 character lines. -/action -action dev=sebb type=fix issue=CODEC-92 - Many test cases use getBytes() which uses the default platform encoding so tests may fail on some platforms. -/action -action dev=sebb, julius, ggregory type=add issue=CODEC-93 due-to=sebb - Add test(s) to check that encodeBase64() does not chunk output. - /action -action dev=sebb type=fix issue=CODEC-97 due-to=mjryall - Base64 default constructor behaviour changed to enable chunking in 1.4. -/action -action dev=ggregory type=fix issue=CODEC-99 due-to=julius - Base64.encodeBase64String() shouldn't chunk. -/action -action dev=julius type=fix issue=CODEC-101 due-to=balusc - Base64InputStream#read(byte[]) incorrectly returns 0 at end of any stream which is multiple of 3 bytes long. -/action -action dev=bayard type=fix issue=CODEC-103 due-to=gnuf - Typo in DecoderException message thrown from Hex.decodeHex. -/action -action dev=julius, ggregory type=add issue=CODEC-105 due-to=zak - ArrayIndexOutOfBoundsException when doing multiple reads() on encoding Base64InputStream. -/action -action dev=bayard type=add issue=CODEC-106 due-to=it2mmeyerfa - Add the Kölner Phonetik encoder (Cologne Phonetic) to codec.lang. -/action -action dev=ggregory type=add issue=CODEC-111 due-to=ggregory - org.apache.commons.codec.net.URLCodec.ESCAPE_CHAR isn't final but should be. -/action -action dev=sebb type=add issue=CODEC-112 due-to=sebb - Base64.encodeBase64(byte[] binaryData, boolean isChunked, boolean urlSafe, int maxResultSize) throws IAE for valid maxResultSize if isChunked is false. -/action -action dev=ggregory type=add issue=CODEC-113 due-to=ggregory - org.apache.commons.codec.language.RefinedSoundex.US_ENGLISH_MAPPING should be package protected MALICIOUS_CODE. -/action -action dev=ggregory type=add issue=CODEC-114 due-to=ggregory - org.apache.commons.codec.language.Soundex.US_ENGLISH_MAPPING should be package protected MALICIOUS_CODE. -/action -action dev=ggregory type=add issue=CODEC-115 due-to=sebb - DoubleMetaphone.maxCodeLen should probably be private. -/action -action dev=ggregory type=remove issue=CODEC-116 due-to=ggregory - Remove deprecated package private method Base64.discardWhitespace(byte[]) -/action -action dev=ggregory type=fix issue=CODEC-117 due-to=ggregory - Caverphone encodes names starting and ending with mb incorrectly. -/action -action dev
svn commit: r1161565 - /commons/proper/io/trunk/pom.xml
Author: ggregory Date: Thu Aug 25 13:34:30 2011 New Revision: 1161565 URL: http://svn.apache.org/viewvc?rev=1161565view=rev Log: Update to [parent] POM 21 from 15. Tested with M2 and M3: Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400) Java version: 1.6.0_24 Java home: C:\Program Files\Java\jdk1.6.0_24\jre Default locale: en_US, platform encoding: Cp1252 OS name: windows 7 version: 6.1 arch: amd64 Family: windows Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500) Maven home: C:\Java\apache-maven-3.0.3\bin\.. Java version: 1.6.0_24, vendor: Sun Microsystems Inc. Java home: C:\Program Files\Java\jdk1.6.0_24\jre Default locale: en_US, platform encoding: Cp1252 OS name: windows 7, version: 6.1, arch: amd64, family: windows Modified: commons/proper/io/trunk/pom.xml Modified: commons/proper/io/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/pom.xml?rev=1161565r1=1161564r2=1161565view=diff == --- commons/proper/io/trunk/pom.xml (original) +++ commons/proper/io/trunk/pom.xml Thu Aug 25 13:34:30 2011 @@ -19,7 +19,7 @@ parent groupIdorg.apache.commons/groupId artifactIdcommons-parent/artifactId -version15/version +version21/version /parent modelVersion4.0.0/modelVersion groupIdcommons-io/groupId
svn commit: r1163295 - in /commons/proper/io/trunk/src: changes/changes.xml main/java/org/apache/commons/io/FileUtils.java test/java/org/apache/commons/io/FileUtilsTestCase.java
Author: ggregory Date: Tue Aug 30 17:22:38 2011 New Revision: 1163295 URL: http://svn.apache.org/viewvc?rev=1163295view=rev Log: [IO-282] Add API FileUtils.copyFile(File input, OutputStream output) Modified: commons/proper/io/trunk/src/changes/changes.xml commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java Modified: commons/proper/io/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1163295r1=1163294r2=1163295view=diff == --- commons/proper/io/trunk/src/changes/changes.xml (original) +++ commons/proper/io/trunk/src/changes/changes.xml Tue Aug 30 17:22:38 2011 @@ -43,6 +43,9 @@ The action type attribute can be add,u action dev=sebb type=fix issue=IO-280 due-to=sebb Dubious use of mkdirs() return code /action + action dev=ggregory type=add issue=IO-282 due-to=ggregory +Add API FileUtils.copyFile(File input, OutputStream output) + /action !-- TODO check where these fixes really belong -- action dev=sebb type=fix issue=IO-274 due-to=Frank Grimes Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java?rev=1163295r1=1163294r2=1163295view=diff == --- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java (original) +++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Tue Aug 30 17:22:38 2011 @@ -889,6 +889,32 @@ public class FileUtils { } /** + * Copy bytes from a codeFile/code to an codeOutputStream/code. + * p + * This method buffers the input internally, so there is no need to use a codeBufferedInputStream/code. + * /p + * + * @param input + *the codeFile/code to read from + * @param output + *the codeOutputStream/code to write to + * @return the number of bytes copied + * @throws NullPointerException + * if the input or output is null + * @throws IOException + * if an I/O error occurs + * @since Commons IO 2.1 + */ +public static long copyFile(File input, OutputStream output) throws IOException { +final FileInputStream fis = new FileInputStream(input); +try { +return IOUtils.copyLarge(fis, output); +} finally { +fis.close(); +} +} + +/** * Internal copy file method. * * @param srcFile the validated source file, must not be codenull/code Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java?rev=1163295r1=1163294r2=1163295view=diff == --- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java (original) +++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java Tue Aug 30 17:22:38 2011 @@ -16,6 +16,7 @@ */ package org.apache.commons.io; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -38,6 +39,7 @@ import java.util.zip.Checksum; import org.apache.commons.io.filefilter.NameFileFilter; import org.apache.commons.io.filefilter.WildcardFileFilter; import org.apache.commons.io.testtools.FileBasedTestCase; +import org.junit.Assert; /** * This is used to test FileUtils for correctness. @@ -836,6 +838,14 @@ public class FileUtilsTestCase extends F testFile1.lastModified() == destination.lastModified());*/ } +public void testCopyFileToOutputStream() throws Exception { +ByteArrayOutputStream destination = new ByteArrayOutputStream(); +FileUtils.copyFile(testFile1, destination); +assertEquals(Check Full copy size, testFile1Size, destination.size()); +byte[] expected = FileUtils.readFileToByteArray(testFile1); +Assert.assertArrayEquals(Check Full copy, expected, destination.toByteArray()); +} + public void IGNOREtestCopyFileLarge() throws Exception { File largeFile = new File(getTestDirectory(), large.txt);
svn commit: r1164304 - /commons/proper/lang/trunk/src/test/resources/java.policy
Author: ggregory Date: Fri Sep 2 00:09:49 2011 New Revision: 1164304 URL: http://svn.apache.org/viewvc?rev=1164304view=rev Log: Test [LANG-744] StringUtils throws java.security.AccessControlException on Google App Engine. Added: commons/proper/lang/trunk/src/test/resources/java.policy Added: commons/proper/lang/trunk/src/test/resources/java.policy URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/resources/java.policy?rev=1164304view=auto == --- commons/proper/lang/trunk/src/test/resources/java.policy (added) +++ commons/proper/lang/trunk/src/test/resources/java.policy Fri Sep 2 00:09:49 2011 @@ -0,0 +1,375 @@ +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the License); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +// $Id:$ +// +// Allows unit tests to run with a Java Security Manager +// +// Tested from Eclipse 3.7 with the CLI: +// +// -Djava.security.manager -Djava.security.policy=file:src/test/resources/java.policy +// +// Tested from Maven 3.0.3 with the Surfire 2.8.1 configuration: +// +// argLine-Djava.security.manager -Djava.security.policy=${basedir}/src/test/resources/java.policy/argLine +// +// This policy file documents why each permission is granted by listing exceptions in comments. +// +// This policy file grants permission as narrowly as possible. +// + +grant { + +// Found using Eclipse 3.7 +// java.security.AccessControlException: access denied (java.io.FilePermission C:\Users\ggregory\AppData\Local\Temp\testNames8413758989552151476.txt read) +// at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264) +// at java.security.AccessController.checkPermission(AccessController.java:427) +// at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) +// at java.lang.SecurityManager.checkRead(SecurityManager.java:871) +// at java.io.FileInputStream.init(FileInputStream.java:100) +// at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.readTestNames(RemoteTestRunner.java:336) +// at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:251) +// at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:212) +// at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) + + permission java.io.FilePermission ${java.io.tmpdir}/-, read; + + +// Found using Eclipse 3.7 +// java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:58691 connect,resolve) +// at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264) +// at java.security.AccessController.checkPermission(AccessController.java:427) +// at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) +// at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034) +// at java.net.Socket.connect(Socket.java:518) +// at java.net.Socket.connect(Socket.java:474) +// at java.net.Socket.init(Socket.java:371) +// at java.net.Socket.init(Socket.java:184) +// at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.connect(RemoteTestRunner.java:570) +// at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:381) +// at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) + + permission java.net.SocketPermission localhost, connect,resolve; + + +// All others found using Surefire 2.8.1 +// java.security.AccessControlException: access denied (java.io.FilePermission C:\svn\org\apache\commons\trunks-proper\lang\target\surefire\surefire795889196143891944tmp read) +// at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374) +// at java.security.AccessController.checkPermission(AccessController.java:546) +// at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) +// at java.lang.SecurityManager.checkRead(SecurityManager.java:871) +// at java.io.FileInputStream.init(FileInputStream.java:100) +// at org.apache.maven.surefire.booter.SystemPropertyManager.loadProperties(SystemPropertyManager.java:62
svn commit: r1164305 - /commons/proper/lang/trunk/src/test/resources/java.policy
Author: ggregory Date: Fri Sep 2 00:10:32 2011 New Revision: 1164305 URL: http://svn.apache.org/viewvc?rev=1164305view=rev Log: Test [LANG-744] StringUtils throws java.security.AccessControlException on Google App Engine. Modified: commons/proper/lang/trunk/src/test/resources/java.policy (contents, props changed) Modified: commons/proper/lang/trunk/src/test/resources/java.policy URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/resources/java.policy?rev=1164305r1=1164304r2=1164305view=diff == --- commons/proper/lang/trunk/src/test/resources/java.policy (original) +++ commons/proper/lang/trunk/src/test/resources/java.policy Fri Sep 2 00:10:32 2011 @@ -16,7 +16,7 @@ // // -// $Id:$ +// $Id$ // // Allows unit tests to run with a Java Security Manager // Propchange: commons/proper/lang/trunk/src/test/resources/java.policy -- svn:keywords = Id
svn commit: r1164306 - /commons/proper/lang/trunk/pom.xml
Author: ggregory Date: Fri Sep 2 00:11:36 2011 New Revision: 1164306 URL: http://svn.apache.org/viewvc?rev=1164306view=rev Log: Test [LANG-744] StringUtils throws java.security.AccessControlException on Google App Engine. Modified: commons/proper/lang/trunk/pom.xml Modified: commons/proper/lang/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/pom.xml?rev=1164306r1=1164305r2=1164306view=diff == --- commons/proper/lang/trunk/pom.xml (original) +++ commons/proper/lang/trunk/pom.xml Fri Sep 2 00:11:36 2011 @@ -479,6 +479,8 @@ includes include**/*Test.java/include /includes + !-- Test [LANG-744] StringUtils throws java.security.AccessControlException on Google App Engine. -- + !-- argLine-Djava.security.manager -Djava.security.policy=${basedir}/src/test/resources/java.policy/argLine -- /configuration /plugin plugin
svn commit: r1164313 - in /commons/proper/lang/trunk: checkstyle.xml pom.xml
Author: ggregory Date: Fri Sep 2 00:36:44 2011 New Revision: 1164313 URL: http://svn.apache.org/viewvc?rev=1164313view=rev Log: Update Maven plugins: Modified: commons/proper/lang/trunk/checkstyle.xml commons/proper/lang/trunk/pom.xml Modified: commons/proper/lang/trunk/checkstyle.xml URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/checkstyle.xml?rev=1164313r1=1164312r2=1164313view=diff == --- commons/proper/lang/trunk/checkstyle.xml (original) +++ commons/proper/lang/trunk/checkstyle.xml Fri Sep 2 00:36:44 2011 @@ -31,6 +31,7 @@ limitations under the License. property name=fileExtensions value=java,xml/ /module module name=TreeWalker +property name=cacheFile value=target/cachefile/ module name=AvoidStarImport/ module name=RedundantImport/ module name=UnusedImports/ Modified: commons/proper/lang/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/pom.xml?rev=1164313r1=1164312r2=1164313view=diff == --- commons/proper/lang/trunk/pom.xml (original) +++ commons/proper/lang/trunk/pom.xml Fri Sep 2 00:36:44 2011 @@ -512,7 +512,7 @@ plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-changes-plugin/artifactId - version2.4/version + version2.6/version configuration xmlPath${basedir}/src/site/changes/changes.xml/xmlPath issueLinkTemplatePerSystem @@ -533,7 +533,7 @@ /plugin plugin artifactIdmaven-checkstyle-plugin/artifactId -version2.6/version +version2.7/version configuration configLocation${basedir}/checkstyle.xml/configLocation enableRulesSummaryfalse/enableRulesSummary @@ -543,7 +543,7 @@ plugin groupIdorg.codehaus.mojo/groupId artifactIdfindbugs-maven-plugin/artifactId -version2.3.1/version +version2.3.2/version configuration thresholdNormal/threshold effortDefault/effort @@ -553,12 +553,12 @@ plugin groupIdorg.codehaus.mojo/groupId artifactIdcobertura-maven-plugin/artifactId -version2.4/version +version2.5.1/version /plugin plugin groupIdorg.codehaus.mojo/groupId artifactIdclirr-maven-plugin/artifactId -version2.2.2/version +version2.3/version configuration comparisonArtifacts comparisonArtifact @@ -572,7 +572,7 @@ /plugin plugin artifactIdmaven-pmd-plugin/artifactId -version2.3/version +version2.5/version configuration targetJdk${maven.compile.target}/targetJdk /configuration
svn commit: r1164315 - /commons/proper/lang/trunk/pom.xml
Author: ggregory Date: Fri Sep 2 00:38:40 2011 New Revision: 1164315 URL: http://svn.apache.org/viewvc?rev=1164315view=rev Log: I meant to say: Updated maven-changes-plugin 2.4 to 2.6 maven-checkstyle-plugin 2.6 to 2.7. findbugs-maven-plugin 2.3.1 to 2.3.2 cobertura-maven-plugin 2.4 to 2.5.1 clirr-maven-plugin 2.2.2 to 2.3 maven-pmd-plugin 2.3 to 2.5 Modified: commons/proper/lang/trunk/pom.xml Modified: commons/proper/lang/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/pom.xml?rev=1164315r1=1164314r2=1164315view=diff == --- commons/proper/lang/trunk/pom.xml (original) +++ commons/proper/lang/trunk/pom.xml Fri Sep 2 00:38:40 2011 @@ -50,7 +50,7 @@ urlhttp://svn.apache.org/viewvc/commons/proper/lang/trunk/url /scm -developers + developers developer nameDaniel Rall/name iddlr/id @@ -479,7 +479,7 @@ includes include**/*Test.java/include /includes - !-- Test [LANG-744] StringUtils throws java.security.AccessControlException on Google App Engine -- + !-- Test [LANG-744] StringUtils throws java.security.AccessControlException on Google App Engine. -- !-- argLine-Djava.security.manager -Djava.security.policy=${basedir}/src/test/resources/java.policy/argLine -- /configuration /plugin
svn commit: r1165229 - /commons/proper/codec/trunk/pom.xml
Author: ggregory Date: Mon Sep 5 10:18:10 2011 New Revision: 1165229 URL: http://svn.apache.org/viewvc?rev=1165229view=rev Log: Update junit to 4.9 from 4.8.2. Modified: commons/proper/codec/trunk/pom.xml Modified: commons/proper/codec/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/pom.xml?rev=1165229r1=1165228r2=1165229view=diff == --- commons/proper/codec/trunk/pom.xml (original) +++ commons/proper/codec/trunk/pom.xml Mon Sep 5 10:18:10 2011 @@ -193,7 +193,7 @@ limitations under the License. dependency groupIdjunit/groupId artifactIdjunit/artifactId - version4.8.2/version + version4.9/version scopetest/scope /dependency /dependencies
svn commit: r1165436 - /commons/proper/lang/trunk/pom.xml
Author: ggregory Date: Mon Sep 5 22:15:18 2011 New Revision: 1165436 URL: http://svn.apache.org/viewvc?rev=1165436view=rev Log: Use 2 spaces per indent instead of 4 for formatting and remove trailing spaces. Modified: commons/proper/lang/trunk/pom.xml Modified: commons/proper/lang/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/pom.xml?rev=1165436r1=1165435r2=1165436view=diff == --- commons/proper/lang/trunk/pom.xml (original) +++ commons/proper/lang/trunk/pom.xml Mon Sep 5 22:15:18 2011 @@ -15,10 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. -- -project -xmlns=http://maven.apache.org/POM/4.0.0; -xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; -xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; +project + xmlns=http://maven.apache.org/POM/4.0.0; + xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; parent groupIdorg.apache.commons/groupId artifactIdcommons-parent/artifactId @@ -31,7 +31,7 @@ nameCommons Lang/name inceptionYear2001/inceptionYear -description + description Commons Lang, a package of Java utility classes for the classes that are in java.lang's hierarchy, or are considered to be so standard as to justify existence in java.lang. @@ -50,388 +50,388 @@ urlhttp://svn.apache.org/viewvc/commons/proper/lang/trunk/url /scm - developers -developer -nameDaniel Rall/name -iddlr/id -emaild...@finemaltcoding.com/email -organizationCollabNet, Inc./organization -roles -roleJava Developer/role -/roles -/developer -developer -nameStephen Colebourne/name -idscolebourne/id -emailscolebou...@joda.org/email -organizationSITA ATS Ltd/organization -timezone0/timezone -roles -roleJava Developer/role -/roles -/developer -developer -nameHenri Yandell/name -idbayard/id -emailbay...@apache.org/email -organization/ -roles -roleJava Developer/role -/roles -/developer -developer -nameSteven Caswell/name -idscaswell/id -emailstevencasw...@apache.org/email -organization/ -roles -roleJava Developer/role -/roles -timezone-5/timezone -/developer -developer -nameRobert Burrell Donkin/name -idrdonkin/id -emailrdon...@apache.org/email -organization/ -roles -roleJava Developer/role -/roles -/developer -developer -nameGary D. Gregory/name -idggregory/id -emailggreg...@seagullsw.com/email -organizationSeagull Software/organization -timezone-8/timezone -roles -roleJava Developer/role -/roles -/developer -developer -namePhil Steitz/name -idpsteitz/id -organization/ -roles -roleJava Developer/role -/roles -/developer -developer -nameFredrik Westermarck/name -idfredrik/id -email/ -organization/ -roles -roleJava Developer/role -/roles -/developer -developer -nameJames Carman/name -idjcarman/id -emailjcar...@apache.org/email -organizationCarman Consulting, Inc./organization -roles -roleJava Developer/role -/roles -/developer -developer -nameNiall Pemberton/name -idniallp/id -roles -roleJava Developer/role -/roles -/developer -developer -nameMatt Benson/name -idmbenson/id -roles -roleJava Developer/role -/roles -/developer -developer -nameJoerg Schaible/name -idjoehni/id -emailjoerg.schai...@gmx.de/email -roles -roleJava Developer/role -/roles -timezone+1/timezone -/developer -developer - nameOliver Heger/name - idoheger/id - emailohe...@apache.org/email - timezone+1/timezone - roles -roleJava Developer/role - /roles -/developer -developer
svn commit: r1165437 - /commons/proper/lang/trunk/pom.xml
Author: ggregory Date: Mon Sep 5 22:20:44 2011 New Revision: 1165437 URL: http://svn.apache.org/viewvc?rev=1165437view=rev Log: Running lang under a security manager and LANG-744. Modified: commons/proper/lang/trunk/pom.xml Modified: commons/proper/lang/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/pom.xml?rev=1165437r1=1165436r2=1165437view=diff == --- commons/proper/lang/trunk/pom.xml (original) +++ commons/proper/lang/trunk/pom.xml Mon Sep 5 22:20:44 2011 @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. -- -project +project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; @@ -32,10 +32,10 @@ project inceptionYear2001/inceptionYear description -Commons Lang, a package of Java utility classes for the -classes that are in java.lang's hierarchy, or are considered to be so -standard as to justify existence in java.lang. -/description + Commons Lang, a package of Java utility classes for the + classes that are in java.lang's hierarchy, or are considered to be so + standard as to justify existence in java.lang. +/description urlhttp://commons.apache.org/lang//url @@ -475,13 +475,27 @@ project plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-surefire-plugin/artifactId -configuration - includes -include**/*Test.java/include - /includes - !-- Test [LANG-744] StringUtils throws java.security.AccessControlException on Google App Engine. -- - !-- argLine-Djava.security.manager -Djava.security.policy=${basedir}/src/test/resources/java.policy/argLine -- -/configuration +executions + execution +idplain/id +configuration + includes +include**/*Test.java/include + /includes +/configuration + /execution + !-- + execution +idsecurity-manager/id +configuration + includes +include**/*Test.java/include + /includes + argLine-Djava.security.manager -Djava.security.policy=${basedir}/src/test/resources/java.policy/argLine +/configuration + /execution + -- +/executions /plugin plugin artifactIdmaven-assembly-plugin/artifactId
svn commit: r1165644 - /commons/proper/lang/trunk/pom.xml
Author: ggregory Date: Tue Sep 6 12:46:17 2011 New Revision: 1165644 URL: http://svn.apache.org/viewvc?rev=1165644view=rev Log: Recast security manager test as an integration test (commented out.) Modified: commons/proper/lang/trunk/pom.xml Modified: commons/proper/lang/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/pom.xml?rev=1165644r1=1165643r2=1165644view=diff == --- commons/proper/lang/trunk/pom.xml (original) +++ commons/proper/lang/trunk/pom.xml Tue Sep 6 12:46:17 2011 @@ -486,15 +486,19 @@ /execution !-- execution -idsecurity-manager/id +idsecurity-manager-test/id +phaseintegration-test/phase +goals + goaltest/goal +/goals configuration includes include**/*Test.java/include - /includes + /includes argLine-Djava.security.manager -Djava.security.policy=${basedir}/src/test/resources/java.policy/argLine /configuration /execution - -- + -- /executions /plugin plugin
svn commit: r1165967 - in /commons/proper/io/trunk: checkstyle.xml pom.xml
Author: ggregory Date: Wed Sep 7 02:42:18 2011 New Revision: 1165967 URL: http://svn.apache.org/viewvc?rev=1165967view=rev Log: Update plugins: cobertura-maven-plugin 2.5.1 from 2.4 maven-checkstyle-plugin 2.7 from 2.6 findbugs-maven-plugin 2.3.2 from 2.3.1 Modified: commons/proper/io/trunk/checkstyle.xml commons/proper/io/trunk/pom.xml Modified: commons/proper/io/trunk/checkstyle.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/checkstyle.xml?rev=1165967r1=1165966r2=1165967view=diff == --- commons/proper/io/trunk/checkstyle.xml (original) +++ commons/proper/io/trunk/checkstyle.xml Wed Sep 7 02:42:18 2011 @@ -31,6 +31,7 @@ limitations under the License. property name=fileExtensions value=java,xml/ /module module name=TreeWalker +property name=cacheFile value=target/cachefile/ module name=AvoidStarImport/ module name=RedundantImport/ module name=UnusedImports/ Modified: commons/proper/io/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/pom.xml?rev=1165967r1=1165966r2=1165967view=diff == --- commons/proper/io/trunk/pom.xml (original) +++ commons/proper/io/trunk/pom.xml Wed Sep 7 02:42:18 2011 @@ -258,12 +258,12 @@ plugin groupIdorg.codehaus.mojo/groupId artifactIdcobertura-maven-plugin/artifactId -version2.4/version +version2.5.1/version /plugin plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-checkstyle-plugin/artifactId -version2.6/version +version2.7/version configuration configLocation${basedir}/checkstyle.xml/configLocation enableRulesSummaryfalse/enableRulesSummary @@ -281,7 +281,7 @@ plugin groupIdorg.codehaus.mojo/groupId artifactIdfindbugs-maven-plugin/artifactId -version2.3.1/version +version2.3.2/version configuration thresholdNormal/threshold effortDefault/effort
svn commit: r1165970 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
Author: ggregory Date: Wed Sep 7 02:47:43 2011 New Revision: 1165970 URL: http://svn.apache.org/viewvc?rev=1165970view=rev Log: Remove assert because the iterator always deals Strings. Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java?rev=1165970r1=1165969r2=1165970view=diff == --- commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java (original) +++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java Wed Sep 7 02:47:43 2011 @@ -174,7 +174,6 @@ public class LineIteratorTestCase extend try { int count = 0; while (iterator.hasNext()) { -assertTrue(iterator.next() instanceof String); count++; } assertEquals(3, count);
svn commit: r1165983 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
Author: ggregory Date: Wed Sep 7 03:03:06 2011 New Revision: 1165983 URL: http://svn.apache.org/viewvc?rev=1165983view=rev Log: Iterator always deals Strings (FindBugs). Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java?rev=1165983r1=1165982r2=1165983view=diff == --- commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java (original) +++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java Wed Sep 7 03:03:06 2011 @@ -174,6 +174,7 @@ public class LineIteratorTestCase extend try { int count = 0; while (iterator.hasNext()) { +assertNotNull(iterator.next()); count++; } assertEquals(3, count);
svn commit: r1165984 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
Author: ggregory Date: Wed Sep 7 03:03:42 2011 New Revision: 1165984 URL: http://svn.apache.org/viewvc?rev=1165984view=rev Log: Iterator always deals Strings (FindBugs). Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java?rev=1165984r1=1165983r2=1165984view=diff == --- commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java (original) +++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java Wed Sep 7 03:03:42 2011 @@ -291,7 +291,7 @@ public class LineIteratorTestCase extend LineIterator iterator = FileUtils.lineIterator(testFile, encoding); try { // get -assertTrue(Line expected, iterator.next() instanceof String); +assertNotNull(Line expected, iterator.next()); assertTrue(More expected, iterator.hasNext()); // close
svn commit: r1166220 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java
Author: ggregory Date: Wed Sep 7 15:18:06 2011 New Revision: 1166220 URL: http://svn.apache.org/viewvc?rev=1166220view=rev Log: Convert to JUnit 4 from 3. Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java?rev=1166220r1=1166219r2=1166220view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java Wed Sep 7 15:18:06 2011 @@ -16,23 +16,32 @@ */ package org.apache.commons.lang3.reflect; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.lang.reflect.Method; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import junit.framework.TestCase; - import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.mutable.Mutable; import org.apache.commons.lang3.mutable.MutableObject; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; /** * Unit tests MethodUtils * @version $Id$ */ -public class MethodUtilsTest extends TestCase { +public class MethodUtilsTest { private static interface PrivateInterface {} @@ -96,6 +105,10 @@ public class MethodUtilsTest extends Tes public String foo(Object o) { return foo(Object); } + +public void oneParameter(String s) { +// empty +} } private static class TestMutable implements MutableObject { @@ -108,24 +121,20 @@ public class MethodUtilsTest extends Tes } private TestBean testBean; -private MapClass?, Class?[] classCache; - -public MethodUtilsTest(String name) { -super(name); -classCache = new HashMapClass?, Class?[](); -} +private MapClass?, Class?[] classCache = new HashMapClass?, Class?[](); -@Override -protected void setUp() throws Exception { -super.setUp(); +@Before +public void setUp() throws Exception { testBean = new TestBean(); classCache.clear(); } +@Test public void testConstructor() throws Exception { assertNotNull(MethodUtils.class.newInstance()); } +@Test public void testInvokeMethod() throws Exception { assertEquals(foo(), MethodUtils.invokeMethod(testBean, foo, (Object[]) ArrayUtils.EMPTY_CLASS_ARRAY)); @@ -149,6 +158,7 @@ public class MethodUtilsTest extends Tes NumberUtils.DOUBLE_ONE)); } +@Test public void testInvokeExactMethod() throws Exception { assertEquals(foo(), MethodUtils.invokeExactMethod(testBean, foo, (Object[]) ArrayUtils.EMPTY_CLASS_ARRAY)); @@ -185,6 +195,12 @@ public class MethodUtilsTest extends Tes } } +@Test +public void testInvokeExactMethodNoParam() throws Exception { +assertEquals(foo(), MethodUtils.invokeExactMethod(testBean, foo)); +} + +@Test public void testInvokeStaticMethod() throws Exception { assertEquals(bar(), MethodUtils.invokeStaticMethod(TestBean.class, bar, (Object[]) ArrayUtils.EMPTY_CLASS_ARRAY)); @@ -214,6 +230,7 @@ public class MethodUtilsTest extends Tes } } +@Test public void testInvokeExactStaticMethod() throws Exception { assertEquals(bar(), MethodUtils.invokeExactStaticMethod(TestBean.class, bar, (Object[]) ArrayUtils.EMPTY_CLASS_ARRAY)); @@ -251,8 +268,8 @@ public class MethodUtilsTest extends Tes } } +@Test public void testGetAccessibleInterfaceMethod() throws Exception { - Class?[][] p = { ArrayUtils.EMPTY_CLASS_ARRAY, null }; for (Class?[] element : p) { Method method = TestMutable.class.getMethod(getValue, element); @@ -262,6 +279,7 @@ public class MethodUtilsTest extends Tes } } +@Test public void testGetAccessibleMethodPrivateInterface() throws Exception { Method expected = TestBeanWithInterfaces.class.getMethod(foo); assertNotNull(expected); @@ -269,6 +287,7 @@ public class MethodUtilsTest extends Tes assertNull(actual); } +@Test public void testGetAccessibleInterfaceMethodFromDescription() throws Exception
svn commit: r1166221 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java
Author: ggregory Date: Wed Sep 7 15:18:43 2011 New Revision: 1166221 URL: http://svn.apache.org/viewvc?rev=1166221view=rev Log: Convert to JUnit 4 from 3. Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java?rev=1166221r1=1166220r2=1166221view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java Wed Sep 7 15:18:43 2011 @@ -197,7 +197,7 @@ public class MethodUtilsTest { @Test public void testInvokeExactMethodNoParam() throws Exception { -assertEquals(foo(), MethodUtils.invokeExactMethod(testBean, foo)); +//assertEquals(foo(), MethodUtils.invokeExactMethod(testBean, foo)); } @Test
svn commit: r1166233 - in /commons/proper/lang/trunk/src: main/java/org/apache/commons/lang3/reflect/MethodUtils.java site/changes/changes.xml test/java/org/apache/commons/lang3/reflect/MethodUtilsTes
Author: ggregory Date: Wed Sep 7 15:39:45 2011 New Revision: 1166233 URL: http://svn.apache.org/viewvc?rev=1166233view=rev Log: [LANG-750] Add MethodUtil APIs to call methods without parameters. Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java commons/proper/lang/trunk/src/site/changes/changes.xml commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java?rev=1166233r1=1166232r2=1166233view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java Wed Sep 7 15:39:45 2011 @@ -59,6 +59,33 @@ public class MethodUtils { } /** + * pInvokes a named method without parameters./p + * + * pThis method delegates the method search to {@link #getMatchingAccessibleMethod(Class, String, Class[])}./p + * + * pThis method supports calls to methods taking primitive parameters + * via passing in wrapping classes. So, for example, a codeBoolean/code object + * would match a codeboolean/code primitive./p + * + * pThis is a convenient wrapper for + * {@link #invokeMethod(Object object,String methodName, Object[] args, Class[] parameterTypes)}. + * /p + * + * @param object invoke method on this object + * @param methodName get method with this name + * @return The value returned by the invoked method + * + * @throws NoSuchMethodException if there is no such accessible method + * @throws InvocationTargetException wraps an exception thrown by the method invoked + * @throws IllegalAccessException if the requested method is not accessible via reflection + * @since 3.0.2 + */ +public static Object invokeMethod(Object object, String methodName) throws NoSuchMethodException, +IllegalAccessException, InvocationTargetException { +return invokeMethod(object, methodName, ArrayUtils.EMPTY_OBJECT_ARRAY); +} + +/** * pInvokes a named method whose parameter type matches the object type./p * * pThis method delegates the method search to {@link #getMatchingAccessibleMethod(Class, String, Class[])}./p @@ -134,6 +161,28 @@ public class MethodUtils { } /** + * pInvokes a method without parameters./p + * + * pThis uses reflection to invoke the method obtained from a call to + * codegetAccessibleMethod()/code./p + * + * @param object invoke method on this object + * @param methodName get method with this name + * @return The value returned by the invoked method + * + * @throws NoSuchMethodException if there is no such accessible method + * @throws InvocationTargetException wraps an exception thrown by the + * method invoked + * @throws IllegalAccessException if the requested method is not accessible + * via reflection + * @since 3.0.2 + */ +public static Object invokeExactMethod(Object object, String methodName) throws NoSuchMethodException, +IllegalAccessException, InvocationTargetException { +return invokeExactMethod(object, methodName, ArrayUtils.EMPTY_OBJECT_ARRAY); +} + +/** * pInvokes a method whose parameter types match exactly the object * types./p * @@ -242,6 +291,35 @@ public class MethodUtils { } /** + * pInvokes a named static method without parameters./p + * + * pThis method delegates the method search to {@link #getMatchingAccessibleMethod(Class, String, Class[])}./p + * + * pThis method supports calls to methods taking primitive parameters + * via passing in wrapping classes. So, for example, a codeBoolean/code class + * would match a codeboolean/code primitive./p + * + * pThis is a convenient wrapper for + * {@link #invokeStaticMethod(Class objectClass,String methodName,Object [] args,Class[] parameterTypes)}. + * /p + * + * @param cls invoke static method on this class + * @param methodName get method with this name + * @return The value returned by the invoked method + * + * @throws NoSuchMethodException if there is no such accessible method + * @throws InvocationTargetException wraps an exception thrown by the + * method invoked + * @throws IllegalAccessException if the requested method is not accessible + * via reflection + * @since 3.0.2 + */ +public static Object invokeStaticMethod(Class? cls, String methodName) throws NoSuchMethodException, +IllegalAccessException
svn commit: r1166237 - /commons/proper/io/trunk/src/changes/changes.xml
Author: ggregory Date: Wed Sep 7 15:49:24 2011 New Revision: 1166237 URL: http://svn.apache.org/viewvc?rev=1166237view=rev Log: [IO-284] Add IOUtils API toString for URL and URI to get contents Modified: commons/proper/io/trunk/src/changes/changes.xml Modified: commons/proper/io/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1166237r1=1166236r2=1166237view=diff == --- commons/proper/io/trunk/src/changes/changes.xml (original) +++ commons/proper/io/trunk/src/changes/changes.xml Wed Sep 7 15:49:24 2011 @@ -40,6 +40,9 @@ The action type attribute can be add,u body release version=2.1 date=Not yet released + action dev=ggregory type=add issue=IO-284 due-to=ggregory +Add IOUtils API toString for URL and URI to get contents + /action action dev=sebb type=fix issue=IO-280 due-to=sebb Dubious use of mkdirs() return code /action
svn commit: r1166243 - /commons/proper/commons-parent/trunk/pom.xml
Author: ggregory Date: Wed Sep 7 15:59:19 2011 New Revision: 1166243 URL: http://svn.apache.org/viewvc?rev=1166243view=rev Log: Remove maven-idea-plugin (bye, bye warnings on every single commons build.) Modified: commons/proper/commons-parent/trunk/pom.xml Modified: commons/proper/commons-parent/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/commons-parent/trunk/pom.xml?rev=1166243r1=1166242r2=1166243view=diff == --- commons/proper/commons-parent/trunk/pom.xml (original) +++ commons/proper/commons-parent/trunk/pom.xml Wed Sep 7 15:59:19 2011 @@ -333,17 +333,6 @@ /plugin plugin groupIdorg.apache.maven.plugins/groupId -artifactIdmaven-idea-plugin/artifactId -!-- - | N.B. The version is deliberately not provided - see COMMONSSITE-56 - | This may result in some warnings, e.g. from the Maven 2 Eclipse plugin. - -- -configuration - jdkLevel${maven.compile.source}/jdkLevel -/configuration - /plugin - plugin -groupIdorg.apache.maven.plugins/groupId artifactIdmaven-surefire-plugin/artifactId configuration jvm${commons.surefire.java}/jvm
svn commit: r1166253 - in /commons/proper/lang/trunk/src: main/java/org/apache/commons/lang3/reflect/MethodUtils.java site/changes/changes.xml test/java/org/apache/commons/lang3/reflect/MethodUtilsTes
Author: ggregory Date: Wed Sep 7 16:27:42 2011 New Revision: 1166253 URL: http://svn.apache.org/viewvc?rev=1166253view=rev Log: Revert changes from r1166233: [LANG-750] Add MethodUtil APIs to call methods without parameters. Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java commons/proper/lang/trunk/src/site/changes/changes.xml commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/MethodUtilsTest.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java?rev=1166253r1=1166252r2=1166253view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java Wed Sep 7 16:27:42 2011 @@ -59,33 +59,6 @@ public class MethodUtils { } /** - * pInvokes a named method without parameters./p - * - * pThis method delegates the method search to {@link #getMatchingAccessibleMethod(Class, String, Class[])}./p - * - * pThis method supports calls to methods taking primitive parameters - * via passing in wrapping classes. So, for example, a codeBoolean/code object - * would match a codeboolean/code primitive./p - * - * pThis is a convenient wrapper for - * {@link #invokeMethod(Object object,String methodName, Object[] args, Class[] parameterTypes)}. - * /p - * - * @param object invoke method on this object - * @param methodName get method with this name - * @return The value returned by the invoked method - * - * @throws NoSuchMethodException if there is no such accessible method - * @throws InvocationTargetException wraps an exception thrown by the method invoked - * @throws IllegalAccessException if the requested method is not accessible via reflection - * @since 3.0.2 - */ -public static Object invokeMethod(Object object, String methodName) throws NoSuchMethodException, -IllegalAccessException, InvocationTargetException { -return invokeMethod(object, methodName, ArrayUtils.EMPTY_OBJECT_ARRAY); -} - -/** * pInvokes a named method whose parameter type matches the object type./p * * pThis method delegates the method search to {@link #getMatchingAccessibleMethod(Class, String, Class[])}./p @@ -161,28 +134,6 @@ public class MethodUtils { } /** - * pInvokes a method without parameters./p - * - * pThis uses reflection to invoke the method obtained from a call to - * codegetAccessibleMethod()/code./p - * - * @param object invoke method on this object - * @param methodName get method with this name - * @return The value returned by the invoked method - * - * @throws NoSuchMethodException if there is no such accessible method - * @throws InvocationTargetException wraps an exception thrown by the - * method invoked - * @throws IllegalAccessException if the requested method is not accessible - * via reflection - * @since 3.0.2 - */ -public static Object invokeExactMethod(Object object, String methodName) throws NoSuchMethodException, -IllegalAccessException, InvocationTargetException { -return invokeExactMethod(object, methodName, ArrayUtils.EMPTY_OBJECT_ARRAY); -} - -/** * pInvokes a method whose parameter types match exactly the object * types./p * @@ -291,35 +242,6 @@ public class MethodUtils { } /** - * pInvokes a named static method without parameters./p - * - * pThis method delegates the method search to {@link #getMatchingAccessibleMethod(Class, String, Class[])}./p - * - * pThis method supports calls to methods taking primitive parameters - * via passing in wrapping classes. So, for example, a codeBoolean/code class - * would match a codeboolean/code primitive./p - * - * pThis is a convenient wrapper for - * {@link #invokeStaticMethod(Class objectClass,String methodName,Object [] args,Class[] parameterTypes)}. - * /p - * - * @param cls invoke static method on this class - * @param methodName get method with this name - * @return The value returned by the invoked method - * - * @throws NoSuchMethodException if there is no such accessible method - * @throws InvocationTargetException wraps an exception thrown by the - * method invoked - * @throws IllegalAccessException if the requested method is not accessible - * via reflection - * @since 3.0.2 - */ -public static Object invokeStaticMethod(Class? cls, String methodName) throws NoSuchMethodException
svn commit: r1166371 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java
Author: ggregory Date: Wed Sep 7 20:09:25 2011 New Revision: 1166371 URL: http://svn.apache.org/viewvc?rev=1166371view=rev Log: Remove dead space. Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java?rev=1166371r1=1166370r2=1166371view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ClassUtils.java Wed Sep 7 20:09:25 2011 @@ -855,7 +855,7 @@ public class ClassUtils { public static Class? getClass(String className, boolean initialize) throws ClassNotFoundException { ClassLoader contextCL = Thread.currentThread().getContextClassLoader(); ClassLoader loader = contextCL == null ? ClassUtils.class.getClassLoader() : contextCL; -return getClass(loader, className, initialize ); +return getClass(loader, className, initialize); } // Public method
svn commit: r1166685 - in /commons/proper/lang/trunk/src: main/java/org/apache/commons/lang3/Validate.java site/changes/changes.xml test/java/org/apache/commons/lang3/ValidateTest.java
Author: ggregory Date: Thu Sep 8 13:41:05 2011 New Revision: 1166685 URL: http://svn.apache.org/viewvc?rev=1166685view=rev Log: [LANG-751] Include the actual type in the Validate.isInstance and isAssignableFrom exception messages. Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Validate.java commons/proper/lang/trunk/src/site/changes/changes.xml commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ValidateTest.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Validate.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Validate.java?rev=1166685r1=1166684r2=1166685view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Validate.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Validate.java Thu Sep 8 13:41:05 2011 @@ -69,9 +69,8 @@ public class Validate { private static final String DEFAULT_VALID_INDEX_COLLECTION_EX_MESSAGE = The validated collection index is invalid: %d; private static final String DEFAULT_VALID_STATE_EX_MESSAGE = The validated state is false; -private static final String DEFAULT_IS_ASSIGNABLE_EX_MESSAGE = -The validated class can not be converted to the %s class; -private static final String DEFAULT_IS_INSTANCE_OF_EX_MESSAGE = The validated object is not an instance of %s; +private static final String DEFAULT_IS_ASSIGNABLE_EX_MESSAGE = Cannot assign a %s to a %s; +private static final String DEFAULT_IS_INSTANCE_OF_EX_MESSAGE = Expected type: %s, actual: %s; /** * Constructor. This class should not normally be instantiated. @@ -975,14 +974,13 @@ public class Validate { //- /** - * pValidate that the argument is an instance of the specified class; otherwise - * throwing an exception. This method is useful when validating according to an arbitrary - * class/p + * Validates that the argument is an instance of the specified class, if not throws an exception. + * + * pThis method is useful when validating according to an arbitrary class/p * * preValidate.isInstanceOf(OkClass.class, object);/pre * - * pThe message of the exception is quot;The validated object is not an instance ofquot; - * followed by the name of the class/p + * pThe message of the exception is quot;Expected type: {type}, actual: {obj_type}quot;/p * * @param type the class the object must be validated against, not null * @param obj the object to check, null throws an exception @@ -993,7 +991,8 @@ public class Validate { */ public static void isInstanceOf(Class? type, Object obj) { if (type.isInstance(obj) == false) { -throw new IllegalArgumentException(String.format(DEFAULT_IS_INSTANCE_OF_EX_MESSAGE, type.getName())); +throw new IllegalArgumentException(String.format(DEFAULT_IS_INSTANCE_OF_EX_MESSAGE, type.getName(), +obj == null ? null : obj.getClass().getName())); } } @@ -1024,32 +1023,32 @@ public class Validate { //- /** - * pValidate that the argument can be converted to the specified class; otherwise - * throwing an exception with the specified message. This method is useful when - * validating if there will be no casting errors./p + * Validates that the argument can be converted to the specified class, if not, throws an exception. + * + * pThis method is useful when validating that there will be no casting errors./p * * preValidate.isAssignableFrom(SuperClass.class, object.getClass());/pre * - * pThe message of the exception is quot;The validated object can not be converted to thequot; - * followed by the name of the class and quot;classquot;/p + * pThe message format of the exception is quot;Cannot assign {type} to {superType}quot;/p * * @param superType the class the class must be validated against, not null * @param type the class to check, not null - * @throws IllegalArgumentException if argument can not be converted to the specified class + * @throws IllegalArgumentException if type argument is not assignable to the specified superType * @see #isAssignableFrom(Class, Class, String, Object...) * * @since 3.0 */ public static void isAssignableFrom(Class? superType, Class? type) { if (superType.isAssignableFrom(type) == false) { -throw new IllegalArgumentException(String.format(DEFAULT_IS_ASSIGNABLE_EX_MESSAGE, superType.getName())); +throw new IllegalArgumentException
svn commit: r1169516 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReaderInputStreamTest.java
Author: ggregory Date: Sun Sep 11 20:00:19 2011 New Revision: 1169516 URL: http://svn.apache.org/viewvc?rev=1169516view=rev Log: Organize imports. Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReaderInputStreamTest.java Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReaderInputStreamTest.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReaderInputStreamTest.java?rev=1169516r1=1169515r2=1169516view=diff == --- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReaderInputStreamTest.java (original) +++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReaderInputStreamTest.java Sun Sep 11 20:00:19 2011 @@ -25,7 +25,6 @@ import java.io.StringReader; import java.nio.charset.Charset; import java.util.Random; -import org.junit.Ignore; import org.junit.Test; public class ReaderInputStreamTest {
svn commit: r1169520 - in /commons/proper/io/trunk/src/test/java/org/apache/commons/io: ./ filefilter/ input/ output/ testtools/
Author: ggregory Date: Sun Sep 11 20:09:47 2011 New Revision: 1169520 URL: http://svn.apache.org/viewvc?rev=1169520view=rev Log: Convert to Java 5 enhanced for loops. Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/DemuxTestCase.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/EndianUtilsTest.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsWildcardTestCase.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/ConditionalFileFilterAbstractTestCase.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/AutoCloseInputStreamTest.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReaderInputStreamTest.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ByteArrayOutputStreamTestCase.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/testtools/FileBasedTestCase.java Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/DemuxTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/DemuxTestCase.java?rev=1169520r1=1169519r2=1169520view=diff == --- commons/proper/io/trunk/src/test/java/org/apache/commons/io/DemuxTestCase.java (original) +++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/DemuxTestCase.java Sun Sep 11 20:09:47 2011 @@ -223,12 +223,11 @@ public class DemuxTestCase public void run() { m_demux.bindStream( m_output ); -for( int i = 0; i m_data.length; i++ ) -{ +for (byte element : m_data) { try { //System.out.println( Writing: + (char)m_data[ i ] ); -m_demux.write( m_data[ i ] ); +m_demux.write( element ); int sleepTime = Math.abs( c_random.nextInt() % 10 ); Thread.sleep( sleepTime ); } Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java?rev=1169520r1=1169519r2=1169520view=diff == --- commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java (original) +++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java Sun Sep 11 20:09:47 2011 @@ -21,7 +21,6 @@ import java.io.FileFilter; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; -import java.util.Iterator; import java.util.List; import junit.framework.Assert; @@ -246,8 +245,7 @@ public class DirectoryWalkerTestCase ext */ private ListFile directoriesOnly(CollectionFile results) { ListFile list = new ArrayListFile(results.size()); -for (IteratorFile it = results.iterator(); it.hasNext(); ) { -File file = it.next(); +for (File file : results) { if (file.isDirectory()) { list.add(file); } @@ -260,8 +258,7 @@ public class DirectoryWalkerTestCase ext */ private ListFile filesOnly(CollectionFile results) { ListFile list = new ArrayListFile(results.size()); -for (IteratorFile it = results.iterator(); it.hasNext(); ) { -File file = it.next(); +for (File file : results) { if (file.isFile()) { list.add(file); } Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/EndianUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/EndianUtilsTest.java?rev=1169520r1=1169519r2=1169520view=diff == --- commons/proper/io/trunk/src/test/java/org/apache/commons/io/EndianUtilsTest.java (original) +++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/EndianUtilsTest.java Sun Sep 11 20:09:47 2011 @@ -262,20 +262,20 @@ public class EndianUtilsTest extends Tes public void testSymmetryOfLong() { double[] tests = new double[] {34.345, -345.5645, 545.12, 10.043, 7.123456789123}; -for (int i = 0; i tests.length ;i++) { +for (double test : tests) { // testing the real problem
svn commit: r1169521 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/compare/FixedOrderComparator.java
Author: ggregory Date: Sun Sep 11 20:10:58 2011 New Revision: 1169521 URL: http://svn.apache.org/viewvc?rev=1169521view=rev Log: Convert to Java 5 enhanced for loops. Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/compare/FixedOrderComparator.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/compare/FixedOrderComparator.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/compare/FixedOrderComparator.java?rev=1169521r1=1169520r2=1169521view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/compare/FixedOrderComparator.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/compare/FixedOrderComparator.java Sun Sep 11 20:10:58 2011 @@ -88,8 +88,8 @@ public class FixedOrderComparatorT imp if (items == null) { throw new IllegalArgumentException(The list of items must not be null); } -for (int i = 0; i items.length; i++) { -add(items[i]); +for (T item : items) { +add(item); } }
svn commit: r1169528 - /commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java
Author: ggregory Date: Sun Sep 11 20:43:42 2011 New Revision: 1169528 URL: http://svn.apache.org/viewvc?rev=1169528view=rev Log: Use FileUtils.ONE_KB instead of 1024 magic number. Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java?rev=1169528r1=1169527r2=1169528view=diff == --- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java (original) +++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java Sun Sep 11 20:43:42 2011 @@ -267,7 +267,7 @@ public class FileSystemUtils { } switch (os) { case WINDOWS: -return (kb ? freeSpaceWindows(path, timeout) / 1024 : freeSpaceWindows(path, timeout)); +return (kb ? freeSpaceWindows(path, timeout) / FileUtils.ONE_KB : freeSpaceWindows(path, timeout)); case UNIX: return freeSpaceUnix(path, kb, false, timeout); case POSIX_UNIX:
svn commit: r1169535 - /commons/proper/io/trunk/src/changes/changes.xml
Author: ggregory Date: Sun Sep 11 20:59:06 2011 New Revision: 1169535 URL: http://svn.apache.org/viewvc?rev=1169535view=rev Log: Sync up release notes from JIRA for 2.1. Modified: commons/proper/io/trunk/src/changes/changes.xml Modified: commons/proper/io/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1169535r1=1169534r2=1169535view=diff == --- commons/proper/io/trunk/src/changes/changes.xml (original) +++ commons/proper/io/trunk/src/changes/changes.xml Sun Sep 11 20:59:06 2011 @@ -43,11 +43,32 @@ The action type attribute can be add,u action dev=ggregory type=add issue=IO-284 due-to=ggregory Add IOUtils API toString for URL and URI to get contents /action + action dev=ggregory type=add issue=IO-282 due-to=ggregory +Add API FileUtils.copyFile(File input, OutputStream output) + /action action dev=sebb type=fix issue=IO-280 due-to=sebb Dubious use of mkdirs() return code /action - action dev=ggregory type=add issue=IO-282 due-to=ggregory -Add API FileUtils.copyFile(File input, OutputStream output) + action type=fix issue=IO-277 +ReaderInputStream enters infinite loop when it encounters an unmappable character + /action + action type=fix issue=IO-264 +FileUtils.moveFile() JavaDoc should specify FileExistsException thrown + /action + action type=add issue=IO-262 +FileAlterationObserver has no getter for FileFilter + /action + action type=add issue=IO-261 +Add FileUtils.getFile API with varargs parameter + /action + action type=fix issue=IO-260 +ClassLoaderObjectInputStream does not handle Proxy classes + /action + action type=update issue=IO-259 +FileAlterationMonitor.stop(boolean allowIntervalToFinish) + /action + action type=add issue=IO-182 +Add new APPEND parameter for writing string into files /action !-- TODO check where these fixes really belong -- @@ -55,28 +76,34 @@ The action type attribute can be add,u Tailer returning partial lines when reaching EOF before EOL /action action dev=sebb type=fix issue=IO-266 due-to=Igor Smereka -FileUtils.copyFile() throws IOException when copying large files to a shared directory - /action - action dev=sebb type=add issue=IO-251 due-to=Marco Albini -Add new read method toByteArray to handle InputStream with known size. +FileUtils.copyFile() throws IOException when copying large files to a shared directory (on Windows) /action action dev=sebb type=fix issue=IO-263 due-to=Gil Adam FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files. Improve coverage by also looking for hidden files. /action + action dev=sebb type=add issue=IO-251 due-to=Marco Albini +Add new read method toByteArray to handle InputStream with known size. + /action /release release version=2.0.1 date=2010-Dec-26 -!-- TODO which fixes were part of 2.0.1? -- + action type=update +TODO: Convert RELEASE-NOTES.txt from 2.0.1? + /action /release release version=2.0 date=2010-Oct-18 -!-- TODO which fixes were part of 2.0? -- + action type=update +TODO: Convert RELEASE-NOTES.txt from 2.0? + /action /release release version=1.4 date=2008-Jan-21 -!-- TODO which fixes were part of 1.4? -- + action type=update +TODO: Convert RELEASE-NOTES.txt from 1.4? + /action /release release version=1.3.2 date=2007-Jul-02
svn commit: r1169536 - /commons/proper/io/trunk/pom.xml
Author: ggregory Date: Sun Sep 11 20:59:37 2011 New Revision: 1169536 URL: http://svn.apache.org/viewvc?rev=1169536view=rev Log: Generate HTML report from changes.xml. Modified: commons/proper/io/trunk/pom.xml Modified: commons/proper/io/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/pom.xml?rev=1169536r1=1169535r2=1169536view=diff == --- commons/proper/io/trunk/pom.xml (original) +++ commons/proper/io/trunk/pom.xml Sun Sep 11 20:59:37 2011 @@ -288,6 +288,24 @@ excludeFilterFile${basedir}/findbugs-exclude-filter.xml/excludeFilterFile /configuration /plugin + plugin +groupIdorg.apache.maven.plugins/groupId +artifactIdmaven-changes-plugin/artifactId +version2.6/version +configuration + xmlPath${basedir}/src/changes/changes.xml/xmlPath + issueLinkTemplate%URL%/%ISSUE%/issueLinkTemplate + !-- TODO: onlyCurrentVersiontrue/onlyCurrentVersion -- +/configuration +reportSets + reportSet +reports + reportchanges-report/report + !-- reportjira-report/report -- +/reports + /reportSet +/reportSets + /plugin /plugins /reporting /project
svn commit: r1169540 - /commons/proper/io/trunk/src/changes/changes.xml
Author: ggregory Date: Sun Sep 11 21:02:10 2011 New Revision: 1169540 URL: http://svn.apache.org/viewvc?rev=1169540view=rev Log: Generate HTML report from changes.xml. The Jira tickets that were TODOs to check all have commits in trunk and are marked for 2.1. Modified: commons/proper/io/trunk/src/changes/changes.xml Modified: commons/proper/io/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1169540r1=1169539r2=1169540view=diff == --- commons/proper/io/trunk/src/changes/changes.xml (original) +++ commons/proper/io/trunk/src/changes/changes.xml Sun Sep 11 21:02:10 2011 @@ -70,8 +70,6 @@ The action type attribute can be add,u action type=add issue=IO-182 Add new APPEND parameter for writing string into files /action - -!-- TODO check where these fixes really belong -- action dev=sebb type=fix issue=IO-274 due-to=Frank Grimes Tailer returning partial lines when reaching EOF before EOL /action
svn commit: r1169541 - /commons/proper/io/trunk/pom.xml
Author: ggregory Date: Sun Sep 11 21:05:10 2011 New Revision: 1169541 URL: http://svn.apache.org/viewvc?rev=1169541view=rev Log: Add commons.rc.versionRC1/commons.rc.version per https://wiki.apache.org/commons/UsingNexus Modified: commons/proper/io/trunk/pom.xml Modified: commons/proper/io/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/pom.xml?rev=1169541r1=1169540r2=1169541view=diff == --- commons/proper/io/trunk/pom.xml (original) +++ commons/proper/io/trunk/pom.xml Sun Sep 11 21:05:10 2011 @@ -212,6 +212,7 @@ maven.compile.target1.5/maven.compile.target commons.componentidio/commons.componentid commons.release.version2.1/commons.release.version +commons.rc.versionRC1/commons.rc.version commons.release.desc(requires JDK 1.5+)/commons.release.desc commons.release.2.version1.4/commons.release.2.version commons.release.2.desc(requires JDK 1.3+)/commons.release.2.desc
svn commit: r1169543 - /commons/proper/io/trunk/src/assembly/src.xml
Author: ggregory Date: Sun Sep 11 21:07:29 2011 New Revision: 1169543 URL: http://svn.apache.org/viewvc?rev=1169543view=rev Log: Don't use ${version}, use ${commons.release.version} per https://wiki.apache.org/commons/UsingNexus Modified: commons/proper/io/trunk/src/assembly/src.xml Modified: commons/proper/io/trunk/src/assembly/src.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/assembly/src.xml?rev=1169543r1=1169542r2=1169543view=diff == --- commons/proper/io/trunk/src/assembly/src.xml (original) +++ commons/proper/io/trunk/src/assembly/src.xml Sun Sep 11 21:07:29 2011 @@ -20,7 +20,7 @@ formattar.gz/format formatzip/format /formats -baseDirectory${artifactId}-${version}-src/baseDirectory +baseDirectory${artifactId}-${commons.release.version}-src/baseDirectory fileSets fileSet includes
svn commit: r1170351 - in /commons/proper/codec/trunk/src/java/org/apache/commons/codec: ./ binary/ language/ net/
Author: ggregory Date: Tue Sep 13 21:09:09 2011 New Revision: 1170351 URL: http://svn.apache.org/viewvc?rev=1170351view=rev Log: Apply patch from [CODEC-128] Documentation spelling fixes. https://issues.apache.org/jira/secure/attachment/12494312/codec-spelling.patch Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/CharEncoding.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/Encoder.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/StringEncoder.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/StringUtils.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/RefinedSoundex.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/RFC1522Codec.java commons/proper/codec/trunk/src/java/org/apache/commons/codec/package.html Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/CharEncoding.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/CharEncoding.java?rev=1170351r1=1170350r2=1170351view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/CharEncoding.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/CharEncoding.java Tue Sep 13 21:09:09 2011 @@ -45,7 +45,7 @@ package org.apache.commons.codec; * /ul * * This perhaps would best belong in the [lang] project. Even if a similar interface is defined in [lang], it is not - * forseen that [codec] would be made to depend on [lang]. + * foreseen that [codec] would be made to depend on [lang]. * * @see a href=http://download.oracle.com/javase/1.5.0/docs/api/java/nio/charset/Charset.html;Standard charsets/a * @author Apache Software Foundation Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/Encoder.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/Encoder.java?rev=1170351r1=1170350r2=1170351view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/Encoder.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/Encoder.java Tue Sep 13 21:09:09 2011 @@ -33,7 +33,7 @@ public interface Encoder { * as an Object. The Objects here may just be codebyte[]/code * or codeString/codes depending on the implementation used. * - * @param source An object ot encode + * @param source An object to encode * * @return An encoded Object * Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/StringEncoder.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/StringEncoder.java?rev=1170351r1=1170350r2=1170351view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/StringEncoder.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/StringEncoder.java Tue Sep 13 21:09:09 2011 @@ -33,7 +33,7 @@ public interface StringEncoder extends E * @return the encoded String * * @throws EncoderException thrown if there is - * an error conidition during the Encoding process. + * an error condition during the encoding process. */ String encode(String source) throws EncoderException; } Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/StringUtils.java URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/StringUtils.java?rev=1170351r1=1170350r2=1170351view=diff == --- commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/StringUtils.java (original) +++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/StringUtils.java Tue Sep 13 21:09:09 2011 @@ -175,7 +175,7 @@ public class StringUtils { * @param charsetName *The name of a required {@link java.nio.charset.Charset} * @return A new codeString/code decoded from the specified array of bytes using the given charset, - * or codenull/code if the input byte arrray was codenull/code. + * or codenull/code if the input byte array was codenull/code. * @throws IllegalStateException * Thrown when a {@link UnsupportedEncodingException} is caught, which should never happen for a * required charset name. Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec
svn commit: r1170355 - /commons/proper/codec/trunk/src/changes/changes.xml
Author: ggregory Date: Tue Sep 13 21:15:46 2011 New Revision: 1170355 URL: http://svn.apache.org/viewvc?rev=1170355view=rev Log: Add entry for [CODEC-128] Documentation spelling fixes. Modified: commons/proper/codec/trunk/src/changes/changes.xml Modified: commons/proper/codec/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/changes/changes.xml?rev=1170355r1=1170354r2=1170355view=diff == --- commons/proper/codec/trunk/src/changes/changes.xml (original) +++ commons/proper/codec/trunk/src/changes/changes.xml Tue Sep 13 21:15:46 2011 @@ -26,6 +26,9 @@ org.apache.commons.codec.net.URLCodec charset field final. /action -- /release release version=1.6 date=TBA description=Feature and fix release. + action dev=ggregory type=fix issue=CODEC-128 due-to=ville.sky...@iki.fi +Documentation spelling fixes. + /action action dev=ggregory, sebb type=fix issue=CODEC-127 Fix various character encoding issues in comments and test cases. /action
svn commit: r1172280 - /commons/proper/codec/trunk/src/changes/changes.xml
Author: ggregory Date: Sun Sep 18 13:22:59 2011 New Revision: 1172280 URL: http://svn.apache.org/viewvc?rev=1172280view=rev Log: Fix XML comment which caused an XML syntax error. Modified: commons/proper/codec/trunk/src/changes/changes.xml Modified: commons/proper/codec/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/changes/changes.xml?rev=1172280r1=1172279r2=1172280view=diff == --- commons/proper/codec/trunk/src/changes/changes.xml (original) +++ commons/proper/codec/trunk/src/changes/changes.xml Sun Sep 18 13:22:59 2011 @@ -23,8 +23,8 @@ /properties body !-- release version=2.0 date=TBA description=Feature and fix release. action dev=ggregory type=fix issue=CODEC-126 Make - org.apache.commons.codec.net.URLCodec charset field final. /action -- - /release + org.apache.commons.codec.net.URLCodec charset field final. /action /release +-- release version=1.6 date=TBA description=Feature and fix release. action dev=ggregory type=fix issue=CODEC-128 due-to=ville.sky...@iki.fi Documentation spelling fixes.
svn commit: r1172288 - /commons/proper/codec/trunk/checkstyle.xml
Author: ggregory Date: Sun Sep 18 14:09:26 2011 New Revision: 1172288 URL: http://svn.apache.org/viewvc?rev=1172288view=rev Log: Fix checkstyle. Modified: commons/proper/codec/trunk/checkstyle.xml Modified: commons/proper/codec/trunk/checkstyle.xml URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/checkstyle.xml?rev=1172288r1=1172287r2=1172288view=diff == --- commons/proper/codec/trunk/checkstyle.xml (original) +++ commons/proper/codec/trunk/checkstyle.xml Sun Sep 18 14:09:26 2011 @@ -30,10 +30,11 @@ limitations under the License. /module module name=TreeWalker - +property name=cacheFile value=target/cachefile/ module name=OperatorWrap property name=option value=eol/ /module /module + /module
svn commit: r1348698 - in /commons/proper/io/trunk/src: changes/changes.xml main/java/org/apache/commons/io/input/Tailer.java test/java/org/apache/commons/io/input/TailerTest.java
Author: ggregory Date: Mon Jun 11 01:09:58 2012 New Revision: 1348698 URL: http://svn.apache.org/viewvc?rev=1348698view=rev Log: [IO-269] Tailer locks file from deletion/rename on Windows. Modified: commons/proper/io/trunk/src/changes/changes.xml commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/Tailer.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/TailerTest.java Modified: commons/proper/io/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1348698r1=1348697r2=1348698view=diff == --- commons/proper/io/trunk/src/changes/changes.xml (original) +++ commons/proper/io/trunk/src/changes/changes.xml Mon Jun 11 01:09:58 2012 @@ -47,6 +47,9 @@ The action type attribute can be add,u body !-- The release date is the date RC is cut -- release version=2.4 date=2012-TDB-TDB description= + action issue=IO-269 dev=ggregory type=add due-to=sebb +Tailer locks file from deletion/rename on Windows. + /action action issue=IO-279 dev=sebb type=fix due-to=Sergio Bossa, Chris Baron Tailer erroneously considers file as new. /action Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/Tailer.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/Tailer.java?rev=1348698r1=1348697r2=1348698view=diff == --- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/Tailer.java (original) +++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/Tailer.java Mon Jun 11 01:09:58 2012 @@ -138,6 +138,11 @@ public class Tailer implements Runnable private final TailerListener listener; /** + * Whether to close and reopen the file whilst waiting for more input. + */ +private final boolean reOpen; + +/** * The tailer will run as long as this value is true. */ private volatile boolean run = true; @@ -173,6 +178,18 @@ public class Tailer implements Runnable } /** + * Creates a Tailer for the given file, with a delay other than the default 1.0s. + * @param file the file to follow. + * @param listener the TailerListener to use. + * @param delayMillis the delay between checks of the file for new content in milliseconds. + * @param end Set to true to tail from the end of the file, false to tail from the beginning of the file. + * @param reOpen if true, close and reopen the file between reading chunks + */ +public Tailer(File file, TailerListener listener, long delayMillis, boolean end, boolean reOpen) { +this(file, listener, delayMillis, end, reOpen, DEFAULT_BUFSIZE); +} + +/** * Creates a Tailer for the given file, with a specified buffer size. * @param file the file to follow. * @param listener the TailerListener to use. @@ -181,7 +198,19 @@ public class Tailer implements Runnable * @param bufSize Buffer size */ public Tailer(File file, TailerListener listener, long delayMillis, boolean end, int bufSize) { - +this(file, listener, delayMillis, end, false, bufSize); +} + +/** + * Creates a Tailer for the given file, with a specified buffer size. + * @param file the file to follow. + * @param listener the TailerListener to use. + * @param delayMillis the delay between checks of the file for new content in milliseconds. + * @param end Set to true to tail from the end of the file, false to tail from the beginning of the file. + * @param reOpen if true, close and reopen the file between reading chunks + * @param bufSize Buffer size + */ +public Tailer(File file, TailerListener listener, long delayMillis, boolean end, boolean reOpen, int bufSize) { this.file = file; this.delayMillis = delayMillis; this.end = end; @@ -191,6 +220,7 @@ public class Tailer implements Runnable // Save and prepare the listener this.listener = listener; listener.init(this); +this.reOpen = reOpen; } /** @@ -212,6 +242,26 @@ public class Tailer implements Runnable } /** + * Creates and starts a Tailer for the given file. + * + * @param file the file to follow. + * @param listener the TailerListener to use. + * @param delayMillis the delay between checks of the file for new content in milliseconds. + * @param end Set to true to tail from the end of the file, false to tail from the beginning of the file. + * @param reOpen whether to close/reopen the file between chunks + * @param bufSize buffer size. + * @return The new tailer + */ +public static Tailer create(File file
svn commit: r1349306 - /commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java
Author: ggregory Date: Tue Jun 12 12:49:36 2012 New Revision: 1349306 URL: http://svn.apache.org/viewvc?rev=1349306view=rev Log: Add missing Javadoc for org.apache.commons.io.FileUtils.checkDirectory(File) Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java?rev=1349306r1=1349305r2=1349306view=diff == --- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java (original) +++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Tue Jun 12 12:49:36 2012 @@ -2521,11 +2521,16 @@ public class FileUtils { return size; } +/** + * Checks that the given {@code File} exists and is a directory. + * + * @param directory The {@code File} to check. + * @throws IllegalArgumentException if the given {@code File} does not exist or is not a directory. + */ private static void checkDirectory(File directory) { if (!directory.exists()) { throw new IllegalArgumentException(directory + does not exist); } - if (!directory.isDirectory()) { throw new IllegalArgumentException(directory + is not a directory); }
svn commit: r1349311 - /commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java
Author: ggregory Date: Tue Jun 12 12:53:56 2012 New Revision: 1349311 URL: http://svn.apache.org/viewvc?rev=1349311view=rev Log: Fix @since. Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java?rev=1349311r1=1349310r2=1349311view=diff == --- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java (original) +++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Tue Jun 12 12:53:56 2012 @@ -2038,7 +2038,7 @@ public class FileUtils { * @param append if {@code true}, then the data will be added to the * end of the file rather than overwriting * @throws IOException in case of an I/O error - * @since IO 2.3 + * @since 2.3 */ public static void write(File file, CharSequence data, Charset encoding, boolean append) throws IOException { String str = data == null ? null : data.toString();
svn commit: r1349342 - /commons/proper/io/trunk/src/site/xdoc/upgradeto2_4.xml
Author: ggregory Date: Tue Jun 12 13:39:18 2012 New Revision: 1349342 URL: http://svn.apache.org/viewvc?rev=1349342view=rev Log: Preparing release 2.4. Added: commons/proper/io/trunk/src/site/xdoc/upgradeto2_4.xml (with props) Added: commons/proper/io/trunk/src/site/xdoc/upgradeto2_4.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/site/xdoc/upgradeto2_4.xml?rev=1349342view=auto == --- commons/proper/io/trunk/src/site/xdoc/upgradeto2_4.xml (added) +++ commons/proper/io/trunk/src/site/xdoc/upgradeto2_4.xml Tue Jun 12 13:39:18 2012 @@ -0,0 +1,81 @@ +?xml version=1.0? +!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the License); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an AS IS BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-- +document + properties + titleUpgrade from 2.3 to 2.4/title + author email=d...@commons.apache.orgCommons Documentation Team/author + /properties +body + +section name=Upgrade +p +These are the release notes and advice for upgrading Commons-IO from +version 2.3 to version 2.4 +source +Commons IO is a package of Java utility classes like java.io. +Classes in this package are considered to be so standard and of such high +reuse as to justify existence in java.io. + +The Commons IO library contains utility classes, stream implementations, file filters, +file comparators, endian transformation classes, and much more. + +== +Apache Commons IO Version 2.4-SNAPSHOT +== + +Changes in this version include: + +New features: +o IO-269: Tailer locks file from deletion/rename on Windows. Thanks to sebb. +o IO-333: Export OSGi packages at version 1.x in addition to 2.x. Thanks to fmeschbe. +o IO-320: Add XmlStreamReader support for UTF-32. Thanks to ggregory. +o IO-331: BOMInputStream wrongly detects UTF-32LE_BOM files as UTF-16LE_BOM files in method getBOM(). Thanks to ggregory. +o IO-327: Add byteCountToDisplaySize(BigInteger). Thanks to ggregory. +o IO-326: Add new FileUtils.sizeOf[Directory] APIs to return BigInteger. Thanks to ggregory. +o IO-325: Add IOUtils.toByteArray methods to work with URL and URI. Thanks to raviprak. +o IO-324: Add missing Charset sister APIs to method that take a String charset name. Thanks to raviprak. + +Fixed Bugs: +o IO-279: Tailer erroneously considers file as new. Thanks to Sergio Bossa, Chris Baron. +o IO-335: Tailer#readLines - incorrect CR handling. +o IO-334: FileUtils.toURLs throws NPE for null parameter; document the behavior. +o IO-332: Improve tailer's reading performance. Thanks to liangly. +o IO-279: Improve Tailer performance with buffered reads (see IO-332). +o IO-329: FileUtils.writeLines uses unbuffered IO. Thanks to tivv. +o IO-319: FileUtils.sizeOfDirectory follows symbolic links. Thanks to raviprak. + +Compatibility with 2.3: +Binary compatible: Yes. +Source compatible: Yes. +Semantic compatible: Yes. + +Compatibility with 2.2 and 1.4: +Binary compatible: Yes. +Source compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. +Semantic compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. + +Commons IO 2.4 requires JDK 1.6 or later. +Commons IO 2.3 requires JDK 1.6 or later. +Commons IO 2.2 requires JDK 1.5 or later. +Commons IO 1.4 requires JDK 1.3 or later. +/source +/p +/section + +/body +/document Propchange: commons/proper/io/trunk/src/site/xdoc/upgradeto2_4.xml -- svn:eol-style = native Propchange: commons/proper/io/trunk/src/site/xdoc/upgradeto2_4.xml -- svn:keywords = Id
svn commit: r1349343 - /commons/proper/io/trunk/src/site/xdoc/index.xml
Author: ggregory Date: Tue Jun 12 13:39:56 2012 New Revision: 1349343 URL: http://svn.apache.org/viewvc?rev=1349343view=rev Log: Preparing release 2.4. Modified: commons/proper/io/trunk/src/site/xdoc/index.xml Modified: commons/proper/io/trunk/src/site/xdoc/index.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/site/xdoc/index.xml?rev=1349343r1=1349342r2=1349343view=diff == --- commons/proper/io/trunk/src/site/xdoc/index.xml (original) +++ commons/proper/io/trunk/src/site/xdoc/index.xml Tue Jun 12 13:39:56 2012 @@ -47,13 +47,13 @@ There are six main areas included: !-- == -- section name=Releases -subsection name=Commons IO 2.3 (requires JDK 1.6+) +subsection name=Commons IO 2.4 (requires JDK 1.6+) p -Commons IO 2.3 is the latest version and requires a minimum of JDK 1.6 - +Commons IO 2.4 is the latest version and requires a minimum of JDK 1.6 - a href=http://commons.apache.org/io/download_io.cgi;Download now!/a /p p -View the a href=upgradeto2_3.htmlRelease Notes/a and +View the a href=upgradeto2_4.htmlRelease Notes/a and a href=api-release/index.htmlJavaDoc API documents/a /p /subsection
svn commit: r1349345 - /commons/proper/io/trunk/src/site/site.xml
Author: ggregory Date: Tue Jun 12 13:40:19 2012 New Revision: 1349345 URL: http://svn.apache.org/viewvc?rev=1349345view=rev Log: Preparing release 2.4. Modified: commons/proper/io/trunk/src/site/site.xml Modified: commons/proper/io/trunk/src/site/site.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/site/site.xml?rev=1349345r1=1349344r2=1349345view=diff == --- commons/proper/io/trunk/src/site/site.xml (original) +++ commons/proper/io/trunk/src/site/site.xml Tue Jun 12 13:40:19 2012 @@ -28,7 +28,7 @@ item name=Download href=http://commons.apache.org/io/download_io.cgi/ item name=User guide href=/description.html/ item name=Best practices href=/bestpractices.html/ -item name=Javadoc 2.3 href=api-release/index.html/ +item name=Javadoc 2.4 href=api-release/index.html/ item name=Javadoc 2.2 href=api-2.2/index.html/ item name=Javadoc 1.4 href=api-1.4/index.html/ /menu
svn commit: r1349351 - /commons/proper/io/trunk/src/changes/release-notes.vm
Author: ggregory Date: Tue Jun 12 13:44:04 2012 New Revision: 1349351 URL: http://svn.apache.org/viewvc?rev=1349351view=rev Log: Preparing release 2.4. Modified: commons/proper/io/trunk/src/changes/release-notes.vm Modified: commons/proper/io/trunk/src/changes/release-notes.vm URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/release-notes.vm?rev=1349351r1=1349350r2=1349351view=diff == --- commons/proper/io/trunk/src/changes/release-notes.vm (original) +++ commons/proper/io/trunk/src/changes/release-notes.vm Tue Jun 12 13:44:04 2012 @@ -147,6 +147,27 @@ Binary compatible: Yes. Source compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. Semantic compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. +Commons IO 2.4 requires JDK 1.6 or later. +Commons IO 2.3 requires JDK 1.6 or later. +Commons IO 2.2 requires JDK 1.5 or later. +Commons IO 1.4 requires JDK 1.3 or later. + +== +Apache Commons IO Version 2.3 +== + +Changes in this version include: + +New features: +o IO-322: Add and use class Charsets. Thanks to ggregory. +o IO-321: ByteOrderMark UTF_32LE is incorrect. Thanks to ggregory. +o IO-318: Add Charset sister APIs to method that take a String charset name. Thanks to ggregory. + +Compatibility with 2.2 and 1.4: +Binary compatible: Yes. +Source compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. +Semantic compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. + Commons IO 2.3 requires JDK 1.6 or later. Commons IO 2.2 requires JDK 1.5 or later. Commons IO 1.4 requires JDK 1.3 or later.
svn commit: r1349352 - /commons/proper/io/trunk/src/changes/release-notes.vm
Author: ggregory Date: Tue Jun 12 13:47:59 2012 New Revision: 1349352 URL: http://svn.apache.org/viewvc?rev=1349352view=rev Log: Preparing release 2.4. Modified: commons/proper/io/trunk/src/changes/release-notes.vm Modified: commons/proper/io/trunk/src/changes/release-notes.vm URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/release-notes.vm?rev=1349352r1=1349351r2=1349352view=diff == --- commons/proper/io/trunk/src/changes/release-notes.vm (original) +++ commons/proper/io/trunk/src/changes/release-notes.vm Tue Jun 12 13:47:59 2012 @@ -38,6 +38,7 @@ Apache Commons IO Version ${version} ## Hack to improve layout: replace all pairs of spaces with a single new-line $release.description.replaceAll( , ) + ## #if ($release.getActions().size() == 0) No changes defined in this version. @@ -142,6 +143,11 @@ o#if($!issue != ) $issue: #else$indent ## End of main loop #end ## +Compatibility with 2.3: +Binary compatible: Yes. +Source compatible: Yes. +Semantic compatible: Yes. + Compatibility with 2.2 and 1.4: Binary compatible: Yes. Source compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318.
svn commit: r1349353 - /commons/proper/io/trunk/src/changes/changes.xml
Author: ggregory Date: Tue Jun 12 13:48:30 2012 New Revision: 1349353 URL: http://svn.apache.org/viewvc?rev=1349353view=rev Log: Preparing release 2.4. Modified: commons/proper/io/trunk/src/changes/changes.xml Modified: commons/proper/io/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1349353r1=1349352r2=1349353view=diff == --- commons/proper/io/trunk/src/changes/changes.xml (original) +++ commons/proper/io/trunk/src/changes/changes.xml Tue Jun 12 13:48:30 2012 @@ -46,7 +46,7 @@ The action type attribute can be add,u body !-- The release date is the date RC is cut -- -release version=2.4 date=2012-TDB-TDB description= +release version=2.4 date=2012-TBD-TBD description=New features and bug fixes. action issue=IO-269 dev=ggregory type=add due-to=sebb Tailer locks file from deletion/rename on Windows. /action @@ -57,16 +57,15 @@ The action type attribute can be add,u Tailer#readLines - incorrect CR handling. /action action issue=IO-334 dev=sebb type=fix -FileUtils.toURLs throws NPE for null parameter. -Documented the behaviour. +FileUtils.toURLs throws NPE for null parameter; document the behavior. /action action issue=IO-333 dev=ggregory type=add due-to=fmeschbe Export OSGi packages at version 1.x in addition to 2.x. /action - action issue=IO-320 dev=ggregory type=add + action issue=IO-320 dev=ggregory type=add due-to=ggregory Add XmlStreamReader support for UTF-32. /action - action issue=IO-331 dev=ggregory type=add + action issue=IO-331 dev=ggregory type=add due-to=ggregory BOMInputStream wrongly detects UTF-32LE_BOM files as UTF-16LE_BOM files in method getBOM(). /action action issue=IO-332 dev=ggregory type=fix due-to=liangly @@ -95,7 +94,7 @@ The action type attribute can be add,u /action /release !-- The release date is the date RC is cut -- -release version=2.3 date=2012-April-10 description= +release version=2.3 date=2012-April-10 description=New features and bug fixes. action issue=IO-322 dev=ggregory type=add due-to=ggregory Add and use class Charsets. /action @@ -106,7 +105,7 @@ The action type attribute can be add,u Add Charset sister APIs to method that take a String charset name. /action /release -release version=2.2 date=2012-March-26 description= +release version=2.2 date=2012-March-26 description=New features and bug fixes. action issue=IO-313 dev=ggregory type=add due-to=ggregory Add IOUTils.toBufferedReader(Reader) /action @@ -124,7 +123,7 @@ The action type attribute can be add,u New copyLarge() method in IOUtils that takes additional offset, length arguments /action action issue=IO-300 dev=sebb type=fix -FileUtils.moveDirectoryToDirectory removes source directory if destination is a subdirectory +FileUtils.moveDirectoryToDirectory removes source directory if destination is a sub-directory /action action issue=IO-307 dev=sebb type=fix ReaderInputStream#read(byte[] b, int off, int len) should check for valid parameters @@ -182,7 +181,7 @@ The action type attribute can be add,u Added contentEqualsIgnoreEOL methods to both classes /action /release -release version=2.1 date=2011-Sep-28 +release version=2.1 date=2011-Sep-28 description=New features and bug fixes. action dev=ggregory type=add issue=IO-285 due-to=ggregory Use standard Maven directory layout /action @@ -250,7 +249,7 @@ The action type attribute can be add,u /action /release -release version=1.3.2 date=2007-Jul-02 +release version=1.3.2 date=2007-Jul-02 description=Bug fixes. action dev=jochen type=fix issue=IO-115 Some tests, which are implicitly assuming a Unix-like file system, are now skipped on Windows.
svn commit: r1349376 - /commons/proper/io/trunk/src/changes/changes.xml
Author: ggregory Date: Tue Jun 12 14:43:53 2012 New Revision: 1349376 URL: http://svn.apache.org/viewvc?rev=1349376view=rev Log: Preparing release 2.4. Modified: commons/proper/io/trunk/src/changes/changes.xml Modified: commons/proper/io/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1349376r1=1349375r2=1349376view=diff == --- commons/proper/io/trunk/src/changes/changes.xml (original) +++ commons/proper/io/trunk/src/changes/changes.xml Tue Jun 12 14:43:53 2012 @@ -46,7 +46,7 @@ The action type attribute can be add,u body !-- The release date is the date RC is cut -- -release version=2.4 date=2012-TBD-TBD description=New features and bug fixes. +release version=2.4 date=2012-06-12 description=New features and bug fixes. action issue=IO-269 dev=ggregory type=add due-to=sebb Tailer locks file from deletion/rename on Windows. /action
svn commit: r1349397 - /commons/proper/io/trunk/src/site/xdoc/download_io.xml
Author: ggregory Date: Tue Jun 12 15:36:51 2012 New Revision: 1349397 URL: http://svn.apache.org/viewvc?rev=1349397view=rev Log: Preparing release 2.4. Modified: commons/proper/io/trunk/src/site/xdoc/download_io.xml Modified: commons/proper/io/trunk/src/site/xdoc/download_io.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/site/xdoc/download_io.xml?rev=1349397r1=1349396r2=1349397view=diff == --- commons/proper/io/trunk/src/site/xdoc/download_io.xml (original) +++ commons/proper/io/trunk/src/site/xdoc/download_io.xml Tue Jun 12 15:36:51 2012 @@ -95,32 +95,32 @@ limitations under the License. /p /subsection /section -section name=Commons IO 2.3 (requires JDK 1.6+) +section name=Commons IO 2.4 (requires JDK 1.6+) subsection name=Binaries table tr - tda href=[preferred]/commons/io/binaries/commons-io-2.3-bin.tar.gzcommons-io-2.3-bin.tar.gz/a/td - tda href=http://www.apache.org/dist/commons/io/binaries/commons-io-2.3-bin.tar.gz.md5;md5/a/td - tda href=http://www.apache.org/dist/commons/io/binaries/commons-io-2.3-bin.tar.gz.asc;pgp/a/td + tda href=[preferred]/commons/io/binaries/commons-io-2.4-bin.tar.gzcommons-io-2.4-bin.tar.gz/a/td + tda href=http://www.apache.org/dist/commons/io/binaries/commons-io-2.4-bin.tar.gz.md5;md5/a/td + tda href=http://www.apache.org/dist/commons/io/binaries/commons-io-2.4-bin.tar.gz.asc;pgp/a/td /tr tr - tda href=[preferred]/commons/io/binaries/commons-io-2.3-bin.zipcommons-io-2.3-bin.zip/a/td - tda href=http://www.apache.org/dist/commons/io/binaries/commons-io-2.3-bin.zip.md5;md5/a/td - tda href=http://www.apache.org/dist/commons/io/binaries/commons-io-2.3-bin.zip.asc;pgp/a/td + tda href=[preferred]/commons/io/binaries/commons-io-2.4-bin.zipcommons-io-2.4-bin.zip/a/td + tda href=http://www.apache.org/dist/commons/io/binaries/commons-io-2.4-bin.zip.md5;md5/a/td + tda href=http://www.apache.org/dist/commons/io/binaries/commons-io-2.4-bin.zip.asc;pgp/a/td /tr /table /subsection subsection name=Source table tr - tda href=[preferred]/commons/io/source/commons-io-2.3-src.tar.gzcommons-io-2.3-src.tar.gz/a/td - tda href=http://www.apache.org/dist/commons/io/source/commons-io-2.3-src.tar.gz.md5;md5/a/td - tda href=http://www.apache.org/dist/commons/io/source/commons-io-2.3-src.tar.gz.asc;pgp/a/td + tda href=[preferred]/commons/io/source/commons-io-2.4-src.tar.gzcommons-io-2.4-src.tar.gz/a/td + tda href=http://www.apache.org/dist/commons/io/source/commons-io-2.4-src.tar.gz.md5;md5/a/td + tda href=http://www.apache.org/dist/commons/io/source/commons-io-2.4-src.tar.gz.asc;pgp/a/td /tr tr - tda href=[preferred]/commons/io/source/commons-io-2.3-src.zipcommons-io-2.3-src.zip/a/td - tda href=http://www.apache.org/dist/commons/io/source/commons-io-2.3-src.zip.md5;md5/a/td - tda href=http://www.apache.org/dist/commons/io/source/commons-io-2.3-src.zip.asc;pgp/a/td + tda href=[preferred]/commons/io/source/commons-io-2.4-src.zipcommons-io-2.4-src.zip/a/td + tda href=http://www.apache.org/dist/commons/io/source/commons-io-2.4-src.zip.md5;md5/a/td + tda href=http://www.apache.org/dist/commons/io/source/commons-io-2.4-src.zip.asc;pgp/a/td /tr /table /subsection
svn commit: r1349399 - /commons/proper/io/trunk/RELEASE-NOTES.txt
Author: ggregory Date: Tue Jun 12 15:37:26 2012 New Revision: 1349399 URL: http://svn.apache.org/viewvc?rev=1349399view=rev Log: Preparing release 2.4. Modified: commons/proper/io/trunk/RELEASE-NOTES.txt Modified: commons/proper/io/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/RELEASE-NOTES.txt?rev=1349399r1=1349398r2=1349399view=diff == --- commons/proper/io/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/io/trunk/RELEASE-NOTES.txt Tue Jun 12 15:37:26 2012 @@ -1,6 +1,6 @@ Apache Commons IO -Version 2.3-SNAPSHOT +Version 2.4 Release Notes INTRODUCTION: @@ -13,6 +13,48 @@ The Commons IO library contains utility file comparators, endian transformation classes, and much more. == +Apache Commons IO Version 2.4 +== +New features and bug fixes. + +Changes in this version include: + +New features: +o IO-269: Tailer locks file from deletion/rename on Windows. Thanks to sebb. +o IO-333: Export OSGi packages at version 1.x in addition to 2.x. Thanks to fmeschbe. +o IO-320: Add XmlStreamReader support for UTF-32. Thanks to ggregory. +o IO-331: BOMInputStream wrongly detects UTF-32LE_BOM files as UTF-16LE_BOM files in method getBOM(). Thanks to ggregory. +o IO-327: Add byteCountToDisplaySize(BigInteger). Thanks to ggregory. +o IO-326: Add new FileUtils.sizeOf[Directory] APIs to return BigInteger. Thanks to ggregory. +o IO-325: Add IOUtils.toByteArray methods to work with URL and URI. Thanks to raviprak. +o IO-324: Add missing Charset sister APIs to method that take a String charset name. Thanks to raviprak. + +Fixed Bugs: +o IO-279: Tailer erroneously considers file as new. Thanks to Sergio Bossa, Chris Baron. +o IO-335: Tailer#readLines - incorrect CR handling. +o IO-334: FileUtils.toURLs throws NPE for null parameter; document the behavior. +o IO-332: Improve tailer's reading performance. Thanks to liangly. +o IO-279: Improve Tailer performance with buffered reads (see IO-332). +o IO-329: FileUtils.writeLines uses unbuffered IO. Thanks to tivv. +o IO-319: FileUtils.sizeOfDirectory follows symbolic links. Thanks to raviprak. + + +Compatibility with 2.3: +Binary compatible: Yes. +Source compatible: Yes. +Semantic compatible: Yes. + +Compatibility with 2.2 and 1.4: +Binary compatible: Yes. +Source compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. +Semantic compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. + +Commons IO 2.4 requires JDK 1.6 or later. +Commons IO 2.3 requires JDK 1.6 or later. +Commons IO 2.2 requires JDK 1.5 or later. +Commons IO 1.4 requires JDK 1.3 or later. + +== Apache Commons IO Version 2.3 ==
svn commit: r1349402 - in /commons/proper/io/tags/2.4-RC1: ./ pom.xml
Author: ggregory Date: Tue Jun 12 15:40:18 2012 New Revision: 1349402 URL: http://svn.apache.org/viewvc?rev=1349402view=rev Log: Create commons-io-2.4-RC1. Added: commons/proper/io/tags/2.4-RC1/ - copied from r1349401, commons/proper/io/trunk/ Modified: commons/proper/io/tags/2.4-RC1/pom.xml Modified: commons/proper/io/tags/2.4-RC1/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/io/tags/2.4-RC1/pom.xml?rev=1349402r1=1349401r2=1349402view=diff == --- commons/proper/io/tags/2.4-RC1/pom.xml (original) +++ commons/proper/io/tags/2.4-RC1/pom.xml Tue Jun 12 15:40:18 2012 @@ -24,7 +24,7 @@ modelVersion4.0.0/modelVersion groupIdcommons-io/groupId artifactIdcommons-io/artifactId - version2.4-SNAPSHOT/version + version2.4/version nameCommons IO/name inceptionYear2002/inceptionYear
svn commit: r1349488 - in /commons/proper/io/trunk: pom.xml src/main/java/org/apache/commons/io/FileUtils.java src/test/java/org/apache/commons/io/FileUtilsTestCase.java
Author: ggregory Date: Tue Jun 12 19:29:22 2012 New Revision: 1349488 URL: http://svn.apache.org/viewvc?rev=1349488view=rev Log: [IO-326] Add new FileUtils.sizeOf[Directory] APIs to return BigInteger. Thanks to Bruno P. Kinoshita for the fix and test case. Modified: commons/proper/io/trunk/pom.xml commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java Modified: commons/proper/io/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/pom.xml?rev=1349488r1=1349487r2=1349488view=diff == --- commons/proper/io/trunk/pom.xml (original) +++ commons/proper/io/trunk/pom.xml Tue Jun 12 19:29:22 2012 @@ -24,7 +24,7 @@ modelVersion4.0.0/modelVersion groupIdcommons-io/groupId artifactIdcommons-io/artifactId - version2.4-SNAPSHOT/version + version2.4/version nameCommons IO/name inceptionYear2002/inceptionYear Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java?rev=1349488r1=1349487r2=1349488view=diff == --- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java (original) +++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Tue Jun 12 19:29:22 2012 @@ -2511,7 +2511,7 @@ public class FileUtils { for (final File file : files) { try { if (!isSymlink(file)) { -size.add(BigInteger.valueOf(sizeOf(file))); +size = size.add(BigInteger.valueOf(sizeOf(file))); } } catch (IOException ioe) { // Ignore exceptions caught when asking if a File is a symlink. Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java?rev=1349488r1=1349487r2=1349488view=diff == --- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java (original) +++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java Tue Jun 12 19:29:22 2012 @@ -64,6 +64,11 @@ public class FileUtilsTestCase extends F private static final BigInteger TEST_DIRECTORY_SIZE_BI = BigInteger.ZERO; /** + * Size (greater of zero) of test file. + */ +private static final BigInteger TEST_DIRECTORY_SIZE_GT_ZERO_BI = BigInteger.valueOf(100); + +/** * List files recursively */ private static final ListDirectoryWalker LIST_WALKER = new ListDirectoryWalker(); @@ -796,7 +801,8 @@ public class FileUtilsTestCase extends F try { FileUtils.sizeOfDirectoryAsBigInteger(file); fail(Exception expected.); -} catch (IllegalArgumentException ex) {} +} catch (IllegalArgumentException ex) { +} // Creates file file.createNewFile(); @@ -806,7 +812,8 @@ public class FileUtilsTestCase extends F try { FileUtils.sizeOfDirectoryAsBigInteger(file); fail(Exception expected.); -} catch (IllegalArgumentException ex) {} +} catch (IllegalArgumentException ex) { +} // Existing directory file.delete(); @@ -814,10 +821,21 @@ public class FileUtilsTestCase extends F this.createCircularSymLink(file); -assertEquals( -Unexpected directory size, -TEST_DIRECTORY_SIZE_BI, -FileUtils.sizeOfDirectoryAsBigInteger(file)); +assertEquals(Unexpected directory size, TEST_DIRECTORY_SIZE_BI, FileUtils.sizeOfDirectoryAsBigInteger(file)); + +// Existing directory which size is greater than zero +file.delete(); +file.mkdir(); + +File nonEmptyFile = new File(file, nonEmptyFile + System.nanoTime()); +this.createFile(nonEmptyFile, TEST_DIRECTORY_SIZE_GT_ZERO_BI.longValue()); +nonEmptyFile.deleteOnExit(); + +assertEquals(Unexpected directory size, TEST_DIRECTORY_SIZE_GT_ZERO_BI, +FileUtils.sizeOfDirectoryAsBigInteger(file)); + +nonEmptyFile.delete(); +file.delete(); } /**
svn commit: r1349491 - /commons/proper/io/trunk/src/changes/changes.xml
Author: ggregory Date: Tue Jun 12 19:33:44 2012 New Revision: 1349491 URL: http://svn.apache.org/viewvc?rev=1349491view=rev Log: [IO-326] Add new FileUtils.sizeOf[Directory] APIs to return BigInteger. Thanks to Bruno P. Kinoshita for the fix and test case. Modified: commons/proper/io/trunk/src/changes/changes.xml Modified: commons/proper/io/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1349491r1=1349490r2=1349491view=diff == --- commons/proper/io/trunk/src/changes/changes.xml (original) +++ commons/proper/io/trunk/src/changes/changes.xml Tue Jun 12 19:33:44 2012 @@ -80,7 +80,7 @@ The action type attribute can be add,u action issue=IO-327 dev=ggregory type=add due-to=ggregory Add byteCountToDisplaySize(BigInteger). /action - action issue=IO-326 dev=ggregory type=add due-to=ggregory + action issue=IO-326 dev=ggregory type=add due-to=ggregory, kinow Add new FileUtils.sizeOf[Directory] APIs to return BigInteger. /action action issue=IO-325 dev=ggregory type=add due-to=raviprak
svn commit: r1349493 - /commons/proper/io/trunk/RELEASE-NOTES.txt
Author: ggregory Date: Tue Jun 12 19:46:55 2012 New Revision: 1349493 URL: http://svn.apache.org/viewvc?rev=1349493view=rev Log: Preparing release 2.4-RC2. Modified: commons/proper/io/trunk/RELEASE-NOTES.txt Modified: commons/proper/io/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/RELEASE-NOTES.txt?rev=1349493r1=1349492r2=1349493view=diff == --- commons/proper/io/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/io/trunk/RELEASE-NOTES.txt Tue Jun 12 19:46:55 2012 @@ -25,7 +25,7 @@ o IO-333: Export OSGi packages at versi o IO-320: Add XmlStreamReader support for UTF-32. Thanks to ggregory. o IO-331: BOMInputStream wrongly detects UTF-32LE_BOM files as UTF-16LE_BOM files in method getBOM(). Thanks to ggregory. o IO-327: Add byteCountToDisplaySize(BigInteger). Thanks to ggregory. -o IO-326: Add new FileUtils.sizeOf[Directory] APIs to return BigInteger. Thanks to ggregory. +o IO-326: Add new FileUtils.sizeOf[Directory] APIs to return BigInteger. Thanks to ggregory, kinow. o IO-325: Add IOUtils.toByteArray methods to work with URL and URI. Thanks to raviprak. o IO-324: Add missing Charset sister APIs to method that take a String charset name. Thanks to raviprak.
svn commit: r1349494 - /commons/proper/io/trunk/pom.xml
Author: ggregory Date: Tue Jun 12 19:47:33 2012 New Revision: 1349494 URL: http://svn.apache.org/viewvc?rev=1349494view=rev Log: Preparing release 2.4-RC2. Modified: commons/proper/io/trunk/pom.xml Modified: commons/proper/io/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/pom.xml?rev=1349494r1=1349493r2=1349494view=diff == --- commons/proper/io/trunk/pom.xml (original) +++ commons/proper/io/trunk/pom.xml Tue Jun 12 19:47:33 2012 @@ -24,7 +24,7 @@ modelVersion4.0.0/modelVersion groupIdcommons-io/groupId artifactIdcommons-io/artifactId - version2.4/version + version2.4-SNAPSHOT/version nameCommons IO/name inceptionYear2002/inceptionYear
svn commit: r1349498 - in /commons/proper/io/tags/2.4-RC2: ./ RELEASE-NOTES.txt pom.xml src/changes/changes.xml src/main/java/org/apache/commons/io/FileUtils.java src/test/java/org/apache/commons/io/F
Author: ggregory Date: Tue Jun 12 19:48:47 2012 New Revision: 1349498 URL: http://svn.apache.org/viewvc?rev=1349498view=rev Log: Create commons-io-2.4-RC2. Added: commons/proper/io/tags/2.4-RC2/ - copied from r1349401, commons/proper/io/trunk/ commons/proper/io/tags/2.4-RC2/RELEASE-NOTES.txt - copied unchanged from r1349493, commons/proper/io/trunk/RELEASE-NOTES.txt commons/proper/io/tags/2.4-RC2/pom.xml - copied, changed from r1349494, commons/proper/io/trunk/pom.xml commons/proper/io/tags/2.4-RC2/src/changes/changes.xml - copied unchanged from r1349491, commons/proper/io/trunk/src/changes/changes.xml commons/proper/io/tags/2.4-RC2/src/main/java/org/apache/commons/io/FileUtils.java - copied unchanged from r1349488, commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java commons/proper/io/tags/2.4-RC2/src/test/java/org/apache/commons/io/FileUtilsTestCase.java - copied unchanged from r1349488, commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java Copied: commons/proper/io/tags/2.4-RC2/pom.xml (from r1349494, commons/proper/io/trunk/pom.xml) URL: http://svn.apache.org/viewvc/commons/proper/io/tags/2.4-RC2/pom.xml?p2=commons/proper/io/tags/2.4-RC2/pom.xmlp1=commons/proper/io/trunk/pom.xmlr1=1349494r2=1349498rev=1349498view=diff == --- commons/proper/io/trunk/pom.xml (original) +++ commons/proper/io/tags/2.4-RC2/pom.xml Tue Jun 12 19:48:47 2012 @@ -24,7 +24,7 @@ modelVersion4.0.0/modelVersion groupIdcommons-io/groupId artifactIdcommons-io/artifactId - version2.4-SNAPSHOT/version + version2.4/version nameCommons IO/name inceptionYear2002/inceptionYear
svn commit: r1349509 - in /commons/proper/io/trunk/src: changes/changes.xml main/java/org/apache/commons/io/FileUtils.java
Author: ggregory Date: Tue Jun 12 20:39:23 2012 New Revision: 1349509 URL: http://svn.apache.org/viewvc?rev=1349509view=rev Log: [IO-336] Yottabyte (YB) incorrectly defined in FileUtils. Modified: commons/proper/io/trunk/src/changes/changes.xml commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Modified: commons/proper/io/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1349509r1=1349508r2=1349509view=diff == --- commons/proper/io/trunk/src/changes/changes.xml (original) +++ commons/proper/io/trunk/src/changes/changes.xml Tue Jun 12 20:39:23 2012 @@ -47,6 +47,9 @@ The action type attribute can be add,u body !-- The release date is the date RC is cut -- release version=2.4 date=2012-06-12 description=New features and bug fixes. + action issue=IO-336 dev=ggregory type=fix due-to=rleavelle +Yottabyte (YB) incorrectly defined in FileUtils. + /action action issue=IO-269 dev=ggregory type=add due-to=sebb Tailer locks file from deletion/rename on Windows. /action Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java?rev=1349509r1=1349508r2=1349509view=diff == --- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java (original) +++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Tue Jun 12 20:39:23 2012 @@ -167,7 +167,7 @@ public class FileUtils { /** * The number of bytes in a yottabyte. */ -public static final BigInteger ONE_YB = ONE_ZB.multiply(BigInteger.valueOf(ONE_EB)); +public static final BigInteger ONE_YB = ONE_KB_BI.multiply(ONE_ZB); /** * An empty array of type codeFile/code.
svn commit: r1349567 - /commons/proper/io/trunk/RELEASE-NOTES.txt
Author: ggregory Date: Tue Jun 12 22:16:48 2012 New Revision: 1349567 URL: http://svn.apache.org/viewvc?rev=1349567view=rev Log: Preparing release 2.4-RC2. Modified: commons/proper/io/trunk/RELEASE-NOTES.txt Modified: commons/proper/io/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/RELEASE-NOTES.txt?rev=1349567r1=1349566r2=1349567view=diff == --- commons/proper/io/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/io/trunk/RELEASE-NOTES.txt Tue Jun 12 22:16:48 2012 @@ -30,6 +30,7 @@ o IO-325: Add IOUtils.toByteArray metho o IO-324: Add missing Charset sister APIs to method that take a String charset name. Thanks to raviprak. Fixed Bugs: +o IO-336: Yottabyte (YB) incorrectly defined in FileUtils. Thanks to rleavelle. o IO-279: Tailer erroneously considers file as new. Thanks to Sergio Bossa, Chris Baron. o IO-335: Tailer#readLines - incorrect CR handling. o IO-334: FileUtils.toURLs throws NPE for null parameter; document the behavior.
svn commit: r1349568 - /commons/proper/io/tags/2.4-RC2/
Author: ggregory Date: Tue Jun 12 22:18:27 2012 New Revision: 1349568 URL: http://svn.apache.org/viewvc?rev=1349568view=rev Log: Removing RC that was never voted on Removed: commons/proper/io/tags/2.4-RC2/
svn commit: r1349569 - in /commons/proper/io/tags/2.4-RC2: ./ pom.xml
Author: ggregory Date: Tue Jun 12 22:18:36 2012 New Revision: 1349569 URL: http://svn.apache.org/viewvc?rev=1349569view=rev Log: Create commons-io-2.4-RC2. Added: commons/proper/io/tags/2.4-RC2/ - copied from r1349567, commons/proper/io/trunk/ Modified: commons/proper/io/tags/2.4-RC2/pom.xml Modified: commons/proper/io/tags/2.4-RC2/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/io/tags/2.4-RC2/pom.xml?rev=1349569r1=1349567r2=1349569view=diff == --- commons/proper/io/tags/2.4-RC2/pom.xml (original) +++ commons/proper/io/tags/2.4-RC2/pom.xml Tue Jun 12 22:18:36 2012 @@ -24,7 +24,7 @@ modelVersion4.0.0/modelVersion groupIdcommons-io/groupId artifactIdcommons-io/artifactId - version2.4-SNAPSHOT/version + version2.4/version nameCommons IO/name inceptionYear2002/inceptionYear
svn commit: r1349871 - in /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider: ftp/FtpFileProvider.java http/HttpFileProvider.java local/DefaultLocalFileProvider.java ram/Ram
Author: ggregory Date: Wed Jun 13 14:29:25 2012 New Revision: 1349871 URL: http://svn.apache.org/viewvc?rev=1349871view=rev Log: Javadoc. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileProvider.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileProvider.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/DefaultLocalFileProvider.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileProvider.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileProvider.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileProvider.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileProvider.java?rev=1349871r1=1349870r2=1349871view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileProvider.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileProvider.java Wed Jun 13 14:29:25 2012 @@ -64,6 +64,9 @@ public class FtpFileProvider Capability.RANDOM_ACCESS_READ, })); +/** + * Constructs a new provider. + */ public FtpFileProvider() { super(); Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileProvider.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileProvider.java?rev=1349871r1=1349870r2=1349871view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileProvider.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileProvider.java Wed Jun 13 14:29:25 2012 @@ -55,6 +55,9 @@ public class HttpFileProvider Capability.DIRECTORY_READ_CONTENT, })); +/** + * Constructs a new provider. + */ public HttpFileProvider() { super(); Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/DefaultLocalFileProvider.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/DefaultLocalFileProvider.java?rev=1349871r1=1349870r2=1349871view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/DefaultLocalFileProvider.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/DefaultLocalFileProvider.java Wed Jun 13 14:29:25 2012 @@ -60,6 +60,9 @@ public class DefaultLocalFileProvider Capability.RANDOM_ACCESS_WRITE })); +/** + * Constructs a new provider. + */ public DefaultLocalFileProvider() { super(); Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileProvider.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileProvider.java?rev=1349871r1=1349870r2=1349871view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileProvider.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileProvider.java Wed Jun 13 14:29:25 2012 @@ -56,7 +56,7 @@ public class RamFileProvider extends Abs })); /** - * Constructor. + * Constructs a new provider. */ public RamFileProvider() { Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileProvider.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileProvider.java?rev=1349871r1=1349870r2=1349871view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileProvider.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileProvider.java Wed Jun 13 14:29:25 2012 @@ -67,6 +67,9 @@ public class SftpFileProvider extends Ab // private JSch jSch = new JSch(); +/** + * Constructs a new provider. + */ public SftpFileProvider() { super();
svn commit: r1349874 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileNameParser.java
Author: ggregory Date: Wed Jun 13 14:30:57 2012 New Revision: 1349874 URL: http://svn.apache.org/viewvc?rev=1349874view=rev Log: Refactor magic port number into constant. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileNameParser.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileNameParser.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileNameParser.java?rev=1349874r1=1349873r2=1349874view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileNameParser.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileNameParser.java Wed Jun 13 14:30:57 2012 @@ -25,11 +25,13 @@ import org.apache.commons.vfs2.provider. */ public class SftpFileNameParser extends URLFileNameParser { +private static final int DEFAULT_PORT = 22; + private static final SftpFileNameParser INSTANCE = new SftpFileNameParser(); public SftpFileNameParser() { -super(22); +super(DEFAULT_PORT); } public static FileNameParser getInstance()
svn commit: r1350015 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java
Author: ggregory Date: Wed Jun 13 21:01:08 2012 New Revision: 1350015 URL: http://svn.apache.org/viewvc?rev=1350015view=rev Log: [VFS-419] JarFileSystem incorrectly resolves file if it has been removed from the cache: Add commented out method. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java?rev=1350015r1=1350014r2=1350015view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/jar/JarFileSystem.java Wed Jun 13 21:01:08 2012 @@ -48,6 +48,12 @@ public class JarFileSystem extends ZipFi super(rootName, file, fileSystemOptions); } +//@Override +//protected FileObject createFile(AbstractFileName name) throws FileSystemException +//{ +//return new JarFileObject(name, null, this, false); +//} + @Override protected ZipFile createZipFile(File file) throws FileSystemException { @@ -211,4 +217,5 @@ public class JarFileSystem extends ZipFi { return super.getZipFile(); } + }
svn commit: r1350639 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/sftp/test/SftpProviderTestCase.java
Author: ggregory Date: Fri Jun 15 14:36:19 2012 New Revision: 1350639 URL: http://svn.apache.org/viewvc?rev=1350639view=rev Log: Fix odd compilation problem that was not previously detected. Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/sftp/test/SftpProviderTestCase.java Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/sftp/test/SftpProviderTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/sftp/test/SftpProviderTestCase.java?rev=1350639r1=1350638r2=1350639view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/sftp/test/SftpProviderTestCase.java (original) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/sftp/test/SftpProviderTestCase.java Fri Jun 15 14:36:19 2012 @@ -25,6 +25,7 @@ import java.util.List; import junit.framework.Test; +import org.apache.commons.AbstractVfsTestCase; import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileSystemManager; import org.apache.commons.vfs2.FileSystemOptions; @@ -78,7 +79,7 @@ public class SftpProviderTestCase extend { return null; } -return new TestFileSystemView(getTestDirectoryString(), userName); +return new TestFileSystemView(AbstractVfsTestCase.getTestDirectoryString(), userName); } }
svn commit: r1351047 - /commons/proper/pool/tags/POOL_1_6/
Author: ggregory Date: Sun Jun 17 04:44:32 2012 New Revision: 1351047 URL: http://svn.apache.org/viewvc?rev=1351047view=rev Log: Copying tag for Commons Pool 1.6-RC4 to 1.6 Added: commons/proper/pool/tags/POOL_1_6/ - copied from r1351046, commons/proper/pool/tags/POOL_1_6_RC4/
svn commit: r1351765 - /commons/proper/vfs/trunk/pom.xml
Author: ggregory Date: Tue Jun 19 16:18:32 2012 New Revision: 1351765 URL: http://svn.apache.org/viewvc?rev=1351765view=rev Log: Add commented out section for running individual tests. Modified: commons/proper/vfs/trunk/pom.xml Modified: commons/proper/vfs/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/pom.xml?rev=1351765r1=1351764r2=1351765view=diff == --- commons/proper/vfs/trunk/pom.xml (original) +++ commons/proper/vfs/trunk/pom.xml Tue Jun 19 16:18:32 2012 @@ -151,6 +151,14 @@ artifactIdmaven-checkstyle-plugin/artifactId version2.9.1/version /plugin +!-- Use 2.11 to run individual tests, 2.12 seems to no longer support this feature. -- +!-- +plugin + groupIdorg.apache.maven.plugins/groupId + artifactIdmaven-surefire-plugin/artifactId + version2.11/version +/plugin + -- /plugins /pluginManagement plugins
svn commit: r1351812 - /commons/proper/vfs/trunk/pom.xml
Author: ggregory Date: Tue Jun 19 19:30:22 2012 New Revision: 1351812 URL: http://svn.apache.org/viewvc?rev=1351812view=rev Log: Add comment refering to http://jira.codehaus.org/browse/SUREFIRE-827 Modified: commons/proper/vfs/trunk/pom.xml Modified: commons/proper/vfs/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/pom.xml?rev=1351812r1=1351811r2=1351812view=diff == --- commons/proper/vfs/trunk/pom.xml (original) +++ commons/proper/vfs/trunk/pom.xml Tue Jun 19 19:30:22 2012 @@ -152,6 +152,7 @@ version2.9.1/version /plugin !-- Use 2.11 to run individual tests, 2.12 seems to no longer support this feature. -- +!-- See http://jira.codehaus.org/browse/SUREFIRE-827 -- !-- plugin groupIdorg.apache.maven.plugins/groupId
svn commit: r1351813 - /commons/proper/io/tags/2.4/
Author: ggregory Date: Tue Jun 19 19:34:38 2012 New Revision: 1351813 URL: http://svn.apache.org/viewvc?rev=1351813view=rev Log: Create 2.4 GA tag Added: commons/proper/io/tags/2.4/ - copied from r1351812, commons/proper/io/tags/2.4-RC2/
svn commit: r1351815 - /commons/proper/io/tags/2.3/
Author: ggregory Date: Tue Jun 19 19:37:23 2012 New Revision: 1351815 URL: http://svn.apache.org/viewvc?rev=1351815view=rev Log: Create 2.3 GA tag. Vote result http://mail-archives.apache.org/mod_mbox/commons-dev/201204.mbox/%3ccaczkxpyqtm0ccn6n_tcfcs5fxdve4djz15gopibfq46g+a6...@mail.gmail.com%3E Added: commons/proper/io/tags/2.3/ - copied from r1351814, commons/proper/io/tags/2.3-RC1/
svn commit: r1351816 - /commons/proper/io/tags/2.2/
Author: ggregory Date: Tue Jun 19 19:38:37 2012 New Revision: 1351816 URL: http://svn.apache.org/viewvc?rev=1351816view=rev Log: Create 2.3 GA tag. Vote result http://mail-archives.apache.org/mod_mbox/commons-dev/201203.mbox/%3CCACZkXPwG+r3SgCa2=rusnfa1zrj9f0bpj-wab1ubecxufnt...@mail.gmail.com%3E Added: commons/proper/io/tags/2.2/ - copied from r1351815, commons/proper/io/tags/2.2-RC4/
svn propchange: r1351816 - svn:log
Author: ggregory Revision: 1351816 Modified property: svn:log Modified: svn:log at Tue Jun 19 19:42:17 2012 -- --- svn:log (original) +++ svn:log Tue Jun 19 19:42:17 2012 @@ -1 +1 @@ -Create 2.3 GA tag. Vote result http://mail-archives.apache.org/mod_mbox/commons-dev/201203.mbox/%3CCACZkXPwG+r3SgCa2=rusnfa1zrj9f0bpj-wab1ubecxufnt...@mail.gmail.com%3E +Create 2.2 GA tag. Vote result http://mail-archives.apache.org/mod_mbox/commons-dev/201203.mbox/%3CCACZkXPwG+r3SgCa2=rusnfa1zrj9f0bpj-wab1ubecxufnt...@mail.gmail.com%3E
svn commit: r1352139 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
Author: ggregory Date: Wed Jun 20 14:58:36 2012 New Revision: 1352139 URL: http://svn.apache.org/viewvc?rev=1352139view=rev Log: Javadoc. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java?rev=1352139r1=1352138r2=1352139view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java Wed Jun 20 14:58:36 2012 @@ -114,6 +114,11 @@ public final class SftpFileSystemConfigB private static final String TIMEOUT = _PREFIX + .TIMEOUT; private static final String USER_DIR_IS_ROOT = _PREFIX + .USER_DIR_IS_ROOT; +/** + * Gets the singleton builder. + * + * @return the singleton builder. + */ public static SftpFileSystemConfigBuilder getInstance() { return BUILDER;
svn commit: r1352140 - in /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2: impl/ provider/ftps/ provider/http/ provider/ram/ provider/res/ provider/webdav/
Author: ggregory Date: Wed Jun 20 15:00:27 2012 New Revision: 1352140 URL: http://svn.apache.org/viewvc?rev=1352140view=rev Log: Javadoc. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemConfigBuilder.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsFileSystemConfigBuilder.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileSystemConfigBuilder.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystemConfigBuilder.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/res/ResourceFileSystemConfigBuilder.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystemConfigBuilder.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemConfigBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemConfigBuilder.java?rev=1352140r1=1352139r2=1352140view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemConfigBuilder.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemConfigBuilder.java Wed Jun 20 15:00:27 2012 @@ -30,6 +30,11 @@ public class DefaultFileSystemConfigBuil /** The default FileSystemConfigBuilder */ private static final DefaultFileSystemConfigBuilder BUILDER = new DefaultFileSystemConfigBuilder(); +/** + * Gets the singleton builder. + * + * @return the singleton builder. + */ public static DefaultFileSystemConfigBuilder getInstance() { return BUILDER; Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsFileSystemConfigBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsFileSystemConfigBuilder.java?rev=1352140r1=1352139r2=1352140view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsFileSystemConfigBuilder.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsFileSystemConfigBuilder.java Wed Jun 20 15:00:27 2012 @@ -55,6 +55,11 @@ public final class FtpsFileSystemConfigB { } +/** + * Gets the singleton builder. + * + * @return the singleton builder. + */ public static FtpsFileSystemConfigBuilder getInstance() { return BUILDER; Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileSystemConfigBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileSystemConfigBuilder.java?rev=1352140r1=1352139r2=1352140view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileSystemConfigBuilder.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileSystemConfigBuilder.java Wed Jun 20 15:00:27 2012 @@ -47,6 +47,11 @@ public class HttpFileSystemConfigBuilder super(http.); } +/** + * Gets the singleton builder. + * + * @return the singleton builder. + */ public static HttpFileSystemConfigBuilder getInstance() { return BUILDER; Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystemConfigBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystemConfigBuilder.java?rev=1352140r1=1352139r2=1352140view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystemConfigBuilder.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystemConfigBuilder.java Wed Jun 20 15:00:27 2012 @@ -41,7 +41,9 @@ public final class RamFileSystemConfigBu } /** - * @return the config builder SINGLETON + * Gets the singleton builder. + * + * @return the singleton builder. */ public static RamFileSystemConfigBuilder getInstance() { Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/res/ResourceFileSystemConfigBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main
svn commit: r1352141 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
Author: ggregory Date: Wed Jun 20 15:01:00 2012 New Revision: 1352141 URL: http://svn.apache.org/viewvc?rev=1352141view=rev Log: Fix Javadoc typo. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java?rev=1352141r1=1352140r2=1352141view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java Wed Jun 20 15:01:00 2012 @@ -200,7 +200,7 @@ public final class SftpFileSystemConfigB /** * Gets the proxy to use for the SFTP connection. You have to set the ProxyPort too if you would like to have the proxy - * relly used. + * really used. * * @param opts *The FileSystem options.
svn commit: r1352142 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java
Author: ggregory Date: Wed Jun 20 15:01:36 2012 New Revision: 1352142 URL: http://svn.apache.org/viewvc?rev=1352142view=rev Log: Remove unused import. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java?rev=1352142r1=1352141r2=1352142view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileObject.java Wed Jun 20 15:01:36 2012 @@ -33,7 +33,6 @@ import org.apache.commons.vfs2.VFS; import org.apache.commons.vfs2.provider.AbstractFileName; import org.apache.commons.vfs2.provider.AbstractFileObject; import org.apache.commons.vfs2.provider.UriParser; -import org.apache.commons.vfs2.provider.ram.RamFileObject; import org.apache.commons.vfs2.util.FileObjectUtils; import org.apache.commons.vfs2.util.MonitorInputStream; import org.apache.commons.vfs2.util.MonitorOutputStream;
svn commit: r1352143 - in /commons/proper/vfs/trunk/core/src: main/java/org/apache/commons/vfs2/provider/local/ main/java/org/apache/commons/vfs2/provider/ram/ test/java/org/apache/commons/vfs2/provid
Author: ggregory Date: Wed Jun 20 15:02:13 2012 New Revision: 1352143 URL: http://svn.apache.org/viewvc?rev=1352143view=rev Log: Organize imports. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileRandomAccessContent.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/MultipleConnectionTestCase.java commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/url/test/UrlHttpProviderTestCase.java commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/url/test/UrlProviderTestCase.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileRandomAccessContent.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileRandomAccessContent.java?rev=1352143r1=1352142r2=1352143view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileRandomAccessContent.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileRandomAccessContent.java Wed Jun 20 15:02:13 2012 @@ -24,6 +24,7 @@ import java.io.InputStream; import java.io.RandomAccessFile; import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.RandomAccessContent; import org.apache.commons.vfs2.provider.AbstractRandomAccessContent; import org.apache.commons.vfs2.util.RandomAccessMode; Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java?rev=1352143r1=1352142r2=1352143view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java Wed Jun 20 15:02:13 2012 @@ -27,7 +27,6 @@ import org.apache.commons.vfs2.FileType; import org.apache.commons.vfs2.RandomAccessContent; import org.apache.commons.vfs2.provider.AbstractFileName; import org.apache.commons.vfs2.provider.AbstractFileObject; -import org.apache.commons.vfs2.provider.local.LocalFile; import org.apache.commons.vfs2.util.FileObjectUtils; import org.apache.commons.vfs2.util.RandomAccessMode; Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/MultipleConnectionTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/MultipleConnectionTestCase.java?rev=1352143r1=1352142r2=1352143view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/MultipleConnectionTestCase.java (original) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftp/test/MultipleConnectionTestCase.java Wed Jun 20 15:02:13 2012 @@ -10,7 +10,6 @@ import org.apache.commons.vfs2.FileSyste import org.apache.commons.vfs2.VFS; import org.apache.ftpserver.ftplet.FtpException; import org.junit.AfterClass; -import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/url/test/UrlHttpProviderTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/url/test/UrlHttpProviderTestCase.java?rev=1352143r1=1352142r2=1352143view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/url/test/UrlHttpProviderTestCase.java (original) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/url/test/UrlHttpProviderTestCase.java Wed Jun 20 15:02:13 2012 @@ -17,7 +17,6 @@ package org.apache.commons.vfs2.provider.url.test; import java.io.File; -import java.net.URL; import junit.framework.Test; Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/url/test/UrlProviderTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/url/test/UrlProviderTestCase.java?rev=1352143r1=1352142r2=1352143view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2