HDFS-2646. Hadoop HttpFS introduced 4 findbug warnings. (tucu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1221572 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Alejandro Abdelnur 2011-12-21 02:46:04 +00:00
parent 8626f1bc6c
commit 45620eee68
5 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,12 @@
<FindBugsFilter>
<Match>
<Class name="org.apache.hadoop.lib.service.instrumentation.InstrumentationService" />
<Method name="getToAdd" />
<Bug pattern="UL_UNRELEASED_LOCK" />
</Match>
<Match>
<Class name="org.apache.hadoop.fs.http.server.HttpFSServerWebApp" />
<Method name="destroy" />
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
</Match>
</FindBugsFilter>

View File

@ -384,6 +384,13 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -111,7 +111,7 @@ private static String format(ERROR error, Object... args) {
}
template = sb.deleteCharAt(0).toString();
}
return error + ": " + MessageFormat.format(error.getTemplate(), args);
return error + ": " + MessageFormat.format(template, args);
}
/**

View File

@ -42,7 +42,10 @@ public InputStreamEntity(InputStream is) {
@Override
public void write(OutputStream os) throws IOException {
is.skip(offset);
long skipped = is.skip(offset);
if (skipped < offset) {
throw new IOException("Requested offset beyond stream size");
}
if (len == -1) {
IOUtils.copyBytes(is, os, 4096, true);
} else {

View File

@ -180,6 +180,8 @@ Trunk (unreleased changes)
HDFS-2658. HttpFS introduced 70 javadoc warnings. (tucu)
HDFS-2646. Hadoop HttpFS introduced 4 findbug warnings. (tucu)
Release 0.23.1 - UNRELEASED
INCOMPATIBLE CHANGES