svn commit: r1189623 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystem.java
Author: ggregory Date: Thu Oct 27 06:16:55 2011 New Revision: 1189623 URL: http://svn.apache.org/viewvc?rev=1189623view=rev Log: Fix Javadoc bug. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystem.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystem.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystem.java?rev=1189623r1=1189622r2=1189623view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystem.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileSystem.java Thu Oct 27 06:16:55 2011 @@ -51,7 +51,7 @@ public class WebdavFileSystem extends Ht /** * Returns the capabilities of this file system. - * @caps The Capabilities to add. + * @param caps The Capabilities to add. */ @Override protected void addCapabilities(final CollectionCapability caps)
svn commit: r1189626 - /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java
Author: mcucchiara Date: Thu Oct 27 06:20:48 2011 New Revision: 1189626 URL: http://svn.apache.org/viewvc?rev=1189626view=rev Log: Removed explicit object extension Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java?rev=1189626r1=1189625r2=1189626view=diff == --- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java (original) +++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java Thu Oct 27 06:20:48 2011 @@ -37,7 +37,6 @@ import java.util.Stack; * @author Drew Davidson (d...@ognl.org) */ public class OgnlContext -extends Object implements MapString, Object {
svn commit: r1189627 - in /commons/proper/vfs/trunk/core/src: main/java/org/apache/commons/vfs2/FileExtensionSelector.java test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java
Author: ggregory Date: Thu Oct 27 06:20:52 2011 New Revision: 1189627 URL: http://svn.apache.org/viewvc?rev=1189627view=rev Log: [VFS-370] Add a FileExtensionSelector class. Added: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileExtensionSelector.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileExtensionSelector.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileExtensionSelector.java?rev=1189627r1=1189626r2=1189627view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileExtensionSelector.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileExtensionSelector.java Thu Oct 27 06:20:52 2011 @@ -16,34 +16,87 @@ */ package org.apache.commons.vfs2; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + /** - * A {@link FileSelector} that selects the given file extension. - * - * @author a href=http://commons.apache.org/vfs/team-list.html;Commons VFS team/a + * A {@link FileSelector} that selects based on file extensions. + * p + * The extension comparison is case insensitive. + * /p + * p + * The selector makes a copy of a given Collection or array. Changing the object passed in the constructors will not affect the selector. + * /p + * + * @since 2.1 */ -public class FileExtensionSelector -implements FileSelector { - -private final String extension; +public class FileExtensionSelector implements FileSelector +{ + +/** + * The extensions to select. + */ +private final SetString extensions = new HashSetString(); + +/** + * Creates a new selector for the given extensions. + * + * @param extensions + *The extensions to be included by this selector. + */ +public FileExtensionSelector(CollectionString extensions) +{ +if (extensions != null) +{ +this.extensions.addAll(extensions); +} +} -public FileExtensionSelector(String extension) { -this.extension = extension; +/** + * Creates a new selector for the given extensions. + * + * @param extensions + *The extensions to be included by this selector. + */ +public FileExtensionSelector(String... extensions) +{ +if (extensions != null) +{ +this.extensions.addAll(Arrays.asList(extensions)); +} } /** * Determines if a file or folder should be selected. - * @param fileInfo The file selection information. + * + * @param fileInfo + *The file selection information. * @return true if the file should be selected, false otherwise. */ public boolean includeFile(final FileSelectInfo fileInfo) { -return fileInfo.getFile().getName().getExtension().equalsIgnoreCase(this.extension); +if (this.extensions == null) +{ +return false; +} +for (String extension : this.extensions) +{ +if (fileInfo.getFile().getName().getExtension().equalsIgnoreCase(extension)) +{ +return true; +} +} +return false; } /** * Determines whether a folder should be traversed. - * @param fileInfo The file selection information. - * @return true if descendents should be traversed, false otherwise. + * + * @param fileInfo + *The file selection information. + * @return true if descendents should be traversed, fase otherwise. */ public boolean traverseDescendents(final FileSelectInfo fileInfo) { Added: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java?rev=1189627view=auto == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java (added) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Thu Oct 27 06:20:52 2011 @@ -0,0 +1,155 @@ +package org.apache.commons.vfs2; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class FileExtensionSelectorTest +{ +private static FileObject BaseFolder; + +private static int FileCount; + +private static int ExtensionCount; + +private static int
svn commit: r1189632 - /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java
Author: mcucchiara Date: Thu Oct 27 06:29:22 2011 New Revision: 1189632 URL: http://svn.apache.org/viewvc?rev=1189632view=rev Log: Minor changes Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java?rev=1189632r1=1189631r2=1189632view=diff == --- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java (original) +++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlContext.java Thu Oct 27 06:29:22 2011 @@ -24,7 +24,6 @@ import org.apache.commons.ognl.enhance.L import java.util.Collection; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; @@ -114,11 +113,11 @@ public class OgnlContext { if ( ( s = System.getProperty( PROPERTY_KEY_PREFIX + .traceEvaluations ) ) != null ) { -DEFAULT_TRACE_EVALUATIONS = Boolean.valueOf( s.trim() ).booleanValue(); +DEFAULT_TRACE_EVALUATIONS = Boolean.valueOf( s.trim() ); } if ( ( s = System.getProperty( PROPERTY_KEY_PREFIX + .keepLastEvaluation ) ) != null ) { -DEFAULT_KEEP_LAST_EVALUATION = Boolean.valueOf( s.trim() ).booleanValue(); +DEFAULT_KEEP_LAST_EVALUATION = Boolean.valueOf( s.trim() ); } } catch ( SecurityException ex ) @@ -178,12 +177,7 @@ public class OgnlContext public void setValues( MapString, Object value ) { -for ( IteratorString it = value.keySet().iterator(); it.hasNext(); ) -{ -String k = it.next(); - -_values.put( k, value.get( k ) ); -} +_values.putAll( value ); } public MapString, Object getValues() @@ -706,12 +700,10 @@ public class OgnlContext return result; } -public void putAll( Map? extends String, ? extends Object t ) +public void putAll( Map? extends String, ? t ) { -for ( Iterator? extends String it = t.keySet().iterator(); it.hasNext(); ) +for ( String k : t.keySet() ) { -String k = it.next(); - put( k, t.get( k ) ); } }
svn commit: r1189662 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/archivers/dump/ test/java/org/apache/commons/compress/archivers/dump/
Author: bodewig Date: Thu Oct 27 08:22:48 2011 New Revision: 1189662 URL: http://svn.apache.org/viewvc?rev=1189662view=rev Log: remove unneeded cast to int in bitwise operations, add tests for convert methods Added: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtilTest.java (with props) Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java?rev=1189662r1=1189661r2=1189662view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java Thu Oct 27 08:22:48 2011 @@ -108,10 +108,10 @@ class DumpArchiveUtil { */ public static final int convert32(byte[] buffer, int offset) { int i = 0; -i = ((int) buffer[offset + 3]) 24; -i += (((int) buffer[offset + 2] 16) 0x00FF); -i += (((int) buffer[offset + 1] 8) 0xFF00); -i += (((int) buffer[offset]) 0x00FF); +i = buffer[offset + 3] 24; +i += (buffer[offset + 2] 16) 0x00FF; +i += (buffer[offset + 1] 8) 0xFF00; +i += buffer[offset] 0x00FF; return i; } @@ -125,8 +125,8 @@ class DumpArchiveUtil { */ public static final int convert16(byte[] buffer, int offset) { int i = 0; -i += (((int) buffer[offset + 1] 8) 0xFF00); -i += (((int) buffer[offset]) 0x00FF); +i += (buffer[offset + 1] 8) 0xFF00; +i += buffer[offset] 0x00FF; return i; } Added: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtilTest.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtilTest.java?rev=1189662view=auto == --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtilTest.java (added) +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtilTest.java Thu Oct 27 08:22:48 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.compress.archivers.dump; + +import org.junit.Test; +import static org.junit.Assert.assertEquals; + +public class DumpArchiveUtilTest { + +@Test +public void convert64() { +assertEquals(0xABCDEF0123456780L, + DumpArchiveUtil.convert64(new byte[] { + (byte) 0x80, 0x67, 0x45, 0x23, 1, (byte) 0xEF, + (byte) 0xCD, (byte) 0xAB + }, 0)); +} + +@Test +public void convert32() { +assertEquals(0xABCDEF01, + DumpArchiveUtil.convert32(new byte[] { + 1, (byte) 0xEF, (byte) 0xCD, (byte) 0xAB + }, 0)); +} + +@Test +public void convert16() { +assertEquals(0xABCD, + DumpArchiveUtil.convert16(new byte[] { + (byte) 0xCD, (byte) 0xAB + }, 0)); +} +} \ No newline at end of file Propchange: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtilTest.java -- svn:eol-style = native
svn commit: r1189677 - /commons/proper/ognl/trunk/src/benchmarks/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java
Author: mcucchiara Date: Thu Oct 27 08:48:55 2011 New Revision: 1189677 URL: http://svn.apache.org/viewvc?rev=1189677view=rev Log: PerformanceOldOgnlTest was extending the wrong base class Modified: commons/proper/ognl/trunk/src/benchmarks/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java Modified: commons/proper/ognl/trunk/src/benchmarks/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/benchmarks/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java?rev=1189677r1=1189676r2=1189677view=diff == --- commons/proper/ognl/trunk/src/benchmarks/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java (original) +++ commons/proper/ognl/trunk/src/benchmarks/java/org/apache/commons/ognl/performance/PerformanceOldOgnlTest.java Thu Oct 27 08:48:55 2011 @@ -38,7 +38,7 @@ import org.junit.BeforeClass; @BenchmarkMethodChart( filePrefix = benchmark-old-ognl ) @BenchmarkHistoryChart( labelWith = LabelType.CUSTOM_KEY, maxRuns = 20 ) public class PerformanceOldOgnlTest -extends PerformanceCommonsOgnlTest +extends BasePerformanceTest { @BeforeClass public static void before( )
svn commit: r1189680 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java test/java/org/apache/commons/compress/archivers/dump/DumpArchiv
Author: bodewig Date: Thu Oct 27 08:51:20 2011 New Revision: 1189680 URL: http://svn.apache.org/viewvc?rev=1189680view=rev Log: Improve test-coverage for DumpArchiveEntry and fix a bug found by doing so Added: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntryTest.java (with props) Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java?rev=1189680r1=1189679r2=1189680view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java Thu Oct 27 08:51:20 2011 @@ -232,8 +232,9 @@ public class DumpArchiveEntry implements */ protected DumpArchiveEntry(String name, String simpleName, int ino, TYPE type) { -this(name, simpleName); setType(type); +setName(name); +this.simpleName = simpleName; this.ino = ino; this.offset = 0; } Added: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntryTest.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntryTest.java?rev=1189680view=auto == --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntryTest.java (added) +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntryTest.java Thu Oct 27 08:51:20 2011 @@ -0,0 +1,43 @@ +/* + * 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.compress.archivers.dump; + +import org.junit.Test; +import static org.junit.Assert.assertEquals; + +public class DumpArchiveEntryTest { +@Test +public void publicNameAddsTrailingSlashForDirectories() { +DumpArchiveEntry ent = new DumpArchiveEntry(foo, bar, -1, +DumpArchiveEntry.TYPE +.DIRECTORY); +assertEquals(bar, ent.getSimpleName()); +assertEquals(foo, ent.getOriginalName()); +assertEquals(foo/, ent.getName()); +} + +@Test +public void publicNameRemovesLeadingDotSlash() { +DumpArchiveEntry ent = new DumpArchiveEntry(./foo, bar); +assertEquals(bar, ent.getSimpleName()); +assertEquals(./foo, ent.getOriginalName()); +assertEquals(foo, ent.getName()); +} + +} \ No newline at end of file Propchange: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntryTest.java -- svn:eol-style = native
svn commit: r1189682 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java
Author: bodewig Date: Thu Oct 27 08:53:37 2011 New Revision: 1189682 URL: http://svn.apache.org/viewvc?rev=1189682view=rev Log: unused code Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java?rev=1189682r1=1189681r2=1189682view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java Thu Oct 27 08:53:37 2011 @@ -130,28 +130,4 @@ class DumpArchiveUtil { return i; } - -/** - * Dump the start of a block. - * - * @param buffer - */ -public static final void dumpBlock(byte[] buffer) { -for (int i = 0; i 128; i += 32) { -System.out.printf(%08x , DumpArchiveUtil.convert32(buffer, i)); -System.out.printf(%08x , DumpArchiveUtil.convert32(buffer, i + 4)); -System.out.printf(%08x , DumpArchiveUtil.convert32(buffer, i + 8)); -System.out.printf(%08x - , -DumpArchiveUtil.convert32(buffer, i + 12)); -System.out.printf(%08x , DumpArchiveUtil.convert32(buffer, i + -16)); -System.out.printf(%08x , DumpArchiveUtil.convert32(buffer, i + -20)); -System.out.printf(%08x , DumpArchiveUtil.convert32(buffer, i + -24)); -System.out.printf(%08x , DumpArchiveUtil.convert32(buffer, i + -28)); -System.out.println(); -} -} }
svn commit: r1189694 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecomposition.java
Author: erans Date: Thu Oct 27 09:53:01 2011 New Revision: 1189694 URL: http://svn.apache.org/viewvc?rev=1189694view=rev Log: Code and Javadoc formatting. Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecomposition.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecomposition.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecomposition.java?rev=1189694r1=1189693r2=1189694view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecomposition.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecomposition.java Thu Oct 27 09:53:01 2011 @@ -55,7 +55,7 @@ import org.apache.commons.math.util.Fast * /p * p * This implementation is based on the paper by A. Drubrulle, R.S. Martin and - * J.H. Wilkinson 'The Implicit QL Algorithm' in Wilksinson and Reinsch (1971) + * J.H. Wilkinson The Implicit QL Algorithm in Wilksinson and Reinsch (1971) * Handbook for automatic computation, vol. 2, Linear algebra, Springer-Verlag, * New-York * /p @@ -65,37 +65,27 @@ import org.apache.commons.math.util.Fast * @since 2.0 (changed to concrete class in 3.0) */ public class EigenDecomposition{ - /** Maximum number of iterations accepted in the implicit QL transformation */ private byte maxIter = 30; - /** Main diagonal of the tridiagonal matrix. */ private double[] main; - /** Secondary diagonal of the tridiagonal matrix. */ private double[] secondary; - /** * Transformer to tridiagonal (may be null if matrix is already * tridiagonal). */ private TriDiagonalTransformer transformer; - /** Real part of the realEigenvalues. */ private double[] realEigenvalues; - /** Imaginary part of the realEigenvalues. */ private double[] imagEigenvalues; - /** Eigenvectors. */ private ArrayRealVector[] eigenvectors; - /** Cached value of V. */ private RealMatrix cachedV; - /** Cached value of D. */ private RealMatrix cachedD; - /** Cached value of Vt. */ private RealMatrix cachedVt; @@ -120,8 +110,8 @@ public class EigenDecomposition{ * Calculates the eigen decomposition of the symmetric tridiagonal * matrix. The Householder matrix is assumed to be the identity matrix. * - * @param main Main diagonal of the symmetric triadiagonal form - * @param secondary Secondary of the tridiagonal form + * @param main Main diagonal of the symmetric tridiagonal form. + * @param secondary Secondary of the tridiagonal form. * @param splitTolerance Dummy parameter (present for backward * compatibility only). * @throws MaxCountExceededException if the algorithm fails to converge. @@ -171,13 +161,14 @@ public class EigenDecomposition{ } /** - * Returns the matrix V of the decomposition. - * pV is an orthogonal matrix, i.e. its transpose is also its inverse./p - * pThe columns of V are the eigenvectors of the original matrix./p - * pNo assumption is made about the orientation of the system axes formed + * Gets the matrix V of the decomposition. + * V is an orthogonal matrix, i.e. its transpose is also its inverse. + * The columns of V are the eigenvectors of the original matrix. + * No assumption is made about the orientation of the system axes formed * by the columns of V (e.g. in a 3-dimension space, V can form a left- - * or right-handed system)./p - * @return the V matrix + * or right-handed system). + * + * @return the V matrix. */ public RealMatrix getV() { @@ -194,11 +185,13 @@ public class EigenDecomposition{ } /** - * Returns the block diagonal matrix D of the decomposition. - * pD is a block diagonal matrix./p - * pReal eigenvalues are on the diagonal while complex values are on - * 2x2 blocks { {real +imaginary}, {-imaginary, real} }./p - * @return the D matrix + * Gets the block diagonal matrix D of the decomposition. + * D is a block diagonal matrix. + * Real eigenvalues are on the diagonal while complex values are on + * 2x2 blocks { {real +imaginary}, {-imaginary, real} }. + * + * @return the D matrix. + * * @see #getRealEigenvalues() * @see #getImagEigenvalues() */ @@ -211,13 +204,14 @@ public class EigenDecomposition{ } /** - * Returns the transpose of the matrix V of the decomposition. - * pV is an orthogonal matrix, i.e. its transpose is also its inverse./p - * pThe columns of V are the eigenvectors of the original matrix./p - * pNo assumption is made about the orientation of the system axes formed + * Gets the transpose of the matrix V of the
svn commit: r1189695 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java
Author: erans Date: Thu Oct 27 09:59:34 2011 New Revision: 1189695 URL: http://svn.apache.org/viewvc?rev=1189695view=rev Log: Code formatting. Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java?rev=1189695r1=1189694r2=1189695view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/SingularValueDecomposition.java Thu Oct 27 09:59:34 2011 @@ -363,9 +363,12 @@ public class SingularValueDecomposition // Perform one qr step. case 3: { // Calculate the shift. -final double scale = FastMath.max(FastMath.max(FastMath.max(FastMath.max( -FastMath.abs(singularValues[p - 1]), FastMath.abs(singularValues[p - 2])), FastMath.abs(e[p - 2])), -FastMath.abs(singularValues[k])), FastMath.abs(e[k])); +final double maxPm1Pm2 = FastMath.max(FastMath.abs(singularValues[p - 1]), + FastMath.abs(singularValues[p - 2])); +final double scale = FastMath.max(FastMath.max(FastMath.max(maxPm1Pm2, + FastMath.abs(e[p - 2])), + FastMath.abs(singularValues[k])), + FastMath.abs(e[k])); final double sp = singularValues[p - 1] / scale; final double spm1 = singularValues[p - 2] / scale; final double epm1 = e[p - 2] / scale;
svn commit: r1189720 - in /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers: cpio/CpioArchiveOutputStreamTest.java cpio/CpioUtilTest.java dump/DumpArchiveInputStreamTe
Author: bodewig Date: Thu Oct 27 12:32:53 2011 New Revision: 1189720 URL: http://svn.apache.org/viewvc?rev=1189720view=rev Log: increase test coverage Added: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStreamTest.java (with props) commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java (with props) commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStreamTest.java (with props) Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java Added: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStreamTest.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStreamTest.java?rev=1189720view=auto == --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStreamTest.java (added) +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStreamTest.java Thu Oct 27 12:32:53 2011 @@ -0,0 +1,68 @@ +/* + * 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.compress.archivers.cpio; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileOutputStream; +import java.io.InputStream; + +import org.apache.commons.compress.AbstractTestCase; +import org.apache.commons.compress.utils.IOUtils; + +public class CpioArchiveOutputStreamTest extends AbstractTestCase { + +public void testWriteOldBinary() throws Exception { +final File f = getFile(test1.xml); +final File output = new File(dir, test.cpio); +final FileOutputStream out = new FileOutputStream(output); +InputStream in = null; +try { +final CpioArchiveOutputStream os = +new CpioArchiveOutputStream(out, CpioArchiveOutputStream +.FORMAT_OLD_BINARY); +os.putArchiveEntry(new CpioArchiveEntry(CpioArchiveOutputStream +.FORMAT_OLD_BINARY, +f, test1.xml)); +IOUtils.copy(in = new FileInputStream(f), os); +in.close(); +in = null; +os.closeArchiveEntry(); +os.close(); +} finally { +if (in != null) { +in.close(); +} +out.close(); +} + +try { +in = new CpioArchiveInputStream(new FileInputStream(output)); +CpioArchiveEntry e = ((CpioArchiveInputStream) in) +.getNextCPIOEntry(); +assertEquals(test1.xml, e.getName()); +assertNull(((CpioArchiveInputStream) in).getNextEntry()); +} finally { +if (in != null) { +in.close(); +} +} +} +} \ No newline at end of file Propchange: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStreamTest.java -- svn:eol-style = native Added: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java?rev=1189720view=auto == --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java (added) +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java Thu Oct 27 12:32:53 2011 @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements.
svn commit: r1189750 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/optimization/ main/java/org/apache/commons/math/optimization/direct/ main/java/org/apache/commons/math/optim
Author: erans Date: Thu Oct 27 13:34:08 2011 New Revision: 1189750 URL: http://svn.apache.org/viewvc?rev=1189750view=rev Log: MATH-413 Removed setConvergenceChecker; convergence checker is passed at construction. Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateRealOptimizer.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateVectorialOptimizer.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseOptimizer.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractScalarOptimizer.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BaseAbstractVectorialOptimizer.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizer.java commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/LevenbergMarquardtOptimizerTest.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateRealOptimizer.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateRealOptimizer.java?rev=1189750r1=1189749r2=1189750view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateRealOptimizer.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateRealOptimizer.java Thu Oct 27 13:34:08 2011 @@ -127,11 +127,6 @@ public class BaseMultiStartMultivariateR } /** {@inheritDoc} */ -public void setConvergenceChecker(ConvergenceCheckerRealPointValuePair checker) { -optimizer.setConvergenceChecker(checker); -} - -/** {@inheritDoc} */ public ConvergenceCheckerRealPointValuePair getConvergenceChecker() { return optimizer.getConvergenceChecker(); } Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateVectorialOptimizer.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateVectorialOptimizer.java?rev=1189750r1=1189749r2=1189750view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateVectorialOptimizer.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseMultiStartMultivariateVectorialOptimizer.java Thu Oct 27 13:34:08 2011 @@ -128,11 +128,6 @@ public class BaseMultiStartMultivariateV } /** {@inheritDoc} */ -public void setConvergenceChecker(ConvergenceCheckerVectorialPointValuePair checker) { -optimizer.setConvergenceChecker(checker); -} - -/** {@inheritDoc} */ public ConvergenceCheckerVectorialPointValuePair getConvergenceChecker() { return optimizer.getConvergenceChecker(); } Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseOptimizer.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseOptimizer.java?rev=1189750r1=1189749r2=1189750view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseOptimizer.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/BaseOptimizer.java Thu Oct 27 13:34:08 2011 @@ -52,13 +52,6 @@ public interface BaseOptimizerPAIR { int getEvaluations(); /** - * Set the convergence checker. - * - * @param checker Object to use to check for convergence. - */ -void setConvergenceChecker(ConvergenceCheckerPAIR checker); - -/** * Get the convergence checker. * * @return the object used to check for convergence. Modified:
svn commit: r1189755 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java
Author: ggregory Date: Thu Oct 27 13:42:47 2011 New Revision: 1189755 URL: http://svn.apache.org/viewvc?rev=1189755view=rev Log: Add missing ASL header. Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java?rev=1189755r1=1189754r2=1189755view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java (original) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Thu Oct 27 13:42:47 2011 @@ -1,3 +1,19 @@ +/* + * 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.vfs2; import java.util.Collection; @@ -52,7 +68,7 @@ public class FileExtensionSelectorTest { if (BaseFolder != null) { -BaseFolder.delete(Selectors.SELECT_ALL); +BaseFolder.deleteAllDescendents(); } }
svn commit: r1189769 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java
Author: ggregory Date: Thu Oct 27 14:14:34 2011 New Revision: 1189769 URL: http://svn.apache.org/viewvc?rev=1189769view=rev Log: Don't qualify static with class (code style). Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java?rev=1189769r1=1189768r2=1189769view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java (original) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Thu Oct 27 14:14:34 2011 @@ -81,7 +81,7 @@ public class FileExtensionSelectorTest public void testEmpty() throws Exception { FileSelector selector0 = new FileExtensionSelector(); -FileObject[] foList = FileExtensionSelectorTest.BaseFolder.findFiles(selector0); +FileObject[] foList = BaseFolder.findFiles(selector0); Assert.assertEquals(0, foList.length); } @@ -93,7 +93,7 @@ public class FileExtensionSelectorTest @Test public void testManyExtensions() throws Exception { -FileObject[] foList = FileExtensionSelectorTest.BaseFolder.findFiles(Selectors.SELECT_FILES); +FileObject[] foList = BaseFolder.findFiles(Selectors.SELECT_FILES); Assert.assertTrue(foList.length 0); // gather file extensions. SetString extensionSet = new HashSetString(); @@ -105,7 +105,7 @@ public class FileExtensionSelectorTest Assert.assertEquals(ExtensionCount, extensionSet.size()); // check all unique extensions FileSelector selector = new FileExtensionSelector(extensionSet); -FileObject[] list = FileExtensionSelectorTest.BaseFolder.findFiles(selector); +FileObject[] list = BaseFolder.findFiles(selector); Assert.assertEquals(FileCount, list.length); } @@ -118,7 +118,7 @@ public class FileExtensionSelectorTest public void testNullCollection() throws Exception { FileSelector selector0 = new FileExtensionSelector((CollectionString) null); -FileObject[] foList = FileExtensionSelectorTest.BaseFolder.findFiles(selector0); +FileObject[] foList = BaseFolder.findFiles(selector0); Assert.assertEquals(0, foList.length); } @@ -131,7 +131,7 @@ public class FileExtensionSelectorTest public void testNullString() throws Exception { FileSelector selector0 = new FileExtensionSelector((String) null); -FileObject[] foList = FileExtensionSelectorTest.BaseFolder.findFiles(selector0); +FileObject[] foList = BaseFolder.findFiles(selector0); Assert.assertEquals(0, foList.length); } @@ -143,7 +143,7 @@ public class FileExtensionSelectorTest @Test public void testOneExtension() throws Exception { -FileObject[] foList = FileExtensionSelectorTest.BaseFolder.findFiles(Selectors.SELECT_FILES); +FileObject[] foList = BaseFolder.findFiles(Selectors.SELECT_FILES); Assert.assertTrue(foList.length 0); // gather file extensions. SetString extensionSet = new HashSetString(); @@ -156,14 +156,14 @@ public class FileExtensionSelectorTest for (String extension : extensionSet) { FileSelector selector = new FileExtensionSelector(extension); -FileObject[] list = FileExtensionSelectorTest.BaseFolder.findFiles(selector); +FileObject[] list = BaseFolder.findFiles(selector); Assert.assertEquals(FilePerExtensionCount, list.length); } // check each file against itself for (FileObject fo : foList) { FileSelector selector = new FileExtensionSelector(fo.getName().getExtension()); -FileObject[] list = FileExtensionSelectorTest.BaseFolder.findFiles(selector); +FileObject[] list = BaseFolder.findFiles(selector); Assert.assertEquals(FilePerExtensionCount, list.length); } }
svn commit: r1189770 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java
Author: ggregory Date: Thu Oct 27 14:15:55 2011 New Revision: 1189770 URL: http://svn.apache.org/viewvc?rev=1189770view=rev Log: Better var name. Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java?rev=1189770r1=1189769r2=1189770view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java (original) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Thu Oct 27 14:15:55 2011 @@ -80,8 +80,8 @@ public class FileExtensionSelectorTest @Test public void testEmpty() throws Exception { -FileSelector selector0 = new FileExtensionSelector(); -FileObject[] foList = BaseFolder.findFiles(selector0); +FileSelector selector = new FileExtensionSelector(); +FileObject[] foList = BaseFolder.findFiles(selector); Assert.assertEquals(0, foList.length); }
svn commit: r1189775 - in /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2: FileExtensionSelectorTest.java FileTypeSelectorTest.java
Author: ggregory Date: Thu Oct 27 14:28:38 2011 New Revision: 1189775 URL: http://svn.apache.org/viewvc?rev=1189775view=rev Log: New test for FileTypeSelector and Javadoc FileExtensionSelectorTest. Added: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java?rev=1189775r1=1189774r2=1189775view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java (original) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Thu Oct 27 14:28:38 2011 @@ -25,6 +25,11 @@ import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +/** + * Tests FileExtensionSelector. + * + * @since 2.1 + */ public class FileExtensionSelectorTest { private static FileObject BaseFolder; Added: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java?rev=1189775view=auto == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java (added) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java Thu Oct 27 14:28:38 2011 @@ -0,0 +1,90 @@ +/* + * 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.vfs2; + +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests FileTypeSelector. + * + * @since 2.1 + */ +public class FileTypeSelectorTest +{ +private static FileObject BaseFolder; + +/** + * Creates a RAM FS. + * + * @throws Exception + */ +@BeforeClass +public static void setUpClass() throws Exception +{ +BaseFolder = VFS.getManager().resolveFile(ram:// + FileTypeSelectorTest.class.getName()); +BaseFolder.resolveFile(root1.html).createFile(); +BaseFolder.resolveFile(root2.html).createFile(); +BaseFolder.resolveFile(f1/a.html).createFile(); +BaseFolder.resolveFile(f2/b.html).createFile(); +BaseFolder.resolveFile(f3/c.html).createFile(); +BaseFolder.resolveFile(f4/).createFolder(); +BaseFolder.resolveFile(f5/).createFolder(); +BaseFolder.resolveFile(f6/f7).createFolder(); +} + +/** + * Deletes RAM FS files. + * + * @throws Exception + */ +@AfterClass +public static void tearDownClass() throws Exception +{ +if (BaseFolder != null) +{ +BaseFolder.deleteAllDescendents(); +} +} + +@Test +public void testFileOrFolders() throws Exception +{ +FileSelector selector = new FileTypeSelector(FileType.FILE_OR_FOLDER); +FileObject[] foList = BaseFolder.findFiles(selector); +// Why 0? +Assert.assertEquals(0, foList.length); +} + +@Test +public void testFiles() throws Exception +{ +FileSelector selector = new FileTypeSelector(FileType.FILE); +FileObject[] foList = BaseFolder.findFiles(selector); +Assert.assertEquals(5, foList.length); +} + +@Test +public void testFolders() throws Exception +{ +FileSelector selector = new FileTypeSelector(FileType.FOLDER); +FileObject[] foList = BaseFolder.findFiles(selector); +Assert.assertEquals(8, foList.length); +} +}
svn commit: r1189777 - in /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2: FileExtensionSelectorTest.java FileTypeSelectorTest.java
Author: ggregory Date: Thu Oct 27 14:31:33 2011 New Revision: 1189777 URL: http://svn.apache.org/viewvc?rev=1189777view=rev Log: Oops, backout unrelated change for [VFS-371] Add FileObject API deleteAllDescendents() Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java?rev=1189777r1=1189776r2=1189777view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java (original) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileExtensionSelectorTest.java Thu Oct 27 14:31:33 2011 @@ -73,7 +73,7 @@ public class FileExtensionSelectorTest { if (BaseFolder != null) { -BaseFolder.deleteAllDescendents(); +BaseFolder.delete(Selectors.SELECT_ALL); } } Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java?rev=1189777r1=1189776r2=1189777view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java (original) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileTypeSelectorTest.java Thu Oct 27 14:31:33 2011 @@ -59,7 +59,7 @@ public class FileTypeSelectorTest { if (BaseFolder != null) { -BaseFolder.deleteAllDescendents(); +BaseFolder.delete(Selectors.SELECT_ALL); } }
svn commit: r1189887 - in /commons/sandbox/runtime/trunk: build.xml src/build/org/apache/commons/runtime/ant/SystemIdTask.java src/main/java/org/apache/commons/runtime/SystemId.java src/main/native/Ma
Author: mturk Date: Thu Oct 27 17:38:32 2011 New Revision: 1189887 URL: http://svn.apache.org/viewvc?rev=1189887view=rev Log: Allow creating multilib builds Modified: commons/sandbox/runtime/trunk/build.xml commons/sandbox/runtime/trunk/src/build/org/apache/commons/runtime/ant/SystemIdTask.java commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/SystemId.java commons/sandbox/runtime/trunk/src/main/native/Makefile.unx.in Modified: commons/sandbox/runtime/trunk/build.xml URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/build.xml?rev=1189887r1=1189886r2=1189887view=diff == --- commons/sandbox/runtime/trunk/build.xml (original) +++ commons/sandbox/runtime/trunk/build.xml Thu Oct 27 17:38:32 2011 @@ -302,8 +302,13 @@ The Apache Software Foundation (http://w !-- == -- target name=native-jar depends=compile description=Generates the Jar file -copy todir=${build.dest}/java/${build.package.path}/platform/${systemid.os}/${systemid.cpu} -fileset dir=${runtime.library.path} +copy todir=${build.dest}/java/${build.package.path}/platform/${systemid.os}/${systemid.cpu32} +fileset erroronmissingdir=false dir=${runtime.library.path}32 +include name=*.${systemid.so}/ +/fileset +/copy +copy todir=${build.dest}/java/${build.package.path}/platform/${systemid.os}/${systemid.cpu32} +fileset erroronmissingdir=false dir=${runtime.library.path}64 include name=*.${systemid.so}/ /fileset /copy @@ -451,8 +456,8 @@ The Apache Software Foundation (http://w classfileset dir=${build.dest}/test include name=**/*.class/ /classfileset -env key=PATH path=${runtime.library.path}:${java.library.path}:${env.PATH}/ -jvmarg value=-Djava.library.path=${runtime.library.path}/ +env key=PATH path=${runtime.library.path}${systemid.data.model}:${java.library.path}:${env.PATH}/ +jvmarg value=-Djava.library.path=${runtime.library.path}${systemid.data.model}/ jvmarg value=-Xmx512m/ jvmarg line=${args}/ /testng @@ -534,8 +539,8 @@ The Apache Software Foundation (http://w fork=yes failonerror=${test.failonerror} classpath refid=examples.classpath/ -env key=PATH path=${runtime.library.path}:${java.library.path}:${env.PATH}/ -jvmarg value=-Djava.library.path=${runtime.library.path}/ +env key=PATH path=${runtime.library.path}${systemid.data.model}:${java.library.path}:${env.PATH}/ +jvmarg value=-Djava.library.path=${runtime.library.path}${systemid.data.model}/ jvmarg value=-Xmx512m/ arg line=${args}/ /java Modified: commons/sandbox/runtime/trunk/src/build/org/apache/commons/runtime/ant/SystemIdTask.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/build/org/apache/commons/runtime/ant/SystemIdTask.java?rev=1189887r1=1189886r2=1189887view=diff == --- commons/sandbox/runtime/trunk/src/build/org/apache/commons/runtime/ant/SystemIdTask.java (original) +++ commons/sandbox/runtime/trunk/src/build/org/apache/commons/runtime/ant/SystemIdTask.java Thu Oct 27 17:38:32 2011 @@ -122,7 +122,7 @@ public class SystemIdTask extends Task i syscpu = x86; if (name.startsWith(Mac OS)) { if (data.equals(64)) -syscpu = x86_64; +syscpu = x64; } } else if (arch.startsWith(PA_RISC)) { @@ -132,7 +132,7 @@ public class SystemIdTask extends Task i syscpu = parisc; } else if (arch.startsWith(IA64)) -syscpu = ia64; +syscpu = i64; else if (arch.startsWith(sparc)) { if (data.equals(64)) syscpu = sparc64; @@ -146,7 +146,7 @@ public class SystemIdTask extends Task i syscpu = ppc; } else if (arch.equals(amd64)) -syscpu = x86_64; +syscpu = x64; else syscpu = arch; return syscpu; @@ -180,6 +180,38 @@ public class SystemIdTask extends Task i return ext; } +private static String getProcessor32() +{ +getProcessor(); +if (syscpu.equals(x86) || syscpu.equals(x64)) +return x86; +if (syscpu.equals(i32) || syscpu.equals(i64)) +return i32; +if (syscpu.startsWith(sparc)) +return sparc; +if (syscpu.startsWith(ppc)) +return ppc; +if
svn commit: r1190141 - /commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java
Author: dbrosius Date: Fri Oct 28 03:28:59 2011 New Revision: 1190141 URL: http://svn.apache.org/viewvc?rev=1190141view=rev Log: remove dead store Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java?rev=1190141r1=1190140r2=1190141view=diff == --- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java (original) +++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java Fri Oct 28 03:28:59 2011 @@ -690,7 +690,6 @@ public class JDOMNodePointer extends Nod List children = ((Element) parent).getContent(); int count = 0; -String name = ((Element) node).getQualifiedName(); for (int i = 0; i children.size(); i++) { Object child = children.get(i); if (child instanceof Element matchesQName(((Element) child))) {
svn commit: r1190145 - /commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java
Author: dbrosius Date: Fri Oct 28 03:36:24 2011 New Revision: 1190145 URL: http://svn.apache.org/viewvc?rev=1190145view=rev Log: guard against npes on exception path Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java?rev=1190145r1=1190144r2=1190145view=diff == --- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java (original) +++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java Fri Oct 28 03:36:24 2011 @@ -120,6 +120,7 @@ public class JXPathBasicBeanInfo impleme } catch (IntrospectionException ex) { ex.printStackTrace(); +return new PropertyDescriptor[0]; } } }
svn commit: r1190147 - /commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java
Author: dbrosius Date: Fri Oct 28 03:51:23 2011 New Revision: 1190147 URL: http://svn.apache.org/viewvc?rev=1190147view=rev Log: reduce cohesion in the interface, use Set vs. HashSet Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java?rev=1190147r1=1190146r2=1190147view=diff == --- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java (original) +++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java Fri Oct 28 03:51:23 2011 @@ -18,6 +18,7 @@ package org.apache.commons.jxpath.servle import java.util.Enumeration; import java.util.HashSet; +import java.util.Set; import javax.servlet.ServletContext; @@ -35,7 +36,7 @@ public class ServletContextHandler imple private static final int DEFAULT_PROPERTY_COUNT = 16; public String[] getPropertyNames(Object context) { -HashSet list = new HashSet(DEFAULT_PROPERTY_COUNT); +Set list = new HashSet(DEFAULT_PROPERTY_COUNT); collectPropertyNames(list, context); return (String[]) list.toArray(new String[list.size()]); } @@ -45,7 +46,7 @@ public class ServletContextHandler imple * @param set destination * @param bean to read */ -protected void collectPropertyNames(HashSet set, Object bean) { +protected void collectPropertyNames(Set set, Object bean) { Enumeration e = ((ServletContext) bean).getAttributeNames(); while (e.hasMoreElements()) { set.add(e.nextElement());
svn commit: r1190148 - /commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java
Author: dbrosius Date: Fri Oct 28 04:00:29 2011 New Revision: 1190148 URL: http://svn.apache.org/viewvc?rev=1190148view=rev Log: fix unit test, by checking for bean being a HttpSessionAndServletContext, rather than a ServletContext Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java?rev=1190148r1=1190147r2=1190148view=diff == --- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java (original) +++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/ServletContextHandler.java Fri Oct 28 04:00:29 2011 @@ -47,6 +47,9 @@ public class ServletContextHandler imple * @param bean to read */ protected void collectPropertyNames(Set set, Object bean) { +if (bean instanceof HttpSessionAndServletContext) { +bean = ((HttpSessionAndServletContext) bean).getServletContext(); +} Enumeration e = ((ServletContext) bean).getAttributeNames(); while (e.hasMoreElements()) { set.add(e.nextElement());
svn commit: r1190150 - /commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java
Author: dbrosius Date: Fri Oct 28 04:02:18 2011 New Revision: 1190150 URL: http://svn.apache.org/viewvc?rev=1190150view=rev Log: remove unnecessary cast Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java?rev=1190150r1=1190149r2=1190150view=diff == --- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java (original) +++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java Fri Oct 28 04:02:18 2011 @@ -81,7 +81,7 @@ public class XMLDocumentContainer implem Transformer trans = TransformerFactory.newInstance().newTransformer(); trans.transform(source, result); -document = (Document) result.getNode(); +document = result.getNode(); } else { document = delegate.getValue();
svn commit: r1190151 - /commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ClassLoaderUtil.java
Author: dbrosius Date: Fri Oct 28 04:07:31 2011 New Revision: 1190151 URL: http://svn.apache.org/viewvc?rev=1190151view=rev Log: remove unused collection Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ClassLoaderUtil.java Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ClassLoaderUtil.java URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ClassLoaderUtil.java?rev=1190151r1=1190150r2=1190151view=diff == --- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ClassLoaderUtil.java (original) +++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ClassLoaderUtil.java Fri Oct 28 04:07:31 2011 @@ -40,11 +40,6 @@ public class ClassLoaderUtil { * Maps a primitive class name to its corresponding abbreviation used in array class names. */ private static Map abbreviationMap = new HashMap(); - - /** - * Maps an abbreviation used in array class names to corresponding primitive class name. - */ - private static Map reverseAbbreviationMap = new HashMap(); /** * Add primitive type abbreviation to maps of abbreviations. @@ -54,7 +49,6 @@ public class ClassLoaderUtil { */ private static void addAbbreviation(String primitive, String abbreviation) { abbreviationMap.put(primitive, abbreviation); - reverseAbbreviationMap.put(abbreviation, primitive); } /**
Nexus: Staging Repository Dropped.
Description:vote cancelledDetails:The org.apache.commons-101 (u:bodewig, a:93.201.62.251) staging repository has been dropped.
svn commit: r1190154 - /commons/proper/compress/tags/COMPRESS_1.3_RC2/
Author: bodewig Date: Fri Oct 28 04:15:42 2011 New Revision: 1190154 URL: http://svn.apache.org/viewvc?rev=1190154view=rev Log: Creating a tag for second release candidate of Commons Compress 1.3 Added: commons/proper/compress/tags/COMPRESS_1.3_RC2/ (props changed) - copied from r1190153, commons/proper/compress/trunk/ Propchange: commons/proper/compress/tags/COMPRESS_1.3_RC2/ -- --- subclipse:tags (added) +++ subclipse:tags Fri Oct 28 04:15:42 2011 @@ -0,0 +1 @@ +774629,commons-compress-1.0,/commons/proper/compress/tags/commons-compress-1.0,tag Propchange: commons/proper/compress/tags/COMPRESS_1.3_RC2/ -- --- svn:ignore (added) +++ svn:ignore Fri Oct 28 04:15:42 2011 @@ -0,0 +1,6 @@ +target +*.iml +*.ipr +*.iws +.* +maven-eclipse.xml Propchange: commons/proper/compress/tags/COMPRESS_1.3_RC2/ -- svn:mergeinfo = /commons/proper/compress/branches/zip64:1149597-1152684
svn commit: r1190156 - /commons/proper/compress/tags/COMPRESS_1.3_RC2/pom.xml
Author: bodewig Date: Fri Oct 28 04:18:39 2011 New Revision: 1190156 URL: http://svn.apache.org/viewvc?rev=1190156view=rev Log: fix version numbers for 1.3RC2 Modified: commons/proper/compress/tags/COMPRESS_1.3_RC2/pom.xml Modified: commons/proper/compress/tags/COMPRESS_1.3_RC2/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/compress/tags/COMPRESS_1.3_RC2/pom.xml?rev=1190156r1=1190155r2=1190156view=diff == --- commons/proper/compress/tags/COMPRESS_1.3_RC2/pom.xml (original) +++ commons/proper/compress/tags/COMPRESS_1.3_RC2/pom.xml Fri Oct 28 04:18:39 2011 @@ -25,7 +25,7 @@ groupIdorg.apache.commons/groupId artifactIdcommons-compress/artifactId - version1.3-SNAPSHOT/version + version1.3/version nameCommons Compress/name urlhttp://commons.apache.org/compress//url description @@ -41,7 +41,7 @@ commons.jira.pid12310904/commons.jira.pid !-- configuration bits for cutting a release candidate -- commons.release.version1.3/commons.release.version -commons.rc.versionRC1/commons.rc.version +commons.rc.versionRC2/commons.rc.version /properties issueManagement
Nexus: Staging Completed.
Description:RC2 for Commons Compress 1.3Details:The following artifacts have been staged to the org.apache.commons-111 (u:bodewig, a:93.201.41.70) repository.archetype-catalog.xmlcommons-compress-1.3.pom.asccommons-compress-1.3.pomcommons-compress-1.3.jar.asccommons-compress-1.3-sources.jar.asccommons-compress-1.3-javadoc.jarcommons-compress-1.3-sources.jarcommons-compress-1.3-javadoc.jar.asccommons-compress-1.3.jar