svn commit: r1364892 - /commons/proper/digester/trunk/src/site/xdoc/index.xml

2012-07-23 Thread elijah
Author: elijah
Date: Tue Jul 24 05:12:40 2012
New Revision: 1364892

URL: http://svn.apache.org/viewvc?rev=1364892&view=rev
Log:
DIGESTER-166

Resolves broken hyperlink in the digester documentation that points to the
Core API page.


Modified:
commons/proper/digester/trunk/src/site/xdoc/index.xml

Modified: commons/proper/digester/trunk/src/site/xdoc/index.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/site/xdoc/index.xml?rev=1364892&r1=1364891&r2=1364892&view=diff
==
--- commons/proper/digester/trunk/src/site/xdoc/index.xml (original)
+++ commons/proper/digester/trunk/src/site/xdoc/index.xml Tue Jul 24 05:12:40 
2012
@@ -46,7 +46,7 @@ use, or you can also create your own.
 
 User documentation is available in the website, you can start reading the
-http://commons.apache.org/digester/commons-digester-3.0/core.html";>Core 
APIs.
+http://commons.apache.org/digester/guide/core.html";>Core APIs.
 
 The http://commons.apache.org/digester/commons-digester-3.0/RELEASE-NOTES.txt";>
 Release Notes document the new features and bug fixes that have been




svn commit: r1364793 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealMatrixFormat.java

2012-07-23 Thread tn
Author: tn
Date: Mon Jul 23 20:46:28 2012
New Revision: 1364793

URL: http://svn.apache.org/viewvc?rev=1364793&view=rev
Log:
[MATH-831] Use String.length check instead of isEmpty due to jdk1.5 
compatibility.

Modified:

commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealMatrixFormat.java

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealMatrixFormat.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealMatrixFormat.java?rev=1364793&r1=1364792&r2=1364793&view=diff
==
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealMatrixFormat.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealMatrixFormat.java
 Mon Jul 23 20:46:28 2012
