Index: common/src/java/org/apache/hadoop/hive/common/FileUtils.java =================================================================== --- common/src/java/org/apache/hadoop/hive/common/FileUtils.java (revision 901511) +++ common/src/java/org/apache/hadoop/hive/common/FileUtils.java (working copy) @@ -18,33 +18,34 @@ package org.apache.hadoop.hive.common; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.conf.Configuration; import java.io.IOException; import java.net.URI; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; + /** * Collection of file manipulation utilities common across Hive */ public class FileUtils { /** - * Variant of Path.makeQualified that qualifies the input - * path against the default file system indicated by the - * configuration - * - * This does not require a FileSystem handle in most cases - * - only requires the Filesystem URI. This saves the cost - * of opening the Filesystem - which can involve RPCs - as - * well as cause errors - * - * @param path path to be fully qualified - * @param conf Configuration file + * Variant of Path.makeQualified that qualifies the input path against the + * default file system indicated by the configuration + * + * This does not require a FileSystem handle in most cases - only requires the + * Filesystem URI. This saves the cost of opening the Filesystem - which can + * involve RPCs - as well as cause errors + * + * @param path + * path to be fully qualified + * @param conf + * Configuration file * @return path qualified relative to default file system */ - public static Path makeQualified(Path path, Configuration conf) - throws IOException { + public static Path makeQualified(Path path, Configuration conf) + throws IOException { if (!path.isAbsolute()) { // in this case we need to get the working directory @@ -59,14 +60,14 @@ String scheme = pathUri.getScheme(); String authority = pathUri.getAuthority(); - if (scheme != null && - (authority != null || fsUri.getAuthority() == null)) + if (scheme != null && (authority != null || fsUri.getAuthority() == null)) { return path; - + } + if (scheme == null) { scheme = fsUri.getScheme(); } - + if (authority == null) { authority = fsUri.getAuthority(); if (authority == null) { @@ -74,6 +75,6 @@ } } - return new Path(scheme+":"+"//"+authority + pathUri.getPath()); + return new Path(scheme + ":" + "//" + authority + pathUri.getPath()); } } Index: common/src/java/org/apache/hadoop/hive/common/JavaUtils.java =================================================================== --- common/src/java/org/apache/hadoop/hive/common/JavaUtils.java (revision 901511) +++ common/src/java/org/apache/hadoop/hive/common/JavaUtils.java (working copy) @@ -19,7 +19,8 @@ package org.apache.hadoop.hive.common; /** - * Collection of Java class loading/reflection related utilities common across Hive + * Collection of Java class loading/reflection related utilities common across + * Hive */ public class JavaUtils { Index: common/src/java/org/apache/hadoop/hive/common/io/NonSyncByteArrayInputStream.java =================================================================== --- common/src/java/org/apache/hadoop/hive/common/io/NonSyncByteArrayInputStream.java (revision 901511) +++ common/src/java/org/apache/hadoop/hive/common/io/NonSyncByteArrayInputStream.java (working copy) @@ -37,10 +37,10 @@ } public void reset(byte[] input, int start, int length) { - this.buf = input; - this.count = start + length; - this.mark = start; - this.pos = start; + buf = input; + count = start + length; + mark = start; + pos = start; } public int getPosition() { @@ -54,6 +54,7 @@ /** * {@inheritDoc} */ + @Override public int read() { return (pos < count) ? (buf[pos++] & 0xff) : -1; } @@ -61,6 +62,7 @@ /** * {@inheritDoc} */ + @Override public int read(byte b[], int off, int len) { if (b == null) { throw new NullPointerException(); @@ -84,6 +86,7 @@ /** * {@inheritDoc} */ + @Override public long skip(long n) { if (pos + n > count) { n = count - pos; @@ -98,6 +101,7 @@ /** * {@inheritDoc} */ + @Override public int available() { return count - pos; } Index: common/src/java/org/apache/hadoop/hive/common/io/NonSyncByteArrayOutputStream.java =================================================================== --- common/src/java/org/apache/hadoop/hive/common/io/NonSyncByteArrayOutputStream.java (revision 901511) +++ common/src/java/org/apache/hadoop/hive/common/io/NonSyncByteArrayOutputStream.java (working copy) @@ -46,6 +46,7 @@ /** * {@inheritDoc} */ + @Override public void reset() { count = 0; } @@ -59,6 +60,7 @@ /** * {@inheritDoc} */ + @Override public void write(int b) { enLargeBuffer(1); buf[count] = (byte) b; @@ -69,8 +71,9 @@ int temp = count + increment; int newLen = temp; if (temp > buf.length) { - if ((buf.length << 1) > temp) + if ((buf.length << 1) > temp) { newLen = buf.length << 1; + } byte newbuf[] = new byte[newLen]; System.arraycopy(buf, 0, newbuf, 0, count); buf = newbuf; @@ -81,6 +84,7 @@ /** * {@inheritDoc} */ + @Override public void write(byte b[], int off, int len) { if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) { @@ -96,6 +100,7 @@ /** * {@inheritDoc} */ + @Override public void writeTo(OutputStream out) throws IOException { out.write(buf, 0, count); }