commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r758637 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
Date Thu, 26 Mar 2009 13:40:44 GMT
Author: sebb
Date: Thu Mar 26 13:40:38 2009
New Revision: 758637

URL: http://svn.apache.org/viewvc?rev=758637&view=rev
Log:
Show modes as hex (easier to understand)

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java?rev=758637&r1=758636&r2=758637&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
Thu Mar 26 13:40:38 2009
@@ -588,7 +588,8 @@
      *            The mode to set.
      */
     public void setMode(final long mode) {
-        switch ((int) (mode & S_IFMT)) {
+        final long maskedMode = mode & S_IFMT;
+        switch ((int) maskedMode) {
         case C_ISDIR:
         case C_ISLNK:
         case C_ISREG:
@@ -601,8 +602,10 @@
         default:
             // FIXME: testCpioUnarchive fails if I change the line to
             // actually throw the excpetion
-            new IllegalArgumentException("Unknown mode (full mode: " + mode
-                    + ", masked mode: " + (mode & S_IFMT));
+            new IllegalArgumentException(
+                    "Unknown mode. "
+                    + "Full: " + Long.toHexString(mode) 
+                    + " Masked: " + Long.toHexString(maskedMode));
         }
 
         this.mode = mode;



Mime
View raw message