@@ -323,7 +323,8 @@ public class RealMatrixFormat {
 if (!rowComponents.isEmpty()) {
 CompositeFormat.parseAndIgnoreWhitespace(source, pos);
 if (!CompositeFormat.parseFixedstring(source, 
trimmedColumnSeparator, pos)) {
-if (!trimmedRowSuffix.isEmpty() && 
!CompositeFormat.parseFixedstring(source, trimmedRowSuffix, pos)) {
+if (trimmedRowSuffix.length() != 0 &&
+!CompositeFormat.parseFixedstring(source, 
trimmedRowSuffix, pos)) {
 return null;
 } else {
 CompositeFormat.parseAndIgnoreWhitespace(source, pos);
@@ -338,7 +339,8 @@ public class RealMatrixFormat {
 }
 } else {
 CompositeFormat.parseAndIgnoreWhitespace(source, pos);
-if (!trimmedRowPrefix.isEmpty() && 
!CompositeFormat.parseFixedstring(source, trimmedRowPrefix, pos)) {
+if (trimmedRowPrefix.length() != 0 &&
+!CompositeFormat.parseFixedstring(source, 
trimmedRowPrefix, pos)) {
 return null;
 }
 }




svn commit: r1364784 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/EigenSolverTest.java

2012-07-23 Thread tn
Author: tn
Date: Mon Jul 23 20:20:07 2012
New Revision: 1364784

URL: http://svn.apache.org/viewvc?rev=1364784&view=rev
Log:
Use non-deprecated ctor.

Modified:

commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/EigenSolverTest.java

Modified: 
commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/EigenSolverTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/EigenSolverTest.java?rev=1364784&r1=1364783&r2=1364784&view=diff
==
--- 
commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/EigenSolverTest.java
 (original)
+++ 
commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/EigenSolverTest.java
 Mon Jul 23 20:20:07 2012
@@ -19,7 +19,6 @@ package org.apache.commons.math3.linear;
 
 import java.util.Random;
 
-import org.apache.commons.math3.util.Precision;
 import org.apache.commons.math3.exception.MathIllegalArgumentException;
 
 import org.junit.Test;
@@ -33,7 +32,7 @@ public class EigenSolverTest {
 Random r = new Random(9994100315209l);
 RealMatrix m =
 EigenDecompositionTest.createTestMatrix(r, new double[] { 1.0, 
0.0, -1.0, -2.0, -3.0 });
-DecompositionSolver es = new EigenDecomposition(m, 
Precision.SAFE_MIN).getSolver();
+DecompositionSolver es = new EigenDecomposition(m).getSolver();
 Assert.assertFalse(es.isNonSingular());
 try {
 es.getInverse();
@@ -49,7 +48,7 @@ public class EigenSolverTest {
 Random r = new Random(9994100315209l);
 RealMatrix m =
 EigenDecompositionTest.createTestMatrix(r, new double[] { 1.0, 
0.5, -1.0, -2.0, -3.0 });
-DecompositionSolver es = new EigenDecomposition(m, 
Precision.SAFE_MIN).getSolver();
+DecompositionSolver es = new EigenDecomposition(m).getSolver();
 Assert.assertTrue(es.isNonSingular());
 RealMatrix inverse = es.getInverse();
 RealMatrix error =
@@ -65,7 +64,7 @@ public class EigenSolverTest {
 };
 final RealMatrix matrix = EigenDecompositionTest.createTestMatrix(new 
Random(35992629946426l), refValues);
 
-DecompositionSolver es = new EigenDecomposition(matrix, 
Precision.SAFE_MIN).getSolver();
+DecompositionSolver es = new EigenDecomposition(matrix).getSolver();
 RealMatrix b = MatrixUtils.createRealMatrix(new double[2][2]);
 try {
 es.solve(b);
@@ -98,7 +97,7 @@ public class EigenSolverTest {
 { 40,  2, 21,  9, 51, 19 },
 { 14, -1,  8,  0, 19, 14 }
 });
-DecompositionSolver es = new EigenDecomposition(m, 
Precision.SAFE_MIN).getSolver();
+DecompositionSolver es = new EigenDecomposition(m).getSolver();
 RealMatrix b = MatrixUtils.createRealMatrix(new double[][] {
 { 1561, 269, 188 },
 {   69, -21,  70 },




svn commit: r1364783 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/EigenDecomposition.java

2012-07-23 Thread tn
Author: tn
Date: Mon Jul 23 20:19:52 2012
New Revision: 1364783

URL: http://svn.apache.org/viewvc?rev=1364783&view=rev
Log:
[MATH-235] Added a hasComplexEigenvalues method.

Modified:

commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/EigenDecomposition.java

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/EigenDecomposition.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/EigenDecomposition.java?rev=1364783&r1=1364782&r2=1364783&view=diff
==
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/EigenDecomposition.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/EigenDecomposition.java
 Mon Jul 23 20:19:52 2012
@@ -279,6 +279,24 @@ public class EigenDecomposition {
 }
 
 /**
+ * Returns whether the calculated eigen values are complex or real.
+ * The method performs a zero check for each element of the
+ * {@link #getImagEigenvalues()} array and returns {@code true} if any
+ * element is not equal to zero.
+ *
+ * @return {@code true} if the eigen values are complex, {@code false} 
otherwise
+ * @since 3.1
+ */
+public boolean hasComplexEigenvalues() {
+for (int i = 0; i < imagEigenvalues.length; i++) {
+if (!Precision.equals(imagEigenvalues[i], 0.0, epsilon)) {
+return true;
+}
+}
+return false;
+}
+
+/**
  * Gets a copy of the real parts of the eigenvalues of the original matrix.
  *
  * @return a copy of the real parts of the eigenvalues of the original 
matrix.
@@ -374,10 +392,8 @@ public class EigenDecomposition {
  * complex eigenvalues
  */
 public DecompositionSolver getSolver() {
-for (int i = 0; i < imagEigenvalues.length; i++) {
-if (imagEigenvalues[i] != 0.0) {
-throw new MathUnsupportedOperationException();
-}
+if (hasComplexEigenvalues()) {
+throw new MathUnsupportedOperationException();
 }
 return new Solver(realEigenvalues, imagEigenvalues, eigenvectors);
 }




svn commit: r1364779 - /commons/proper/math/trunk/src/changes/changes.xml

2012-07-23 Thread tn
Author: tn
Date: Mon Jul 23 20:07:29 2012
New Revision: 1364779

URL: http://svn.apache.org/viewvc?rev=1364779&view=rev
Log:
Added MATH-831 to changes.xml.

Modified:
commons/proper/math/trunk/src/changes/changes.xml

Modified: commons/proper/math/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/changes/changes.xml?rev=1364779&r1=1364778&r2=1364779&view=diff
==
--- commons/proper/math/trunk/src/changes/changes.xml (original)
+++ commons/proper/math/trunk/src/changes/changes.xml Mon Jul 23 20:07:29 2012
@@ -52,6 +52,11 @@ If the output is not quite correct, chec
   
 
+  
+Added a new "RealMatrixFormat" class for input/output of RealMatrix 
instances.
+Default formatter instances for commons-math and octave have been 
added to
+"MatrixUtils".
+  
   
 New "IterativeLegendreGaussIntegrator" that performs the same automatic
 subdivision of the integration interval as "LegendreGaussIntegrator",
@@ -60,7 +65,7 @@ If the output is not quite correct, chec
 Deprecated "LegendreGaussIntegrator".
   
   
-Improve performance of quantile evaluation in Percentile class for 
cases
+Improve performance of quantile evaluation in "Percentile" class for 
cases
 with lots of equal values.
   
   
@@ -77,7 +82,7 @@ If the output is not quite correct, chec
 delegating to the methods in "RandomData".
   
  
-Added support for real asymmetric matrices to EigenDecomposition.
+Added support for real asymmetric matrices to "EigenDecomposition".
   
   
 Re-instated methods to find all complex roots of a polynomial (class
@@ -87,7 +92,7 @@ If the output is not quite correct, chec
 Added accessors to the "Pair" class (package "o.a.c.m.util").
   
  
-Added new constructors in EigenDecomposition and deprecated two 
constructors
+Added new constructors in "EigenDecomposition" and deprecated two 
constructors
 with unused parameters.
   
   
@@ -119,7 +124,7 @@ If the output is not quite correct, chec
 an acceptable compatibility break, as these fields are only meant for 
internal use.
   
   
-Fix computation of upperCumulativeProbability in 
HypergeometricDistribution and
+Fix computation of upperCumulativeProbability in 
"HypergeometricDistribution" and
 cleanup of duplicate probability mass function.
   
   




svn commit: r1364775 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math3/linear/ test/java/org/apache/commons/math3/linear/

2012-07-23 Thread tn
Author: tn
Date: Mon Jul 23 19:56:59 2012
New Revision: 1364775

URL: http://svn.apache.org/viewvc?rev=1364775&view=rev
Log:
[MATH-831] Change default format, add static fields in MatrixUtils, replace 
toString() implementation in AbstractRealMatrix with the default 
RealMatrixFormat.

Modified:

commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/AbstractRealMatrix.java

commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/MatrixUtils.java

commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealMatrixFormat.java

commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealMatrixFormatAbstractTest.java

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/AbstractRealMatrix.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/AbstractRealMatrix.java?rev=1364775&r1=1364774&r2=1364775&view=diff
==
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/AbstractRealMatrix.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/AbstractRealMatrix.java
 Mon Jul 23 19:56:59 2012
@@ -38,6 +38,14 @@ import org.apache.commons.math3.util.Fas
 public abstract class AbstractRealMatrix
 extends RealLinearOperator
 implements RealMatrix {
+
+/** Default format. */
+private static final RealMatrixFormat DEFAULT_FORMAT = 
RealMatrixFormat.getInstance();
+static {
+// set the minimum fraction digits to 1 to keep compatibility
+DEFAULT_FORMAT.getFormat().setMinimumFractionDigits(1);
+}
+
 /**
  * Creates a matrix with no data
  */
@@ -871,28 +879,11 @@ public abstract class AbstractRealMatrix
  */
 @Override
 public String toString() {
-final int nRows = getRowDimension();
-final int nCols = getColumnDimension();
-final StringBuffer res = new StringBuffer();
+final StringBuilder res = new StringBuilder();
 String fullClassName = getClass().getName();
 String shortClassName = 
fullClassName.substring(fullClassName.lastIndexOf('.') + 1);
-res.append(shortClassName).append("{");
-
-for (int i = 0; i < nRows; ++i) {
-if (i > 0) {
-res.append(",");
-}
-res.append("{");
-for (int j = 0; j < nCols; ++j) {
-if (j > 0) {
-res.append(",");
-}
-res.append(getEntry(i, j));
-}
-res.append("}");
-}
-
-res.append("}");
+res.append(shortClassName);
+res.append(DEFAULT_FORMAT.format(this));
 return res.toString();
 }
 

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/MatrixUtils.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/MatrixUtils.java?rev=1364775&r1=1364774&r2=1364775&view=diff
==
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/MatrixUtils.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/MatrixUtils.java
 Mon Jul 23 19:56:59 2012
@@ -47,6 +47,18 @@ import org.apache.commons.math3.util.Pre
 public class MatrixUtils {
 
 /**
+ * The default format for {@link RealMatrix} objects.
+ * @since 3.1
+ */
+public static final RealMatrixFormat DEFAULT_FORMAT = 
RealMatrixFormat.getInstance();
+
+/**
+ * A format for {@link RealMatrix} objects compatible with octave.
+ * @since 3.1
+ */
+public static final RealMatrixFormat OCTAVE_FORMAT = new 
RealMatrixFormat("[", "]", "", "", "; ", ", ");
+
+/**
  * Private constructor.
  */
 private MatrixUtils() {

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealMatrixFormat.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealMatrixFormat.java?rev=1364775&r1=1364774&r2=1364775&view=diff
==
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealMatrixFormat.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/RealMatrixFormat.java
 Mon Jul 23 19:56:59 2012
@@ -29,19 +29,19 @@ import org.apache.commons.math3.util.Com
 
 /**
  * Formats a {@code nxm} matrix in components list format
- * "[a00, a01, ...,
- * a0m-1; a10,
- * a11, ..., a1m-1; ...;
+ * "{{a00,a01, ...,
+ * a0m-1},{a10,
+ * a11, ..., a1m-1},{...},{
  * an-10, an-11, ...,
- * an-1m-1}".
- * The prefix and suffix "[" and "]", the row separator "; " and the column
- * separator

svn commit: r1364767 - in /commons/proper/functor/trunk/src: main/java/org/apache/commons/functor/core/ test/java/org/apache/commons/functor/core/

2012-07-23 Thread kinow
Author: kinow
Date: Mon Jul 23 19:36:08 2012
New Revision: 1364767

URL: http://svn.apache.org/viewvc?rev=1364767&view=rev
Log:
[FUNCTOR-12] Tests for functor core. RightIdentity wasn't using the prodedure() 
method, but duplicating the code for this method in two places. This commit 
fixes it too. LeftIdentity had the right code, so no change was necessary.

Tests using try/catch + fail() were updated to use 
@Test(expected=SomeException.class).

Modified:

commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/RightIdentity.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsEqual.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsNotEqual.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsNotSame.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsSame.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestLeftIdentity.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestLimit.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestNoOp.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestOffset.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestRightIdentity.java

Modified: 
commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/RightIdentity.java
URL: 
http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/RightIdentity.java?rev=1364767&r1=1364766&r2=1364767&view=diff
==
--- 
commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/RightIdentity.java
 (original)
+++ 
commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/RightIdentity.java
 Mon Jul 23 19:36:08 2012
@@ -39,8 +39,7 @@ public final class RightIdentity {
 /**
  * Right-identity predicate.
  */
-public static final BinaryPredicate PREDICATE =
-BinaryFunctionBinaryPredicate.adapt(IgnoreLeftFunction.adapt(new 
Identity()));
+public static final BinaryPredicate PREDICATE = 
RightIdentity.predicate();
 
 // constructor
 // 

Modified: 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java
URL: 
http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java?rev=1364767&r1=1364766&r2=1364767&view=diff
==
--- 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java
 (original)
+++ 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestConstant.java
 Mon Jul 23 19:36:08 2012
@@ -94,6 +94,8 @@ public class TestConstant extends BaseFu
 assertObjectsAreEqual(f,new Constant("xyzzy"));
 assertObjectsAreNotEqual(f,new Constant("abcde"));
 assertObjectsAreNotEqual(f,new Constant(null));
+assertObjectsAreEqual(new Constant(null),new 
Constant(null));
+assertTrue(!f.equals(null));
 }
 
 @Test

Modified: 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsEqual.java
URL: 
http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsEqual.java?rev=1364767&r1=1364766&r2=1364767&view=diff
==
--- 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsEqual.java
 (original)
+++ 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsEqual.java
 Mon Jul 23 19:36:08 2012
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTru
 
 import org.apache.commons.functor.BaseFunctorTest;
 import org.apache.commons.functor.BinaryPredicate;
+import org.apache.commons.functor.UnaryPredicate;
 import org.junit.Test;
 
 /**
@@ -75,4 +76,11 @@ public class TestIsEqual extends BaseFun
 assertNotSame(IsEqual.instance(), IsEqual.instance());
 assertSame(IsEqual.INSTANCE, IsEqual.INSTANCE);
 }
+
+@Test
+public void testToUnaryPredicate() {
+   UnaryPredicate isEqual = IsEqual.to(new Integer(1));
+   assertTrue(isEqual.test(new Integer(1)));
+   assertFalse(isEqual.test(new Integer(2)));
+}
 }

Modified: 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsNotEqual.java
URL: 
http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/TestIsNotEqual.

svn commit: r1364742 - in /commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection: TestFilteredIterable.java TestFilteredIterator.java TestTransformedIterator.java

2012-07-23 Thread kinow
Author: kinow
Date: Mon Jul 23 18:20:48 2012
New Revision: 1364742

URL: http://svn.apache.org/viewvc?rev=1364742&view=rev
Log:
[FUNCTOR-12] Tests for functor core collections.

Modified:

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterable.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterator.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestTransformedIterator.java

Modified: 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterable.java
URL: 
http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterable.java?rev=1364742&r1=1364741&r2=1364742&view=diff
==
--- 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterable.java
 (original)
+++ 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/collection/TestFilteredIterable.java
 Mon Jul 23 18:20:48 2012
@@ -20,7 +20,6 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 import java.math.BigInteger;
 import java.util.ArrayList;
@@ -90,11 +89,14 @@ public class TestFilteredIterable extend
 public void testSomePass() {
 Iterator expected = evens.iterator();
 
-for (Integer i : FilteredIterable.of(list).retain(isEven)) {
+FilteredIterable filter = FilteredIterable.of(list);
+
+for (Integer i : filter.retain(isEven)) {
 assertTrue(expected.hasNext());
 assertEquals(expected.next(), i);
 }
 assertFalse(expected.hasNext());
+assertEquals(filter,filter.retain(isEven));
 }
 
 @Test
@@ -120,7 +122,11 @@ public class TestFilteredIterable extend
 
 @Test
 public void testEmptyFilteredIterable() {
-assertFalse(FilteredIterable.empty().iterator().hasNext());
+FilteredIterable emptyFilter = FilteredIterable.empty();
+assertFalse(emptyFilter.iterator().hasNext());
+assertEquals(emptyFilter,emptyFilter.retain(isEven));
+assertEquals(emptyFilter,emptyFilter.retain(Integer.class));
+
assertEquals(emptyFilter,emptyFilter.retain(Integer.class,Number.class));
 }
 
 @Test
@@ -143,53 +149,33 @@ public class TestFilteredIterable extend
 assertFalse(testing.hasNext());
 }
 
-@Test
+@Test(expected=NoSuchElementException.class)
 public void testNextAfterEndOfList() {
 Iterator testing = 
FilteredIterable.of(list).retain(isEven).iterator();
 Iterator expected = evens.iterator();
 while (expected.hasNext()) {
 assertEquals(expected.next(), testing.next());
 }
-try {
-testing.next();
-fail("Expected NoSuchElementException");
-} catch (NoSuchElementException e) {
-// expected
-}
+testing.next();
 }
 
-@Test
+@Test(expected=NoSuchElementException.class)
 public void testNextOnEmptyList() {
-try {
-FilteredIterable.empty().iterator().next();
-fail("Expected NoSuchElementException");
-} catch (NoSuchElementException e) {
-// expected
-}
+FilteredIterable.empty().iterator().next();
 }
 
-@Test
+@Test(expected=IllegalStateException.class)
 public void testRemoveBeforeNext() {
 Iterator testing = 
FilteredIterable.of(list).retain(isEven).iterator();
-try {
-testing.remove();
-fail("Expected IllegalStateException");
-} catch (IllegalStateException e) {
-// expected
-}
+testing.remove();
 }
 
-@Test
+@Test(expected=IllegalStateException.class)
 public void testRemoveAfterNext() {
 Iterator testing = 
FilteredIterable.of(list).retain(isEven).iterator();
 testing.next();
 testing.remove();
-try {
-testing.remove();
-fail("Expected IllegalStateException");
-} catch (IllegalStateException e) {
-// expected
-}
+testing.remove();
 }
 
 @Test
@@ -228,6 +214,12 @@ public class TestFilteredIterable extend
 }
 
 @Test
+public void testFilterWithFilteredIterableReturnsItself() {
+FilteredIterable filter = FilteredIterable.of(list);
+assertEquals(filter,FilteredIterable.of(filter));
+}
+
+@Test
 public void testRetainOneType() {
 Iterable objects = Arrays.asList((Object) "foo", "bar", "baz", 
2L, BigInteger.ZERO);
 Iterable strings = 
FilteredIterable.of(objects).retain(String.class

svn commit: r1364727 - /commons/proper/imaging/trunk/

2012-07-23 Thread ggregory
Author: ggregory
Date: Mon Jul 23 17:29:28 2012
New Revision: 1364727

URL: http://svn.apache.org/viewvc?rev=1364727&view=rev
Log:
Ignore some Eclipse artifacts.

Modified:
commons/proper/imaging/trunk/   (props changed)

Propchange: commons/proper/imaging/trunk/
--
--- svn:ignore (original)
+++ svn:ignore Mon Jul 23 17:29:28 2012
@@ -3,3 +3,5 @@ target
 .project
 .classpath
 tmp
+.externalToolBuilders
+maven-eclipse.xml




svn commit: r1364725 - /commons/proper/imaging/tags/IMAGING_1_0_RC2/

2012-07-23 Thread damjan
Author: damjan
Date: Mon Jul 23 17:24:34 2012
New Revision: 1364725

URL: http://svn.apache.org/viewvc?rev=1364725&view=rev
Log:
Creating IMAGING_1_0_RC2 tag

Added:
commons/proper/imaging/tags/IMAGING_1_0_RC2/
  - copied from r1364724, commons/proper/imaging/trunk/



svn commit: r1364723 - in /commons/proper/imaging/trunk/src/site: site.xml xdoc/index.xml xdoc/justification.xml xdoc/whyimaging.xml

2012-07-23 Thread damjan
Author: damjan
Date: Mon Jul 23 17:21:15 2012
New Revision: 1364723

URL: http://svn.apache.org/viewvc?rev=1364723&view=rev
Log:
Update some website pages, and fix broken links.


Added:
commons/proper/imaging/trunk/src/site/xdoc/whyimaging.xml
  - copied, changed from r1364499, 
commons/proper/imaging/trunk/src/site/xdoc/justification.xml
Removed:
commons/proper/imaging/trunk/src/site/xdoc/justification.xml
Modified:
commons/proper/imaging/trunk/src/site/site.xml
commons/proper/imaging/trunk/src/site/xdoc/index.xml

Modified: commons/proper/imaging/trunk/src/site/site.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/site/site.xml?rev=1364723&r1=1364722&r2=1364723&view=diff
==
--- commons/proper/imaging/trunk/src/site/site.xml (original)
+++ commons/proper/imaging/trunk/src/site/site.xml Mon Jul 23 17:21:15 2012
@@ -38,7 +38,6 @@
   
   
   
-  
   
   
   

Modified: commons/proper/imaging/trunk/src/site/xdoc/index.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/site/xdoc/index.xml?rev=1364723&r1=1364722&r2=1364723&view=diff
==
--- commons/proper/imaging/trunk/src/site/xdoc/index.xml (original)
+++ commons/proper/imaging/trunk/src/site/xdoc/index.xml Mon Jul 23 17:21:15 
2012
@@ -40,7 +40,7 @@
   more formats (and supports them more correctly). It also provides easy 
access to metadata.
 
 
-  Although not yet version 1.0, sanselan is working and is used by a number of 
projects in production.
+  Imaging was working and was used by a number of projects in production even 
before version 1.0.
 
 
   This project is Open Source; free as in freedom and free as in beer.

Copied: commons/proper/imaging/trunk/src/site/xdoc/whyimaging.xml (from 
r1364499, commons/proper/imaging/trunk/src/site/xdoc/justification.xml)
URL: 
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/site/xdoc/whyimaging.xml?p2=commons/proper/imaging/trunk/src/site/xdoc/whyimaging.xml&p1=commons/proper/imaging/trunk/src/site/xdoc/justification.xml&r1=1364499&r2=1364723&rev=1364723&view=diff
==
--- commons/proper/imaging/trunk/src/site/xdoc/justification.xml (original)
+++ commons/proper/imaging/trunk/src/site/xdoc/whyimaging.xml Mon Jul 23 
17:21:15 2012
@@ -22,60 +22,60 @@ limitations under the License.
  
 
 
-
+
 
 
 Why another image library? There are so many already.
 
 
 
-Apache Commons Imaging is Pure Java. Consequently it's slow, but perfectly 
portable.
+Apache Commons Imaging is written in 100% pure Java. It will run on any 
JVM, and any platform, without modification.
 
 
 
-It is designed to be very easy to use. See the Sample Usage section.
+There are no dependencies. Commons Imaging only requires Java 1.5 or later.
 
 
 
-This library supports some variations and encodings missed by all or most 
other libaries.
+It is designed to be very easy to use. It has a simple, clean interface. 
Most operations are a single Imaging method call. See the Sample Usage section.
 
 
 
-Most other libraries offer little or incomplete support for ICC Profiles.
-Commons Imaging can extract and (simply) parse embedded ICC Profiles.
-Moreover, it applies the ICC profile by default, coverting read images to 
sRGB.
-This means images are color-corrected by default.
-see: http://en.wikipedia.org/wiki/International_Color_Consortium";>http://en.wikipedia.org/wiki/International_Color_Consortium,
-http://en.wikipedia.org/wiki/SRGB";>http://en.wikipedia.org/wiki/SRGB
+Commons Imaging aims to be transparent. There are no hidden buffers to 
dispose, no native memory to free, no background threads.
 
 
 
-Commons Imaging also lets you read in image info (ie. width, height or 
colorspace) and metadata without
-"reading" the entire image. It presents image info and metadata in a 
format-neutral manner.
+It reads and writes a wide variety of image formats, and supports some 
variations and encodings missed by all or most other libaries. See the Format Support list.
+
+
+
+Commons Imaging does more than read and write images. Reading image info 
(image size, colorspace, bit depth, etc.) and metadata is easy, and does not 
require reading the image pixels.
+It presents image info and metadata in a format-neutral manner.
 It also gives easy, structured access to format-specific info.
 
 
 
-This library was written with an eye to correctness and code clarity 
rather than efficiency.
-Hopefully it is easy to use, easy to extend and can be used to explore 
images + image formats,
-rather than just read images for display.
+It supports reading and writing a variety of metadata in a structured way, 
including EXIF metadata.
 
 
 
-This libr

svn commit: r1364704 - /commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/

2012-07-23 Thread kinow
Author: kinow
Date: Mon Jul 23 16:40:49 2012
New Revision: 1364704

URL: http://svn.apache.org/viewvc?rev=1364704&view=rev
Log:
[FUNCTOR-12] Tests for functor core comparators.

Modified:

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsEquivalent.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThan.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThanOrEqual.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsLessThan.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsLessThanOrEqual.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsNotEquivalent.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestMax.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestMin.java

Modified: 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsEquivalent.java
URL: 
http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsEquivalent.java?rev=1364704&r1=1364703&r2=1364704&view=diff
==
--- 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsEquivalent.java
 (original)
+++ 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsEquivalent.java
 Mon Jul 23 16:40:49 2012
@@ -17,6 +17,7 @@
 package org.apache.commons.functor.core.comparator;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.functor.core.Constant;
@@ -59,9 +60,10 @@ public class TestIsEquivalent extends Ba
 IsEquivalent> p = IsEquivalent.INSTANCE;
 assertEquals(p,p);
 
-assertObjectsAreEqual(p,IsEquivalent.instance());
+assertObjectsAreEqual(p,new IsEquivalent>());
 assertObjectsAreEqual(p,new 
IsEquivalent(ComparableComparator.instance()));
 assertObjectsAreNotEqual(p,Constant.FALSE);
+assertFalse(p.equals(null));
 }
 
 }

Modified: 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThan.java
URL: 
http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThan.java?rev=1364704&r1=1364703&r2=1364704&view=diff
==
--- 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThan.java
 (original)
+++ 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThan.java
 Mon Jul 23 16:40:49 2012
@@ -64,6 +64,7 @@ public class TestIsGreaterThan extends B
 assertObjectsAreEqual(p,new 
IsGreaterThan(ComparableComparator.instance()));
 assertObjectsAreEqual(p,IsGreaterThan.instance());
 assertObjectsAreNotEqual(p,Constant.FALSE);
+assertFalse(p.equals(null));
 }
 
 }

Modified: 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThanOrEqual.java
URL: 
http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThanOrEqual.java?rev=1364704&r1=1364703&r2=1364704&view=diff
==
--- 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThanOrEqual.java
 (original)
+++ 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThanOrEqual.java
 Mon Jul 23 16:40:49 2012
@@ -64,6 +64,7 @@ public class TestIsGreaterThanOrEqual ex
 assertObjectsAreEqual(p,new 
IsGreaterThanOrEqual(ComparableComparator.instance()));
 assertObjectsAreEqual(p,IsGreaterThanOrEqual.instance());
 assertObjectsAreNotEqual(p,Constant.FALSE);
+assertFalse(p.equals(null));
 }
 
 }

Modified: 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsLessThan.java
URL: 
http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsLessThan.java?rev=1364704&r1=1364703&r2=1364704&view=diff
==
--- 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsLessThan.java
 (original)
+++ 
commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comp

svn commit: r1364692 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java

2012-07-23 Thread ggregory
Author: ggregory
Date: Mon Jul 23 15:56:23 2012
New Revision: 1364692

URL: http://svn.apache.org/viewvc?rev=1364692&view=rev
Log:
Rename another private method urlString to toUrlString.

Modified:

commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java?rev=1364692&r1=1364691&r2=1364692&view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
 Mon Jul 23 15:56:23 2012
@@ -147,7 +147,7 @@ public class WebdavFileObject extends Ht
 DavPropertyNameSet nameSet = new DavPropertyNameSet();
 
nameSet.add(DavPropertyName.create(DavConstants.PROPERTY_DISPLAYNAME));
 
-method = new PropFindMethod(urlString(name), nameSet,
+method = new PropFindMethod(toUrlString(name), nameSet,
 DavConstants.DEPTH_1);
 
 execute(method);
@@ -207,7 +207,7 @@ public class WebdavFileObject extends Ht
 @Override
 protected void doCreateFolder() throws Exception
 {
-DavMethod method = new MkColMethod(urlString((URLFileName) getName()));
+DavMethod method = new MkColMethod(toUrlString((URLFileName) 
getName()));
 setupMethod(method);
 try
 {
@@ -226,7 +226,7 @@ public class WebdavFileObject extends Ht
 @Override
 protected void doDelete() throws Exception
 {
-DavMethod method = new DeleteMethod(urlString((URLFileName) 
getName()));
+DavMethod method = new DeleteMethod(toUrlString((URLFileName) 
getName()));
 setupMethod(method);
 execute(method);
 }
@@ -237,7 +237,7 @@ public class WebdavFileObject extends Ht
 @Override
 protected void doRename(FileObject newFile) throws Exception
 {
-String url = encodePath(urlString((URLFileName) getName()));
+String url = encodePath(toUrlString((URLFileName) getName()));
 String dest = toUrlString((URLFileName) newFile.getName(), false);
 DavMethod method = new MoveMethod(url, dest, false);
 setupMethod(method);
@@ -337,7 +337,7 @@ public class WebdavFileObject extends Ht
 try
 {
 URLFileName fileName = (URLFileName) getName();
-String urlStr = urlString(fileName);
+String urlStr = toUrlString(fileName);
 DavPropertySet properties = new DavPropertySet();
 DavPropertyNameSet propertyNameSet = new DavPropertyNameSet();
 DavProperty property = new DefaultDavProperty(attrName, value, 
Namespace.EMPTY_NAMESPACE);
@@ -500,7 +500,7 @@ public class WebdavFileObject extends Ht
 {
 try
 {
-String urlStr = urlString(name);
+String urlStr = toUrlString(name);
 PropFindMethod method = new PropFindMethod(urlStr, type, nameSet, 
DavConstants.DEPTH_0);
 setupMethod(method);
 execute(method);
@@ -545,7 +545,7 @@ public class WebdavFileObject extends Ht
 return i >= 0 ? path.substring(i + 1) : path;
 }
 
-private String urlString(URLFileName name)
+private String toUrlString(URLFileName name)
 {
 return toUrlString(name, true);
 }
@@ -633,7 +633,7 @@ public class WebdavFileObject extends Ht
 {
 RequestEntity entity = new 
ByteArrayRequestEntity(((ByteArrayOutputStream) out).toByteArray());
 URLFileName fileName = (URLFileName) getName();
-String urlStr = urlString(fileName);
+String urlStr = toUrlString(fileName);
 if (builder.isVersioning(getFileSystem().getFileSystemOptions()))
 {
 DavPropertySet set = null;




svn commit: r1364691 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java

2012-07-23 Thread ggregory
Author: ggregory
Date: Mon Jul 23 15:55:43 2012
New Revision: 1364691

URL: http://svn.apache.org/viewvc?rev=1364691&view=rev
Log:
Rename private method urlString to toUrlString.

Modified:

commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java?rev=1364691&r1=1364690&r2=1364691&view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
 Mon Jul 23 15:55:43 2012
@@ -238,7 +238,7 @@ public class WebdavFileObject extends Ht
 protected void doRename(FileObject newFile) throws Exception
 {
 String url = encodePath(urlString((URLFileName) getName()));
-String dest = urlString((URLFileName) newFile.getName(), false);
+String dest = toUrlString((URLFileName) newFile.getName(), false);
 DavMethod method = new MoveMethod(url, dest, false);
 setupMethod(method);
 execute(method);
@@ -547,17 +547,17 @@ public class WebdavFileObject extends Ht
 
 private String urlString(URLFileName name)
 {
-return urlString(name, true);
+return toUrlString(name, true);
 }
 
 /**
- * Convert the FileName to an encoded url String.
+ * Converts the given URLFileName to an encoded URL String.
  *
  * @param name The FileName.
  * @param includeUserInfo true if user information should be included.
  * @return The encoded URL String.
  */
-private String urlString(URLFileName name, boolean includeUserInfo)
+private String toUrlString(URLFileName name, boolean includeUserInfo)
 {
 String user = null;
 String password = null;




svn commit: r1364689 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java

2012-07-23 Thread ggregory
Author: ggregory
Date: Mon Jul 23 15:53:56 2012
New Revision: 1364689

URL: http://svn.apache.org/viewvc?rev=1364689&view=rev
Log:
In-line unused local var.

Modified:

commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java?rev=1364689&r1=1364688&r2=1364689&view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java
 Mon Jul 23 15:53:56 2012
@@ -187,8 +187,7 @@ public class HttpFileObject

svn commit: r1364684 - in /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider: http/HttpFileObject.java webdav/WebdavFileObject.java

2012-07-23 Thread ggregory
Author: ggregory
Date: Mon Jul 23 15:35:51 2012
New Revision: 1364684

URL: http://svn.apache.org/viewvc?rev=1364684&view=rev
Log:
[VFS-429] Remove extra FileSystem ivar in AbstractFileObject subclasses with 
generics.

Modified:

commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java

commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java?rev=1364684&r1=1364683&r2=1364684&view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java
 Mon Jul 23 15:35:51 2012
@@ -41,22 +41,24 @@ import org.apache.commons.vfs2.util.Moni
 import org.apache.commons.vfs2.util.RandomAccessMode;
 
 /**
- * A file object backed by commons httpclient.
+ * A file object backed by Apache Commons HttpClient.
+ * 
+ * @param  An {@link HttpFileSystem} subclass
  *
  * @todo status codes
  */
-public class HttpFileObject extends AbstractFileObject
+public class HttpFileObject extends 
AbstractFileObject
 {
 private final String urlCharset;
 private final boolean followRedirect;
 private HeadMethod method;
 
-protected HttpFileObject(final AbstractFileName name, final HttpFileSystem 
fileSystem)
+protected HttpFileObject(final AbstractFileName name, final FS fileSystem)
 {
 this(name, fileSystem, HttpFileSystemConfigBuilder.getInstance());
 }
 
-protected HttpFileObject(final AbstractFileName name, final HttpFileSystem 
fileSystem, final HttpFileSystemConfigBuilder builder)
+protected HttpFileObject(final AbstractFileName name, final FS fileSystem, 
final HttpFileSystemConfigBuilder builder)
 {
 super(name, fileSystem);
 final FileSystemOptions fileSystemOptions = 
fileSystem.getFileSystemOptions();

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java?rev=1364684&r1=1364683&r2=1364684&view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
 Mon Jul 23 15:35:51 2012
@@ -39,7 +39,6 @@ import org.apache.commons.vfs2.FileNotFo
 import org.apache.commons.vfs2.FileNotFoundException;
 import org.apache.commons.vfs2.FileObject;
 import org.apache.commons.vfs2.FileSystemException;
-import org.apache.commons.vfs2.FileSystemOptions;
 import org.apache.commons.vfs2.FileType;
 import org.apache.commons.vfs2.NameScope;
 import org.apache.commons.vfs2.provider.AbstractFileName;
@@ -78,7 +77,7 @@ import org.w3c.dom.Node;
  *
  * @since 2.0
  */
-public class WebdavFileObject extends HttpFileObject
+public class WebdavFileObject extends HttpFileObject
 {
 /** The character set property name. */
 public static final DavPropertyName RESPONSE_CHARSET = 
DavPropertyName.create(




svn commit: r1364679 - in /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider: http/HttpFileObject.java webdav/WebdavFileObject.java

2012-07-23 Thread ggregory
Author: ggregory
Date: Mon Jul 23 15:29:05 2012
New Revision: 1364679

URL: http://svn.apache.org/viewvc?rev=1364679&view=rev
Log:
Reuse org.apache.commons.vfs2.provider.http.HttpFileObject.urlCharset in WebDAV 
subclass through new accessor method.

Modified:

commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java

commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java?rev=1364679&r1=1364678&r2=1364679&view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java
 Mon Jul 23 15:29:05 2012
@@ -177,7 +177,7 @@ public class HttpFileObject extends Abst
  */
 protected void setupMethod(final HttpMethod method) throws 
FileSystemException, URIException
 {
-String pathEncoded = ((URLFileName) 
getName()).getPathQueryEncoded(urlCharset);
+String pathEncoded = ((URLFileName) 
getName()).getPathQueryEncoded(this.getUrlCharset());
 method.setPath(pathEncoded);
 method.setFollowRedirects(this.getFollowRedirect());
 method.setRequestHeader("User-Agent", "Jakarta-Commons-VFS");
@@ -225,6 +225,11 @@ public class HttpFileObject extends Abst
 return followRedirect;
 }
 
+protected String getUrlCharset()
+{
+return urlCharset;
+}
+
 HeadMethod getHeadMethod() throws IOException
 {
 if (method != null) {

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java?rev=1364679&r1=1364678&r2=1364679&view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java
 Mon Jul 23 15:29:05 2012
@@ -85,7 +85,6 @@ public class WebdavFileObject extends Ht
 "response-charset");
 
 private final WebdavFileSystem fileSystem;
-private final String urlCharset;
 
 /** The FileSystemConfigBuilder */
 private final WebdavFileSystemConfigBuilder builder;
@@ -95,8 +94,6 @@ public class WebdavFileObject extends Ht
 super(name, fileSystem, WebdavFileSystemConfigBuilder.getInstance());
 this.fileSystem = fileSystem;
 builder = (WebdavFileSystemConfigBuilder) 
WebdavFileSystemConfigBuilder.getInstance();
-final FileSystemOptions fileSystemOptions = 
fileSystem.getFileSystemOptions();
-this.urlCharset = builder.getUrlCharset(fileSystemOptions);
 }
 
 protected void configureMethod(HttpMethodBase httpMethod)
@@ -394,7 +391,7 @@ public class WebdavFileObject extends Ht
 @Override
 protected void setupMethod(final HttpMethod method) throws 
FileSystemException, URIException
 {
-String pathEncoded = ((URLFileName) 
getName()).getPathQueryEncoded(urlCharset);
+String pathEncoded = ((URLFileName) 
getName()).getPathQueryEncoded(this.getUrlCharset());
 method.setPath(pathEncoded);
 method.setFollowRedirects(this.getFollowRedirect());
 method.setRequestHeader("User-Agent", "Jakarta-Commons-VFS");
@@ -575,7 +572,7 @@ public class WebdavFileObject extends Ht
 name.getPath(), name.getType(), name.getQueryString());
 try
 {
-return newFile.getURIEncoded(urlCharset);
+return newFile.getURIEncoded(this.getUrlCharset());
 }
 catch (Exception e)
 {
@@ -606,7 +603,7 @@ public class WebdavFileObject extends Ht
 name.getPath(), name.getType(), name.getQueryString());
 try
 {
-return newFile.getURIEncoded(urlCharset);
+return newFile.getURIEncoded(this.getUrlCharset());
 }
 catch (Exception e)
 {




svn commit: r1364676 - in /commons/proper/functor/trunk/src: changes/ main/java/org/apache/commons/functor/core/comparator/ test/java/org/apache/commons/functor/core/comparator/

2012-07-23 Thread kinow
Author: kinow
Date: Mon Jul 23 15:21:25 2012
New Revision: 1364676

URL: http://svn.apache.org/viewvc?rev=1364676&view=rev
Log:
[FUNCTOR-22] Added generics to ComparableComparator. Few other classes that 
used the ComparableComparator were updated too. Tests were also updated 
accordingly. 

Modified:
commons/proper/functor/trunk/src/changes/changes.xml

commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparableComparator.java

commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparatorFunction.java

commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsEquivalent.java

commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThan.java

commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java

commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThan.java

commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsLessThanOrEqual.java

commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/IsNotEquivalent.java

commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Max.java

commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/Min.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestComparableComparator.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestComparatorFunction.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsEquivalent.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThan.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsGreaterThanOrEqual.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsLessThan.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsLessThanOrEqual.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestIsNotEquivalent.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestMax.java

commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/core/comparator/TestMin.java

Modified: commons/proper/functor/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/changes/changes.xml?rev=1364676&r1=1364675&r2=1364676&view=diff
==
--- commons/proper/functor/trunk/src/changes/changes.xml (original)
+++ commons/proper/functor/trunk/src/changes/changes.xml Mon Jul 23 15:21:25 
2012
@@ -23,6 +23,9 @@
   
   
 
+  
+Generify ComparableComparator.
+  
   
 Reduce the use of raw types in test classes.
   

Modified: 
commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparableComparator.java
URL: 
http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparableComparator.java?rev=1364676&r1=1364675&r2=1364676&view=diff
==
--- 
commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparableComparator.java
 (original)
+++ 
commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/comparator/ComparableComparator.java
 Mon Jul 23 15:21:25 2012
@@ -20,33 +20,37 @@ import java.io.Serializable;
 import java.util.Comparator;
 
 /**
- * See Commons-Collections for a public version
- * of this class.
+ * A {@link Comparator Comparator} that compares {@link Comparable Comparable}
+ * objects.
+ * 
+ * This class was created based on commons-collection's ComparableComparator.
  *
+ * @param  the comparable type
  * @version $Revision$ $Date$
  */
-@SuppressWarnings({ "unchecked", "rawtypes" })
-final class ComparableComparator implements Comparator, Serializable {
+final class ComparableComparator> implements 
Comparator, Serializable {
 
 /** Singleton. */
-public static final ComparableComparator INSTANCE = new 
ComparableComparator();
+@SuppressWarnings("rawtypes")
+public static final ComparableComparator INSTANCE = new 
ComparableComparator();
 
 /**
  * serialVersionUID declaration.
  */
-private static final long serialVersionUID = -5849476573719561212L;
+private static final long serialVersionUID = 9098756963321230038L;
 
 /**
  * Create a new ComparableComparator.
  */
 public ComparableComparator() {
+super(

svn commit: r1364668 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/SparseRealMatrixTest.java

2012-07-23 Thread erans
Author: erans
Date: Mon Jul 23 15:07:39 2012
New Revision: 1364668

URL: http://svn.apache.org/viewvc?rev=1364668&view=rev
Log:
Fixed typo (svn tag).

Modified:

commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/SparseRealMatrixTest.java

Modified: 
commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/SparseRealMatrixTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/SparseRealMatrixTest.java?rev=1364668&r1=1364667&r2=1364668&view=diff
==
--- 
commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/SparseRealMatrixTest.java
 (original)
+++ 
commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/SparseRealMatrixTest.java
 Mon Jul 23 15:07:39 2012
@@ -30,7 +30,6 @@ import org.apache.commons.math3.exceptio
  * Test cases for the {@link OpenMapRealMatrix} class.
  *
  * @version $Id$
- *  2008) $
  */
 public final class SparseRealMatrixTest {
 




svn commit: r1364590 - in /commons/sandbox/beanutils2/trunk/src: changes/ main/java/org/apache/commons/beanutils2/ test/java/org/apache/commons/beanutils2/

2012-07-23 Thread simonetripodi
Author: simonetripodi
Date: Mon Jul 23 11:52:51 2012
New Revision: 1364590

URL: http://svn.apache.org/viewvc?rev=1364590&view=rev
Log:
[SANDBOX-419] Implement setIndexed(String propertyName) on DefaultBeanAccessor 
- patch provided by Benedikt Ritter

Added:

commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultIndexedPropertySetter.java
   (with props)

commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/SetIndexedPropertyTestCase.java
   (with props)
Modified:
commons/sandbox/beanutils2/trunk/src/changes/changes.xml

commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java

commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultIndexedPropertySetterAccessor.java

Modified: commons/sandbox/beanutils2/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/changes/changes.xml?rev=1364590&r1=1364589&r2=1364590&view=diff
==
--- commons/sandbox/beanutils2/trunk/src/changes/changes.xml (original)
+++ commons/sandbox/beanutils2/trunk/src/changes/changes.xml Mon Jul 23 
11:52:51 2012
@@ -38,6 +38,9 @@
 
   Make sure VoidMethodsTestCase uses a NullBeanAcessor
 
+
+  Implement setIndexed(String propertyName) on DefaultBeanAccessor
+
 
   Implement copyPropertiesTo(T target) on DefaultBeanAccessor
 

Modified: 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java?rev=1364590&r1=1364589&r2=1364590&view=diff
==
--- 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java
 (original)
+++ 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java
 Mon Jul 23 11:52:51 2012
@@ -115,8 +115,9 @@ final class DefaultBeanAccessor
 public IndexedPropertySetterAccessor setIndexed( String propertyName )
 throws IllegalAccessException, IntrospectionException, 
InvocationTargetException, NoSuchMethodException
 {
-// TODO
-return null;
+checkNotNull( propertyName, "Parameter 'propertyName' must not be 
null!" );
+return new DefaultIndexedPropertySetterAccessor( bean, propertyName,
+
properties.getIndexedWriteMethod( propertyName ) );
 }
 
 /**

Added: 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultIndexedPropertySetter.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultIndexedPropertySetter.java?rev=1364590&view=auto
==
--- 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultIndexedPropertySetter.java
 (added)
+++ 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultIndexedPropertySetter.java
 Mon Jul 23 11:52:51 2012
@@ -0,0 +1,70 @@
+package org.apache.commons.beanutils2;
+
+/*
+ * 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.
+ */
+
+import static org.apache.commons.beanutils2.TypeUtils.isAssignmentCompatible;
+import static org.apache.commons.beanutils2.Assertions.checkArgument;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+final class DefaultIndexedPropertySetter
+implements BeanPropertySetter
+{
+
+private final B bean;
+
+private final Method setterMethod;
+
+private final int index;
+
+public DefaultIndexedPropertySetter( B bean, Method indexedSetterMethod, 
int index )
+{
+this.bean = bean;
+this.setterMethod = indexedSetterMethod;
+this.index = index;
+}
+
+/**
+ * {@inheritDoc}
+ */
+public  BeanAccessor with( V value )
+throws IllegalAccessExcepti

svn commit: r1364589 - /commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/IndexedPropertySetterAccessor.java

2012-07-23 Thread simonetripodi
Author: simonetripodi
Date: Mon Jul 23 11:40:02 2012
New Revision: 1364589

URL: http://svn.apache.org/viewvc?rev=1364589&view=rev
Log:
relocated license header

Modified:

commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/IndexedPropertySetterAccessor.java

Modified: 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/IndexedPropertySetterAccessor.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/IndexedPropertySetterAccessor.java?rev=1364589&r1=1364588&r2=1364589&view=diff
==
--- 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/IndexedPropertySetterAccessor.java
 (original)
+++ 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/IndexedPropertySetterAccessor.java
 Mon Jul 23 11:40:02 2012
@@ -1,7 +1,5 @@
 package org.apache.commons.beanutils2;
 
-import java.lang.reflect.InvocationTargetException;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -21,6 +19,8 @@ import java.lang.reflect.InvocationTarge
  * under the License.
  */
 
+import java.lang.reflect.InvocationTargetException;
+
 public interface IndexedPropertySetterAccessor
 {
 




svn commit: r1364579 - in /commons/sandbox/beanutils2/trunk/src: changes/ test/java/org/apache/commons/beanutils2/ test/java/org/apache/commons/beanutils2/testbeans/

2012-07-23 Thread simonetripodi
Author: simonetripodi
Date: Mon Jul 23 11:06:22 2012
New Revision: 1364579

URL: http://svn.apache.org/viewvc?rev=1364579&view=rev
Log:
[SANDBOX-429] Implement unit tests for MethodsRegistry - patch provided by 
Benedikt Ritter

Added:

commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/MethodsRegistryTestCase.java
   (with props)

commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/testbeans/

commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/testbeans/ThrowingExceptionBean.java
   (with props)
Modified:
commons/sandbox/beanutils2/trunk/src/changes/changes.xml

Modified: commons/sandbox/beanutils2/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/changes/changes.xml?rev=1364579&r1=1364578&r2=1364579&view=diff
==
--- commons/sandbox/beanutils2/trunk/src/changes/changes.xml (original)
+++ commons/sandbox/beanutils2/trunk/src/changes/changes.xml Mon Jul 23 
11:06:22 2012
@@ -23,6 +23,9 @@
   
   
   
+
+  Implement unit tests for MethodsRegistry
+
 
   Implement unit tests for ConstructorRegistry
 

Added: 
commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/MethodsRegistryTestCase.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/MethodsRegistryTestCase.java?rev=1364579&view=auto
==
--- 
commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/MethodsRegistryTestCase.java
 (added)
+++ 
commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/MethodsRegistryTestCase.java
 Mon Jul 23 11:06:22 2012
@@ -0,0 +1,150 @@
+package org.apache.commons.beanutils2;
+
+/*
+ * 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.
+ */
+
+import static java.lang.reflect.Modifier.isPublic;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.lang.reflect.Method;
+
+import org.apache.commons.beanutils2.testbeans.ThrowingExceptionBean;
+import org.junit.Test;
+
+public class MethodsRegistryTestCase
+{
+
+private final AccessibleObjectsRegistry methodsRegistry = 
AccessibleObjectsRegistry.getMethodsRegistry();
+
+@Test
+public void getWithName()
+{
+Method[] methods = TestBean.class.getMethods();
+for ( Method method : methods )
+{
+Method methodFromRegistry =
+methodsRegistry.get( false, TestBean.class, method.getName(), 
method.getParameterTypes() );
+assertNotNull( methodFromRegistry );
+assertEquals( method, methodFromRegistry );
+}
+}
+
+@Test
+public void getWithNameDifferentParameterType()
+throws Exception
+{
+Method methodFromBean = TestBean.class.getMethod( 
"setBooleanProperty", boolean.class );
+Method methodFromRegistry =
+methodsRegistry.get( false, TestBean.class, 
methodFromBean.getName(), Boolean.class );
+assertEquals( methodFromBean, methodFromRegistry );
+}
+
+@Test
+public void getExactWithName()
+{
+Method[] methods = TestBean.class.getMethods();
+for ( Method method : methods )
+{
+Method methodFromRegistry =
+methodsRegistry.get( true, TestBean.class, method.getName(), 
method.getParameterTypes() );
+assertNotNull( methodFromRegistry );
+assertEquals( method, methodFromRegistry );
+}
+}
+
+@Test
+public void getExactWithNameDifferentParameterType()
+throws Exception
+{
+Method methodFromBean = TestBean.class.getMethod( 
"setBooleanProperty", boolean.class );
+Method methodFromRegistry = methodsRegistry.get( true, TestBean.class, 
methodFromBean.getName(), Boolean.class );
+assertNull( 

svn commit: r1364578 - in /commons/sandbox/beanutils2/trunk/src: changes/changes.xml test/java/org/apache/commons/beanutils2/ConstructorRegistryTestCase.java

2012-07-23 Thread simonetripodi
Author: simonetripodi
Date: Mon Jul 23 10:59:51 2012
New Revision: 1364578

URL: http://svn.apache.org/viewvc?rev=1364578&view=rev
Log:
[SANDBOX-428] Implement unit tests for ConstructorRegistry - patch provided by 
Benedikt Ritter

Added:

commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/ConstructorRegistryTestCase.java
   (with props)
Modified:
commons/sandbox/beanutils2/trunk/src/changes/changes.xml

Modified: commons/sandbox/beanutils2/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/changes/changes.xml?rev=1364578&r1=1364577&r2=1364578&view=diff
==
--- commons/sandbox/beanutils2/trunk/src/changes/changes.xml (original)
+++ commons/sandbox/beanutils2/trunk/src/changes/changes.xml Mon Jul 23 
10:59:51 2012
@@ -23,6 +23,9 @@
   
   
   
+
+  Implement unit tests for ConstructorRegistry
+
 
   Suppress m2e plugin life cycle mapping errors
 

Added: 
commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/ConstructorRegistryTestCase.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/ConstructorRegistryTestCase.java?rev=1364578&view=auto
==
--- 
commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/ConstructorRegistryTestCase.java
 (added)
+++ 
commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/ConstructorRegistryTestCase.java
 Mon Jul 23 10:59:51 2012
@@ -0,0 +1,204 @@
+package org.apache.commons.beanutils2;
+
+/*
+ * 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.
+ */
+
+import static java.lang.String.format;
+import static java.lang.reflect.Modifier.isPublic;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.lang.reflect.Constructor;
+
+import org.junit.Test;
+
+public class ConstructorRegistryTestCase
+{
+
+private static final String WRONG_FOUND = "ConstructorRegistry resolved 
wrong constructor!";
+
+private static final String NON_FOUND = "ConstructorRegistry could not 
resolve constructor %s!";
+
+private final AccessibleObjectsRegistry> 
constructorRegistry =
+AccessibleObjectsRegistry.getConstructorsRegistry();
+
+@Test
+public void get()
+{
+Constructor[] constructors = TestBean.class.getConstructors();
+for ( Constructor constructor : constructors )
+{
+Constructor resolved = constructorRegistry.get( false, 
TestBean.class, constructor.getParameterTypes() );
+assertNotNull( format( NON_FOUND, constructor ), resolved );
+assertEquals( WRONG_FOUND, constructor, resolved );
+}
+}
+
+@Test
+public void getDifferentParameter()
+throws Exception
+{
+Constructor floatConstructor = 
TestBean.class.getConstructor( float.class );
+Constructor resolved = constructorRegistry.get( false, 
TestBean.class, Float.class );
+assertNotNull( format( NON_FOUND, floatConstructor ), resolved );
+assertEquals( WRONG_FOUND, floatConstructor, resolved );
+}
+
+@Test
+public void getExact()
+{
+Constructor[] constructors = TestBean.class.getConstructors();
+for ( Constructor constructor : constructors )
+{
+Constructor resolved = constructorRegistry.get( true, 
TestBean.class, constructor.getParameterTypes() );
+assertNotNull( format( NON_FOUND, constructor ), resolved );
+assertEquals( WRONG_FOUND, constructor, resolved );
+}
+}
+
+@Test
+public void getExactDifferentParameter()
+throws Exception
+{
+Constructor resolved = constructorRegistry.get( true, 
TestBean.class, Float.class );
+assertNull( format( "Constructor resolved constructor [%s] for 
parameter type Float on type TestBean although TestBean does not desc

svn commit: r1364575 - in /commons/sandbox/beanutils2/trunk: pom.xml src/changes/changes.xml

2012-07-23 Thread simonetripodi
Author: simonetripodi
Date: Mon Jul 23 10:53:10 2012
New Revision: 1364575

URL: http://svn.apache.org/viewvc?rev=1364575&view=rev
Log:
[SANDBOX-427] Suppress m2e plugin life cycle mapping errors - patch provided by 
Benedikt Ritter

Modified:
commons/sandbox/beanutils2/trunk/pom.xml
commons/sandbox/beanutils2/trunk/src/changes/changes.xml

Modified: commons/sandbox/beanutils2/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/pom.xml?rev=1364575&r1=1364574&r2=1364575&view=diff
==
--- commons/sandbox/beanutils2/trunk/pom.xml (original)
+++ commons/sandbox/beanutils2/trunk/pom.xml Mon Jul 23 10:53:10 2012
@@ -145,6 +145,56 @@
 
   
 
+
+
+
+
+org.eclipse.m2e
+lifecycle-mapping
+1.0.0
+
+
+
+
+
+
+org.apache.maven.plugins
+
+
+maven-antrun-plugin
+
+[1.6,)
+
+run
+
+
+
+
+
+
+
+
+org.apache.felix
+
+maven-bundle-plugin
+
+
+[2.3.5,)
+
+
+manifest
+
+
+
+
+
+
+
+
+
+
+
+
   
 
   

Modified: commons/sandbox/beanutils2/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/changes/changes.xml?rev=1364575&r1=1364574&r2=1364575&view=diff
==
--- commons/sandbox/beanutils2/trunk/src/changes/changes.xml (original)
+++ commons/sandbox/beanutils2/trunk/src/changes/changes.xml Mon Jul 23 
10:53:10 2012
@@ -23,6 +23,9 @@
   
   
   
+
+  Suppress m2e plugin life cycle mapping errors
+
 
   Add Cobertura Test Coverage Report to build
 




svn commit: r1364574 - in /commons/sandbox/beanutils2/trunk: pom.xml src/changes/changes.xml

2012-07-23 Thread simonetripodi
Author: simonetripodi
Date: Mon Jul 23 10:50:07 2012
New Revision: 1364574

URL: http://svn.apache.org/viewvc?rev=1364574&view=rev
Log:
[SANDBOX-426] Add Cobertura Test Coverage Report to build - patch provided by 
Benedikt Ritter

Modified:
commons/sandbox/beanutils2/trunk/pom.xml
commons/sandbox/beanutils2/trunk/src/changes/changes.xml

Modified: commons/sandbox/beanutils2/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/pom.xml?rev=1364574&r1=1364573&r2=1364574&view=diff
==
--- commons/sandbox/beanutils2/trunk/pom.xml (original)
+++ commons/sandbox/beanutils2/trunk/pom.xml Mon Jul 23 10:50:07 2012
@@ -185,6 +185,11 @@
 
 
   
+  
+org.codehaus.mojo
+cobertura-maven-plugin
+2.5.1
+  
 
   
 

Modified: commons/sandbox/beanutils2/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/changes/changes.xml?rev=1364574&r1=1364573&r2=1364574&view=diff
==
--- commons/sandbox/beanutils2/trunk/src/changes/changes.xml (original)
+++ commons/sandbox/beanutils2/trunk/src/changes/changes.xml Mon Jul 23 
10:50:07 2012
@@ -23,6 +23,9 @@
   
   
   
+
+  Add Cobertura Test Coverage Report to build
+
 
   Make sure VoidMethodsTestCase uses a NullBeanAcessor