svn commit: r755214 - /commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java

2009-03-17 Thread bodewig
Author: bodewig
Date: Tue Mar 17 12:14:17 2009
New Revision: 755214

URL: http://svn.apache.org/viewvc?rev=755214view=rev
Log:
whitespace

Modified:

commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java

Modified: 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java?rev=755214r1=755213r2=755214view=diff
==
--- 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
 (original)
+++ 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
 Tue Mar 17 12:14:17 2009
@@ -213,8 +213,8 @@
 char ch2 = fileName.charAt(1);
 
 if (ch2 == ':'
- ((ch1 = 'a'  ch1 = 'z')
-|| (ch1 = 'A'  ch1 = 'Z'))) {
+ ((ch1 = 'a'  ch1 = 'z')
+|| (ch1 = 'A'  ch1 = 'Z'))) {
 fileName = fileName.substring(2);
 }
 }
@@ -515,7 +515,7 @@
  */
 public boolean isGNULongNameEntry() {
 return linkFlag == LF_GNUTYPE_LONGNAME
-name.toString().equals(GNU_LONGLINK);
+ name.toString().equals(GNU_LONGLINK);
 }
 
 /**




svn commit: r755227 - in /commons/sandbox/compress/trunk/src: main/java/org/apache/commons/compress/archivers/tar/ test/java/org/apache/commons/compress/archivers/tar/

2009-03-17 Thread bodewig
Author: bodewig
Date: Tue Mar 17 12:53:22 2009
New Revision: 755227

URL: http://svn.apache.org/viewvc?rev=755227view=rev
Log:
deal with file system roots added as tar entries.  SANDBOX-284

Added:

commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/

commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java
   (with props)
Modified:

commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java

Modified: 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java?rev=755227r1=755226r2=755227view=diff
==
--- 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
 (original)
+++ 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
 Tue Mar 17 12:53:22 2009
@@ -158,6 +158,7 @@
 public TarArchiveEntry(String name) {
 this();
 
+name = normalizeFileName(name);
 boolean isDir = name.endsWith(/);
 
 this.devMajor = 0;
@@ -199,42 +200,7 @@
 
 this.file = file;
 
-String fileName = file.getPath();
-String osname = System.getProperty(os.name).toLowerCase(Locale.US);
-
-if (osname != null) {
-
-// Strip off drive letters!
-// REVIEW Would a better check be (File.separator == '\')?
-
-if (osname.startsWith(windows)) {
-if (fileName.length()  2) {
-char ch1 = fileName.charAt(0);
-char ch2 = fileName.charAt(1);
-
-if (ch2 == ':'
- ((ch1 = 'a'  ch1 = 'z')
-|| (ch1 = 'A'  ch1 = 'Z'))) {
-fileName = fileName.substring(2);
-}
-}
-} else if (osname.indexOf(netware)  -1) {
-int colon = fileName.indexOf(':');
-if (colon != -1) {
-fileName = fileName.substring(colon + 1);
-}
-}
-}
-
-fileName = fileName.replace(File.separatorChar, '/');
-
-// No absolute pathnames
-// Windows (and Posix?) paths can start with \\NetworkDrive\,
-// so we loop on starting /'s.
-while (fileName.startsWith(/)) {
-fileName = fileName.substring(1);
-}
-
+String fileName = normalizeFileName(file.getPath());
 this.linkName = new StringBuffer();
 this.name = new StringBuffer(fileName);
 
@@ -242,7 +208,8 @@
 this.mode = DEFAULT_DIR_MODE;
 this.linkFlag = LF_DIR;
 
-if (this.name.charAt(this.name.length() - 1) != '/') {
+int nameLength = name.length();
+if (nameLength == 0 || name.charAt(nameLength - 1) != '/') {
 this.name.append(/);
 }
 } else {
@@ -328,7 +295,7 @@
  * @param name This entry's new name.
  */
 public void setName(String name) {
-this.name = new StringBuffer(name);
+this.name = new StringBuffer(normalizeFileName(name));
 }
 
 /**
@@ -632,5 +599,47 @@
 offset += DEVLEN;
 devMinor = (int) TarUtils.parseOctal(header, offset, DEVLEN);
 }
+
+/**
+ * Strips Windows' drive letter as well as any leading slashes,
+ * turns path separators into forward slahes.
+ */
+private static String normalizeFileName(String fileName) {
+String osname = System.getProperty(os.name).toLowerCase(Locale.US);
+
+if (osname != null) {
+
+// Strip off drive letters!
+// REVIEW Would a better check be (File.separator == '\')?
+
+if (osname.startsWith(windows)) {
+if (fileName.length()  2) {
+char ch1 = fileName.charAt(0);
+char ch2 = fileName.charAt(1);
+
+if (ch2 == ':'
+ ((ch1 = 'a'  ch1 = 'z')
+|| (ch1 = 'A'  ch1 = 'Z'))) {
+fileName = fileName.substring(2);
+}
+}
+} else if (osname.indexOf(netware)  -1) {
+int colon = fileName.indexOf(':');
+if (colon != -1) {
+fileName = fileName.substring(colon + 1);
+}
+}
+}
+
+fileName = fileName.replace(File.separatorChar, '/');
+
+// No absolute pathnames
+// Windows (and Posix?) paths can start with \\NetworkDrive\,
+// so we loop on starting /'s.
+while (fileName.startsWith(/)) {
+

svn commit: r755268 - /commons/proper/vfs/trunk/pom.xml

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 14:38:36 2009
New Revision: 755268

URL: http://svn.apache.org/viewvc?rev=755268view=rev
Log:
Specify encoding to use when copying resources

Modified:
commons/proper/vfs/trunk/pom.xml

Modified: commons/proper/vfs/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/pom.xml?rev=755268r1=755267r2=755268view=diff
==
--- commons/proper/vfs/trunk/pom.xml (original)
+++ commons/proper/vfs/trunk/pom.xml Tue Mar 17 14:38:36 2009
@@ -110,6 +110,8 @@
   /contributors
 
   properties
+project.build.sourceEncodingUTF-8/project.build.sourceEncoding
+project.reporting.outputEncodingUTF-8/project.reporting.outputEncoding
 commons.componentidvfs/commons.componentid
 commons.release.version1.0/commons.release.version
 commons.binary.suffix/commons.binary.suffix




svn commit: r755269 - in /commons/proper/lang/trunk: pom.xml src/java/org/apache/commons/lang/EnumUtils.java

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 14:40:26 2009
New Revision: 755269

URL: http://svn.apache.org/viewvc?rev=755269view=rev
Log:
Specify encoding to use; Use better JUnit; Add JCIP annotation depend

Modified:
commons/proper/lang/trunk/pom.xml
commons/proper/lang/trunk/src/java/org/apache/commons/lang/EnumUtils.java

Modified: commons/proper/lang/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/pom.xml?rev=755269r1=755268r2=755269view=diff
==
--- commons/proper/lang/trunk/pom.xml (original)
+++ commons/proper/lang/trunk/pom.xml Tue Mar 17 14:40:26 2009
@@ -1,4 +1,4 @@
-?xml version=1.0?
+?xml version=1.0 encoding=UTF-8?
 !--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
@@ -380,15 +380,23 @@
 
   !-- Lang should depend on very little --
   dependencies
+!-- TODO: replace with TestNG --
 dependency
   groupIdjunit/groupId
   artifactIdjunit/artifactId
-  version3.8.1/version
+  version3.8.2/version
   scopetest/scope
 /dependency
+dependency
+groupIdnet.jcip/groupId
+artifactIdjcip-annotations/artifactId
+version1.0/version
+/dependency 
   /dependencies 
 
   properties
+project.build.sourceEncodingUTF-8/project.build.sourceEncoding
+project.reporting.outputEncodingUTF-8/project.reporting.outputEncoding
 maven.compile.source1.5/maven.compile.source
 maven.compile.target1.5/maven.compile.target
 commons.componentidlang/commons.componentid

Modified: 
commons/proper/lang/trunk/src/java/org/apache/commons/lang/EnumUtils.java
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/EnumUtils.java?rev=755269r1=755268r2=755269view=diff
==
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/EnumUtils.java 
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/EnumUtils.java 
Tue Mar 17 14:40:26 2009
@@ -38,10 +38,10 @@
  * @param enumClass the class of the codeenum/code to get
  * @return the enum Map
  */
-public static Map getEnumMap(Class enumClass) {
-Map map = new LinkedHashMap();
-Iterator itr = EnumSet.allOf(enumClass).iterator();
-while(itr.hasNext()) { Enum enm = (Enum) itr.next(); map.put( 
enm.name(), enm ); }
+public static MapString, Enum? getEnumMap(Class enumClass) {
+MapString, Enum? map = new LinkedHashMapString, Enum?();
+Iterator? extends Enum? itr = EnumSet.allOf(enumClass).iterator();
+while(itr.hasNext()) { Enum? enm = itr.next(); map.put( enm.name(), 
enm ); }
 return map;
 }
 




svn commit: r755285 - in /commons/proper/vfs/trunk: core/ examples/ sandbox/

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 15:38:45 2009
New Revision: 755285

URL: http://svn.apache.org/viewvc?rev=755285view=rev
Log:
Ignore target directories

Modified:
commons/proper/vfs/trunk/core/   (props changed)
commons/proper/vfs/trunk/examples/   (props changed)
commons/proper/vfs/trunk/sandbox/   (props changed)

Propchange: commons/proper/vfs/trunk/core/
--
--- svn:ignore (added)
+++ svn:ignore Tue Mar 17 15:38:45 2009
@@ -0,0 +1 @@
+target

Propchange: commons/proper/vfs/trunk/examples/
--
--- svn:ignore (added)
+++ svn:ignore Tue Mar 17 15:38:45 2009
@@ -0,0 +1 @@
+target

Propchange: commons/proper/vfs/trunk/sandbox/
--
--- svn:ignore (added)
+++ svn:ignore Tue Mar 17 15:38:45 2009
@@ -0,0 +1 @@
+target




svn commit: r755291 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/bzip2/CBZip2InputStream.java

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 15:54:04 2009
New Revision: 755291

URL: http://svn.apache.org/viewvc?rev=755291view=rev
Log:
VFS-191 - replace char by int as a work variable to allow compare with -1

Modified:

commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/bzip2/CBZip2InputStream.java

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/bzip2/CBZip2InputStream.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/bzip2/CBZip2InputStream.java?rev=755291r1=755290r2=755291view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/bzip2/CBZip2InputStream.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/bzip2/CBZip2InputStream.java
 Tue Mar 17 15:54:04 2009
@@ -454,21 +454,19 @@
 
 while( m_bsLive  1 )
 {
-int zzi;
-char thech = 0;
+int zzi = 0;
 try
 {
-thech = (char)m_input.read();
+zzi = m_input.read();
 }
 catch( IOException e )
 {
 compressedStreamEOF();
 }
-if( thech == -1 )
+if( zzi == -1 )
 {
 compressedStreamEOF();
 }
-zzi = thech;
 m_bsBuff = ( m_bsBuff  8 ) | ( zzi  0xff );
 m_bsLive += 8;
 }
@@ -519,21 +517,19 @@
 
 while( m_bsLive  1 )
 {
-int zzi;
-char thech = 0;
+int zzi = 0;
 try
 {
-thech = (char)m_input.read();
+zzi = m_input.read();
 }
 catch( IOException e )
 {
 compressedStreamEOF();
 }
-if( thech == -1 )
+if( zzi == -1 )
 {
 compressedStreamEOF();
 }
-zzi = thech;
 m_bsBuff = ( m_bsBuff  8 ) | ( zzi  0xff );
 m_bsLive += 8;
 }
@@ -677,10 +673,10 @@
 {
 while( m_bsLive  n )
 {
-char ch = 0;
+int ch = 0;
 try
 {
-ch = (char)m_input.read();
+ch = m_input.read();
 }
 catch( final IOException ioe )
 {




svn commit: r755295 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/NamingTests.java

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 16:11:28 2009
New Revision: 755295

URL: http://svn.apache.org/viewvc?rev=755295view=rev
Log:
VFS-242 NamingTests - assertSameName invokes relName.replace('\\', '/'); 
without using return value

Modified:

commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/NamingTests.java

Modified: 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/NamingTests.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/NamingTests.java?rev=755295r1=755294r2=755295view=diff
==
--- 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/NamingTests.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/NamingTests.java
 Tue Mar 17 16:11:28 2009
@@ -226,14 +226,16 @@
 FileName name = getManager().resolveName(baseName, relName, scope);
 assertEquals(expectedPath, name.getPath());
 
+String temp;
+
 // Replace the separators
-relName.replace('\\', '/');
-name = getManager().resolveName(baseName, relName, scope);
+temp = relName.replace('\\', '/');
+name = getManager().resolveName(baseName, temp, scope);
 assertEquals(expectedPath, name.getPath());
 
 // And again
-relName.replace('/', '\\');
-name = getManager().resolveName(baseName, relName, scope);
+temp = relName.replace('/', '\\');
+name = getManager().resolveName(baseName, temp, scope);
 assertEquals(expectedPath, name.getPath());
 }
 




svn commit: r755294 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/jar/JarFileSystem.java

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 16:06:52 2009
New Revision: 755294

URL: http://svn.apache.org/viewvc?rev=755294view=rev
Log:
VFS-192 - wrong items were being compared

Modified:

commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/jar/JarFileSystem.java

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/jar/JarFileSystem.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/jar/JarFileSystem.java?rev=755294r1=755293r2=755294view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/jar/JarFileSystem.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/jar/JarFileSystem.java
 Tue Mar 17 16:06:52 2009
@@ -117,71 +117,71 @@
 
 Name lookupName(String attrName)
 {
-if (Name.CLASS_PATH.equals(attrName))
+if (Name.CLASS_PATH.toString().equals(attrName))
 {
 return Name.CLASS_PATH;
 }
-else if (Name.CONTENT_TYPE.equals(attrName))
+else if (Name.CONTENT_TYPE.toString().equals(attrName))
 {
 return Name.CONTENT_TYPE;
 }
-else if (Name.EXTENSION_INSTALLATION.equals(attrName))
+else if (Name.EXTENSION_INSTALLATION.toString().equals(attrName))
 {
 return Name.EXTENSION_INSTALLATION;
 }
-else if (Name.EXTENSION_LIST.equals(attrName))
+else if (Name.EXTENSION_LIST.toString().equals(attrName))
 {
 return Name.EXTENSION_LIST;
 }
-else if (Name.EXTENSION_NAME.equals(attrName))
+else if (Name.EXTENSION_NAME.toString().equals(attrName))
 {
 return Name.EXTENSION_NAME;
 }
-else if (Name.IMPLEMENTATION_TITLE.equals(attrName))
+else if (Name.IMPLEMENTATION_TITLE.toString().equals(attrName))
 {
 return Name.IMPLEMENTATION_TITLE;
 }
-else if (Name.IMPLEMENTATION_URL.equals(attrName))
+else if (Name.IMPLEMENTATION_URL.toString().equals(attrName))
 {
 return Name.IMPLEMENTATION_URL;
 }
-else if (Name.IMPLEMENTATION_VENDOR.equals(attrName))
+else if (Name.IMPLEMENTATION_VENDOR.toString().equals(attrName))
 {
 return Name.IMPLEMENTATION_VENDOR;
 }
-else if (Name.IMPLEMENTATION_VENDOR_ID.equals(attrName))
+else if (Name.IMPLEMENTATION_VENDOR_ID.toString().equals(attrName))
 {
 return Name.IMPLEMENTATION_VENDOR_ID;
 }
-else if (Name.IMPLEMENTATION_VERSION.equals(attrName))
+else if (Name.IMPLEMENTATION_VERSION.toString().equals(attrName))
 {
 return Name.IMPLEMENTATION_VENDOR;
 }
-else if (Name.MAIN_CLASS.equals(attrName))
+else if (Name.MAIN_CLASS.toString().equals(attrName))
 {
 return Name.MAIN_CLASS;
 }
-else if (Name.MANIFEST_VERSION.equals(attrName))
+else if (Name.MANIFEST_VERSION.toString().equals(attrName))
 {
 return Name.MANIFEST_VERSION;
 }
-else if (Name.SEALED.equals(attrName))
+else if (Name.SEALED.toString().equals(attrName))
 {
 return Name.SEALED;
 }
-else if (Name.SIGNATURE_VERSION.equals(attrName))
+else if (Name.SIGNATURE_VERSION.toString().equals(attrName))
 {
 return Name.SIGNATURE_VERSION;
 }
-else if (Name.SPECIFICATION_TITLE.equals(attrName))
+else if (Name.SPECIFICATION_TITLE.toString().equals(attrName))
 {
 return Name.SPECIFICATION_TITLE;
 }
-else if (Name.SPECIFICATION_VENDOR.equals(attrName))
+else if (Name.SPECIFICATION_VENDOR.toString().equals(attrName))
 {
 return Name.SPECIFICATION_VENDOR;
 }
-else if (Name.SPECIFICATION_VERSION.equals(attrName))
+else if (Name.SPECIFICATION_VERSION.toString().equals(attrName))
 {
 return Name.SPECIFICATION_VERSION;
 }




svn commit: r755317 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 16:49:45 2009
New Revision: 755317

URL: http://svn.apache.org/viewvc?rev=755317view=rev
Log:
Fix possible NPE / ClassCastException in RamFileData.equals()

Modified:

commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java?rev=755317r1=755316r2=755317view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java
 Tue Mar 17 16:49:45 2009
@@ -222,6 +222,12 @@
 */
public boolean equals(Object o)
{
+   if (this == o) {
+   return true;
+   }
+   if (!(o instanceof RamFileData)){
+   return false;
+   }
RamFileData data = (RamFileData) o;
return this.getName().equals(data.getName());
}




svn commit: r755350 - in /commons/proper/vfs/trunk: core/ examples/ sandbox/

2009-03-17 Thread joehni
Author: joehni
Date: Tue Mar 17 18:54:58 2009
New Revision: 755350

URL: http://svn.apache.org/viewvc?rev=755350view=rev
Log:
Ignore Eclipse stuff.

Modified:
commons/proper/vfs/trunk/core/   (props changed)
commons/proper/vfs/trunk/examples/   (props changed)
commons/proper/vfs/trunk/sandbox/   (props changed)

Propchange: commons/proper/vfs/trunk/core/
--
--- svn:ignore (original)
+++ svn:ignore Tue Mar 17 18:54:58 2009
@@ -1 +1,3 @@
 target
+.*
+maven-eclipse.xml

Propchange: commons/proper/vfs/trunk/examples/
--
--- svn:ignore (original)
+++ svn:ignore Tue Mar 17 18:54:58 2009
@@ -1 +1,3 @@
 target
+.*
+maven-eclipse.xml

Propchange: commons/proper/vfs/trunk/sandbox/
--
--- svn:ignore (original)
+++ svn:ignore Tue Mar 17 18:54:58 2009
@@ -1 +1,3 @@
 target
+.*
+maven-eclipse.xml




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

2009-03-17 Thread joehni
Author: joehni
Date: Tue Mar 17 19:01:18 2009
New Revision: 755352

URL: http://svn.apache.org/viewvc?rev=755352view=rev
Log:
setupMethod must be protected to be overridden.

Modified:

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

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

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileObject.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileObject.java?rev=755352r1=755351r2=755352view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileObject.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileObject.java
 Tue Mar 17 19:01:18 2009
@@ -168,7 +168,7 @@
 /**
  * Prepares a Method object.
  */
-void setupMethod(final HttpMethod method) throws FileSystemException, 
URIException
+protected void setupMethod(final HttpMethod method) throws 
FileSystemException, URIException
 {
 String pathEncoded = ((URLFileName) 
getName()).getPathQueryEncoded(urlCharset);
 method.setPath(pathEncoded);

Modified: 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java?rev=755352r1=755351r2=755352view=diff
==
--- 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java
 Tue Mar 17 19:01:18 2009
@@ -319,7 +319,7 @@
  * @throws FileSystemException if an error occurs encoding the uri.
  * @throws URIException if the URI is in error.
  */
-void setupMethod(final HttpMethod method) throws FileSystemException, 
URIException
+protected void setupMethod(final HttpMethod method) throws 
FileSystemException, URIException
 {
 String pathEncoded = ((URLFileName) 
getName()).getPathQueryEncoded(urlCharset);
 method.setPath(pathEncoded);




svn commit: r755357 - /commons/proper/lang/trunk/pom.xml

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 19:15:32 2009
New Revision: 755357

URL: http://svn.apache.org/viewvc?rev=755357view=rev
Log:
Attempt to stop annotation jar becoming transitive dependency

Modified:
commons/proper/lang/trunk/pom.xml

Modified: commons/proper/lang/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/pom.xml?rev=755357r1=755356r2=755357view=diff
==
--- commons/proper/lang/trunk/pom.xml (original)
+++ commons/proper/lang/trunk/pom.xml Tue Mar 17 19:15:32 2009
@@ -391,6 +391,8 @@
 groupIdnet.jcip/groupId
 artifactIdjcip-annotations/artifactId
 version1.0/version
+!-- Not optional; this is a hack to stop the dependency becoming 
transitive --
+optionaltrue/optional
 /dependency 
   /dependencies 
 




svn commit: r755371 - /commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java

2009-03-17 Thread bodewig
Author: bodewig
Date: Tue Mar 17 19:56:57 2009
New Revision: 755371

URL: http://svn.apache.org/viewvc?rev=755371view=rev
Log:
Make tests pass on Linux - this is only hiding a different issue that I'll open 
a JIRA ticket for tomorrow, directories have a size different from 0 when 
queried via File.length() on Unix-like systems

Modified:

commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java

Modified: 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java?rev=755371r1=755370r2=755371view=diff
==
--- 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java
 (original)
+++ 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java
 Tue Mar 17 19:56:57 2009
@@ -50,6 +50,7 @@
 try {
 tout = new TarArchiveOutputStream(new FileOutputStream(f));
 TarArchiveEntry t = new TarArchiveEntry(new File(ROOT));
+t.setSize(0);
 tout.putNextEntry(t);
 tout.closeEntry();
 t = new TarArchiveEntry(new File(new File(ROOT), foo.txt));
@@ -73,13 +74,18 @@
 tout = null;
 
 tin = new TarArchiveInputStream(new FileInputStream(f));
+//tin.setDebug(true);
 t = tin.getNextTarEntry();
+assertNotNull(t);
 assertEquals(/, t.getName());
 t = tin.getNextTarEntry();
+assertNotNull(t);
 assertEquals(foo.txt, t.getName());
 t = tin.getNextTarEntry();
+assertNotNull(t);
 assertEquals(bar.txt, t.getName());
 t = tin.getNextTarEntry();
+assertNotNull(t);
 assertEquals(baz.txt, t.getName());
 } finally {
 if (tin != null) {




svn commit: r755385 - in /commons/proper/dbutils/trunk/src: java/org/apache/commons/dbutils/BeanProcessor.java test/org/apache/commons/dbutils/MockResultSet.java test/org/apache/commons/dbutils/MockRe

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 20:49:43 2009
New Revision: 755385

URL: http://svn.apache.org/viewvc?rev=755385view=rev
Log:
Boolean.valueOf() is more efficient than new Boolean()

Modified:

commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java

commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java

commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java

Modified: 
commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java
URL: 
http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java?rev=755385r1=755384r2=755385view=diff
==
--- 
commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java
 (original)
+++ 
commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java
 Tue Mar 17 20:49:43 2009
@@ -446,7 +446,7 @@
 
 } else if (
 propType.equals(Boolean.TYPE) || propType.equals(Boolean.class)) {
-return new Boolean(rs.getBoolean(index));
+return Boolean.valueOf(rs.getBoolean(index));
 
 } else if (propType.equals(Long.TYPE) || propType.equals(Long.class)) {
 return new Long(rs.getLong(index));

Modified: 
commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java
URL: 
http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java?rev=755385r1=755384r2=755385view=diff
==
--- 
commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java
 (original)
+++ 
commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java
 Tue Mar 17 20:49:43 2009
@@ -313,7 +313,7 @@
 return MockResultSet  + System.identityHashCode(proxy);
 
 } else if (methodName.equals(equals)) { 
-return new Boolean(proxy == args[0]); 
+return Boolean.valueOf(proxy == args[0]); 
 }
 
 throw new UnsupportedOperationException(Unsupported method:  + 
methodName);

Modified: 
commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java
URL: 
http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java?rev=755385r1=755384r2=755385view=diff
==
--- 
commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java
 (original)
+++ 
commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java
 Tue Mar 17 20:49:43 2009
@@ -71,7 +71,7 @@
 return MockResultSetMetaData  + System.identityHashCode(proxy);
 
 } else if (methodName.equals(equals)) { 
-return new Boolean(proxy == args[0]); 
+return Boolean.valueOf(proxy == args[0]); 
 
 } else {
 throw new UnsupportedOperationException(Unsupported method:  + 
methodName);




svn commit: r755387 - /commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 20:51:58 2009
New Revision: 755387

URL: http://svn.apache.org/viewvc?rev=755387view=rev
Log:
Ensure calculation is performed as a long

Modified:

commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java

Modified: 
commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java?rev=755387r1=755386r2=755387view=diff
==
--- 
commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java
 (original)
+++ 
commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java
 Tue Mar 17 20:51:58 2009
@@ -120,7 +120,7 @@
 text = DurationFormatUtils.formatDurationWords(2 * 24 * 60 * 60 * 1000 
+ 72 * 60 * 1000, false, false);
 assertEquals(2 days 1 hour 12 minutes 0 seconds, text);
 for (int i = 2; i  31; i++) {
-text = DurationFormatUtils.formatDurationWords(i * 24 * 60 * 60 * 
1000, false, false);
+text = DurationFormatUtils.formatDurationWords(i * 24 * 60 * 60 * 
1000L, false, false);
 // assertEquals(i +  days 0 hours 0 minutes 0 seconds, text);
 //
 // junit.framework.ComparisonFailure: expected:25 days 0 hours 0 
minutes 0... but was:-24 days -17 hours




svn commit: r755389 - /commons/proper/lang/trunk/findbugs-exclude-filter.xml

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 20:52:42 2009
New Revision: 755389

URL: http://svn.apache.org/viewvc?rev=755389view=rev
Log:
Start collecting Findbugs false positives

Added:
commons/proper/lang/trunk/findbugs-exclude-filter.xml   (with props)

Added: commons/proper/lang/trunk/findbugs-exclude-filter.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/findbugs-exclude-filter.xml?rev=755389view=auto
==
--- commons/proper/lang/trunk/findbugs-exclude-filter.xml (added)
+++ commons/proper/lang/trunk/findbugs-exclude-filter.xml Tue Mar 17 20:52:42 
2009
@@ -0,0 +1,38 @@
+?xml version=1.0?
+!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the License); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an AS IS BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+--
+
+!--
+  This file contains some false positive bugs detected by findbugs. Their
+  false positive nature has been analyzed individually and they have been
+  put here to instruct findbugs it must ignore them.
+--
+FindBugsFilter
+
+  Match
+Class name=org.apache.commons.lang.BooleanUtils /
+Method name=toBoolean /
+Bug pattern=ES_COMPARING_PARAMETER_STRING_WITH_EQ /
+  /Match
+
+  Match
+Class name=org.apache.commons.lang.StringUtils /
+Method name=indexOfDifference/
+Bug pattern=ES_COMPARING_PARAMETER_STRING_WITH_EQ /
+  /Match
+
+/FindBugsFilter

Propchange: commons/proper/lang/trunk/findbugs-exclude-filter.xml
--
svn:eol-style = native




svn commit: r755391 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 20:54:52 2009
New Revision: 755391

URL: http://svn.apache.org/viewvc?rev=755391view=rev
Log:
LANG-369 - must use fixed object as lock target

Modified:

commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java

Modified: 
commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java?rev=755391r1=755390r2=755391view=diff
==
--- 
commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java
 (original)
+++ 
commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java
 Tue Mar 17 20:54:52 2009
@@ -28,6 +28,9 @@
 import java.util.List;
 import java.util.StringTokenizer;
 
+import net.jcip.annotations.GuardedBy;
+import net.jcip.annotations.ThreadSafe;
+
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.ClassUtils;
 import org.apache.commons.lang.NullArgumentException;
@@ -46,6 +49,7 @@
  * @since 1.0
  * @version $Id$
  */
+...@threadsafe
 public class ExceptionUtils {
 
 /**
@@ -56,9 +60,13 @@
  */
 static final String WRAPPED_MARKER =  [wrapped] ;
 
+// Lock object for CAUSE_METHOD_NAMES
+private static final Object CAUSE_METHOD_NAMES_LOCK = new Object();
+
 /**
  * pThe names of methods commonly used to access a wrapped exception./p
  */
+@GuardedBy(CAUSE_METHOD_NAMES_LOCK)
 private static String[] CAUSE_METHOD_NAMES = {
 getCause,
 getNextException,
@@ -123,7 +131,7 @@
 if (StringUtils.isNotEmpty(methodName)  
!isCauseMethodName(methodName)) {
 ListString list = getCauseMethodNameList();
 if (list.add(methodName)) {
-synchronized(CAUSE_METHOD_NAMES) {
+synchronized(CAUSE_METHOD_NAMES_LOCK) {
 CAUSE_METHOD_NAMES = toArray(list);
 }
 }
@@ -142,7 +150,7 @@
 if (StringUtils.isNotEmpty(methodName)) {
 ListString list = getCauseMethodNameList();
 if (list.remove(methodName)) {
-synchronized(CAUSE_METHOD_NAMES) {
+synchronized(CAUSE_METHOD_NAMES_LOCK) {
 CAUSE_METHOD_NAMES = toArray(list);
 }
 }
@@ -222,7 +230,7 @@
  * @return {...@link #CAUSE_METHOD_NAMES} as a List.
  */
 private static ArrayListString getCauseMethodNameList() {
-synchronized(CAUSE_METHOD_NAMES) {
+synchronized(CAUSE_METHOD_NAMES_LOCK) {
 return new ArrayListString(Arrays.asList(CAUSE_METHOD_NAMES));
 }
 }
@@ -237,7 +245,7 @@
  * @since 2.1
  */
 public static boolean isCauseMethodName(String methodName) {
-synchronized(CAUSE_METHOD_NAMES) {
+synchronized(CAUSE_METHOD_NAMES_LOCK) {
 return ArrayUtils.indexOf(CAUSE_METHOD_NAMES, methodName) = 0;
 }
 }
@@ -274,7 +282,7 @@
  * @since 1.0
  */
 public static Throwable getCause(Throwable throwable) {
-synchronized(CAUSE_METHOD_NAMES) {
+synchronized(CAUSE_METHOD_NAMES_LOCK) {
 return getCause(throwable, CAUSE_METHOD_NAMES);
 }
 }
@@ -304,7 +312,7 @@
 Throwable cause = getCauseUsingWellKnownTypes(throwable);
 if (cause == null) {
 if (methodNames == null) {
-synchronized(CAUSE_METHOD_NAMES) {
+synchronized(CAUSE_METHOD_NAMES_LOCK) {
 methodNames = CAUSE_METHOD_NAMES;
 }
 }
@@ -463,7 +471,7 @@
 }
 
 Class? extends Throwable cls = throwable.getClass();
-synchronized(CAUSE_METHOD_NAMES) {
+synchronized(CAUSE_METHOD_NAMES_LOCK) {
 for (int i = 0, isize = CAUSE_METHOD_NAMES.length; i  isize; i++) 
{
 try {
 Method method = cls.getMethod(CAUSE_METHOD_NAMES[i], 
(Class[]) null);




svn commit: r755401 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java

2009-03-17 Thread markt
Author: markt
Date: Tue Mar 17 21:12:56 2009
New Revision: 755401

URL: http://svn.apache.org/viewvc?rev=755401view=rev
Log:
Fix POOL-133.
Make sure active count is decremented even if destroyObject() throws an 
exception

Modified:

commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java

Modified: 
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
URL: 
http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java?rev=755401r1=755400r2=755401view=diff
==
--- 
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
 (original)
+++ 
commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
 Tue Mar 17 21:12:56 2009
@@ -1018,11 +1018,12 @@
 } catch (Exception e) {
 try {
 _factory.destroyObject(key,pair.value);
+} catch (Exception e2) {
+// swallowed
+} finally {
 synchronized (this) {
 pool.decrementActiveCount();
 }
-} catch (Exception e2) {
-// swallowed
 }
 if(newlyCreated) {
 throw new NoSuchElementException(
@@ -1046,11 +1047,12 @@
 if (invalid) {
 try {
 _factory.destroyObject(key,pair.value);
+} catch (Exception e) {
+// swallowed
+} finally {
 synchronized (this) {
 pool.decrementActiveCount();
 }
-} catch (Exception e) {
-// swallowed
 }
 if(newlyCreated) {
 throw new NoSuchElementException(Could not create a 
validated object);




svn commit: r755402 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractTestSuite.java

2009-03-17 Thread joehni
Author: joehni
Date: Tue Mar 17 21:17:47 2009
New Revision: 755402

URL: http://svn.apache.org/viewvc?rev=755402view=rev
Log:
Set AbstractTestSuite to abstract. Prevents execution in Eclipse also.

Modified:

commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractTestSuite.java

Modified: 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractTestSuite.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractTestSuite.java?rev=755402r1=755401r2=755402view=diff
==
--- 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractTestSuite.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractTestSuite.java
 Tue Mar 17 21:17:47 2009
@@ -42,7 +42,7 @@
  * @author Gary D. Gregory
  * @version $Id$
  */
-public class AbstractTestSuite
+public abstract class AbstractTestSuite
 extends TestSetup
 {
 private final ProviderTestConfig providerConfig;




svn commit: r755407 - in /commons/proper/configuration/trunk/src: java/org/apache/commons/configuration/ test/org/apache/commons/configuration/

2009-03-17 Thread oheger
Author: oheger
Date: Tue Mar 17 21:40:10 2009
New Revision: 755407

URL: http://svn.apache.org/viewvc?rev=755407view=rev
Log:
CONFIGURATION-370: Introduced new IOFactory interface that allows injecting 
custom properties readers and writers.

Modified:

commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java

commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfigurationLayout.java

commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java

Modified: 
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java
URL: 
http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java?rev=755407r1=755406r2=755407view=diff
==
--- 
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java
 (original)
+++ 
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java
 Tue Mar 17 21:40:10 2009
@@ -178,6 +178,12 @@
 static final String COMMENT_CHARS = #!;
 
 /**
+ * Constant for the default codeIOFactory/code. This instance is used
+ * when no specific factory was set.
+ */
+private static final IOFactory DEFAULT_IO_FACTORY = new DefaultIOFactory();
+
+/**
  * This is the name of the property that can point to other
  * properties file for including other properties files.
  */
@@ -210,6 +216,9 @@
 /** Stores the layout object.*/
 private PropertiesConfigurationLayout layout;
 
+/** The IOFactory for creating readers and writers.*/
+private volatile IOFactory ioFactory;
+
 /** Allow file inclusion or not */
 private boolean includesAllowed;
 
@@ -402,6 +411,43 @@
 }
 
 /**
+ * Returns the codeIOFactory/code to be used for creating readers and
+ * writers when loading or saving this configuration.
+ *
+ * @return the codeIOFactory/code
+ * @since 1.7
+ */
+public IOFactory getIOFactory()
+{
+return (ioFactory != null) ? ioFactory : DEFAULT_IO_FACTORY;
+}
+
+/**
+ * Sets the codeIOFactory/code to be used for creating readers and
+ * writers when loading or saving this configuration. Using this method a
+ * client can customize the reader and writer classes used by the load and
+ * save operations. Note that this method must be called before invoking
+ * one of the codeload()/code and codesave()/code methods.
+ * Especially, if you want to use a custom codeIOFactory/code for
+ * changing the codePropertiesReader/code, you cannot load the
+ * configuration data in the constructor.
+ *
+ * @param ioFactory the new codeIOFactory/code (must not be 
bnull/b)
+ * @throws IllegalArgumentException if the codeIOFactory/code is
+ * bnull/b
+ * @since 1.7
+ */
+public void setIOFactory(IOFactory ioFactory)
+{
+if (ioFactory == null)
+{
+throw new IllegalArgumentException(IOFactory must not be null!);
+}
+
+this.ioFactory = ioFactory;
+}
+
+/**
  * Load the properties from the given reader.
  * Note that the codeclear()/code method is not called, so
  * the properties contained in the loaded file will be added to the
@@ -571,7 +617,7 @@
 
 /**
  * Creates a new instance of codePropertiesReader/code and sets
- * the underlaying reader and the list delimiter.
+ * the underlying reader and the list delimiter.
  *
  * @param reader the reader
  * @param listDelimiter the list delimiter character
@@ -1023,6 +1069,82 @@
 } // class PropertiesWriter
 
 /**
+ * p
+ * Definition of an interface that allows customization of read and write
+ * operations.
+ * /p
+ * p
+ * For reading and writing properties files the inner classes
+ * codePropertiesReader/code and codePropertiesWriter/code are 
used.
+ * This interface defines factory methods for creating both a
+ * codePropertiesReader/code and a codePropertiesWriter/code. An
+ * object implementing this interface can be passed to the
+ * codesetIOFactory()/code method of
+ * codePropertiesConfiguration/code. Every time the configuration is
+ * read or written the codeIOFactory/code is asked to create the
+ * appropriate reader or writer object. This provides an opportunity to
+ * inject custom reader or writer implementations.
+ * /p
+ *
+ * @since 1.7
+ */
+public static interface IOFactory
+{
+/**
+ * Creates a codePropertiesReader/code for reading a properties
+ * file. This method is called whenever the
+ * 

svn commit: r755447 - /commons/proper/lang/trunk/findbugs-exclude-filter.xml

2009-03-17 Thread sebb
Author: sebb
Date: Tue Mar 17 23:51:21 2009
New Revision: 755447

URL: http://svn.apache.org/viewvc?rev=755447view=rev
Log:
Two more false positives

Modified:
commons/proper/lang/trunk/findbugs-exclude-filter.xml

Modified: commons/proper/lang/trunk/findbugs-exclude-filter.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/findbugs-exclude-filter.xml?rev=755447r1=755446r2=755447view=diff
==
--- commons/proper/lang/trunk/findbugs-exclude-filter.xml (original)
+++ commons/proper/lang/trunk/findbugs-exclude-filter.xml Tue Mar 17 23:51:21 
2009
@@ -35,4 +35,16 @@
 Bug pattern=ES_COMPARING_PARAMETER_STRING_WITH_EQ /
   /Match
 
+  Match
+Class name=org.apache.commons.lang.BooleanUtils /
+Method name=negate/
+Bug pattern=NP_BOOLEAN_RETURN_NULL /
+  /Match
+
+  Match
+Class name=org.apache.commons.lang.BooleanUtils /
+Method name=toBooleanObject/
+Bug pattern=NP_BOOLEAN_RETURN_NULL /
+  /Match
+
 /FindBugsFilter




svn commit: r755472 - in /commons/sandbox/compress/trunk/src: main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java test/java/org/apache/commons/compress/archivers/tar/TarArchiveEnt

2009-03-17 Thread bodewig
Author: bodewig
Date: Wed Mar 18 04:38:47 2009
New Revision: 755472

URL: http://svn.apache.org/viewvc?rev=755472view=rev
Log:
use proper size for directories - SANDBOX-303

Modified:

commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java

commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java

Modified: 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java?rev=755472r1=755471r2=755472view=diff
==
--- 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
 (original)
+++ 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
 Wed Mar 18 04:38:47 2009
@@ -212,12 +212,13 @@
 if (nameLength == 0 || name.charAt(nameLength - 1) != '/') {
 this.name.append(/);
 }
+this.size = 0;
 } else {
 this.mode = DEFAULT_FILE_MODE;
 this.linkFlag = LF_NORMAL;
+this.size = file.length();
 }
 
-this.size = file.length();
 this.modTime = file.lastModified() / MILLIS_PER_SECOND;
 this.devMajor = 0;
 this.devMinor = 0;

Modified: 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java?rev=755472r1=755471r2=755472view=diff
==
--- 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java
 (original)
+++ 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java
 Wed Mar 18 04:38:47 2009
@@ -50,7 +50,6 @@
 try {
 tout = new TarArchiveOutputStream(new FileOutputStream(f));
 TarArchiveEntry t = new TarArchiveEntry(new File(ROOT));
-t.setSize(0);
 tout.putNextEntry(t);
 tout.closeEntry();
 t = new TarArchiveEntry(new File(new File(ROOT), foo.txt));