HADOOP-8819. Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1386451 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2012-09-17 01:39:11 +00:00
parent 5d37911882
commit 6afabd7e57
6 changed files with 9 additions and 6 deletions

View File

@ -372,6 +372,9 @@ Release 2.0.2-alpha - 2012-09-07
HADOOP-8801. ExitUtil#terminate should capture the exception stack trace. (eli) HADOOP-8801. ExitUtil#terminate should capture the exception stack trace. (eli)
HADOOP-8819. Incorrectly & is used instead of && in some file system
implementations. (Brandon Li via suresh)
BUG FIXES BUG FIXES
HADOOP-8372. NetUtils.normalizeHostName() incorrectly handles hostname HADOOP-8372. NetUtils.normalizeHostName() incorrectly handles hostname

View File

@ -488,7 +488,7 @@ public class FTPFileSystem extends FileSystem {
if (created) { if (created) {
String parentDir = parent.toUri().getPath(); String parentDir = parent.toUri().getPath();
client.changeWorkingDirectory(parentDir); client.changeWorkingDirectory(parentDir);
created = created & client.makeDirectory(pathName); created = created && client.makeDirectory(pathName);
} }
} else if (isFile(client, absolute)) { } else if (isFile(client, absolute)) {
throw new IOException(String.format( throw new IOException(String.format(

View File

@ -77,7 +77,7 @@ public class FTPInputStream extends FSInputStream {
if (byteRead >= 0) { if (byteRead >= 0) {
pos++; pos++;
} }
if (stats != null & byteRead >= 0) { if (stats != null && byteRead >= 0) {
stats.incrementBytesRead(1); stats.incrementBytesRead(1);
} }
return byteRead; return byteRead;
@ -93,7 +93,7 @@ public class FTPInputStream extends FSInputStream {
if (result > 0) { if (result > 0) {
pos += result; pos += result;
} }
if (stats != null & result > 0) { if (stats != null && result > 0) {
stats.incrementBytesRead(result); stats.incrementBytesRead(result);
} }

View File

@ -113,7 +113,7 @@ class S3InputStream extends FSInputStream {
pos++; pos++;
} }
} }
if (stats != null & result >= 0) { if (stats != null && result >= 0) {
stats.incrementBytesRead(1); stats.incrementBytesRead(1);
} }
return result; return result;

View File

@ -707,7 +707,7 @@ public class ViewFileSystem extends FileSystem {
@Override @Override
public boolean mkdirs(Path dir, FsPermission permission) public boolean mkdirs(Path dir, FsPermission permission)
throws AccessControlException, FileAlreadyExistsException { throws AccessControlException, FileAlreadyExistsException {
if (theInternalDir.isRoot & dir == null) { if (theInternalDir.isRoot && dir == null) {
throw new FileAlreadyExistsException("/ already exits"); throw new FileAlreadyExistsException("/ already exits");
} }
// Note dir starts with / // Note dir starts with /

View File

@ -750,7 +750,7 @@ public class ViewFs extends AbstractFileSystem {
public void mkdir(final Path dir, final FsPermission permission, public void mkdir(final Path dir, final FsPermission permission,
final boolean createParent) throws AccessControlException, final boolean createParent) throws AccessControlException,
FileAlreadyExistsException { FileAlreadyExistsException {
if (theInternalDir.isRoot & dir == null) { if (theInternalDir.isRoot && dir == null) {
throw new FileAlreadyExistsException("/ already exits"); throw new FileAlreadyExistsException("/ already exits");
} }
throw readOnlyMountTable("mkdir", dir); throw readOnlyMountTable("mkdir", dir);