You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2009/03/26 14:40:44 UTC
svn commit: r758637 -
/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
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;