Skip to content

Commit fab9afd

Browse files
committed
fix some alerts raised by LGTM
1 parent acdb0a1 commit fab9afd

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosName.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static String replaceParameters(String format,
281281
if (paramNum != null) {
282282
try {
283283
int num = Integer.parseInt(paramNum);
284-
if (num < 0 || num > params.length) {
284+
if (num < 0 || num >= params.length) {
285285
throw new BadFormatString("index " + num + " from " + format +
286286
" is outside of the valid range 0 to " +
287287
(params.length - 1));

hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ public void logCurrentHadoopUser() {
926926
UserGroupInformation realUser = currentUser.getRealUser();
927927
LOG.info("Real User = {}" , realUser);
928928
} catch (IOException e) {
929-
LOG.warn("Failed to get current user {}, {}", e);
929+
LOG.warn("Failed to get current user, {}", e);
930930
}
931931
}
932932

hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSExceptionProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected void log(Response.Status status, Throwable throwable) {
9292
String path = MDC.get("path");
9393
String message = getOneLineMessage(throwable);
9494
AUDIT_LOG.warn("FAILED [{}:{}] response [{}] {}", new Object[]{method, path, status, message});
95-
LOG.warn("[{}:{}] response [{}] {}", new Object[]{method, path, status, message}, throwable);
95+
LOG.warn("[{}:{}] response [{}] {}", method, path, status, message, throwable);
9696
}
9797

9898
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/GenericExceptionHandler.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ public Response toResponse(Exception e) {
8787
s = Response.Status.BAD_REQUEST;
8888
} else if (e instanceof IllegalArgumentException) {
8989
s = Response.Status.BAD_REQUEST;
90-
} else if (e instanceof NumberFormatException) {
91-
s = Response.Status.BAD_REQUEST;
9290
} else if (e instanceof BadRequestException) {
9391
s = Response.Status.BAD_REQUEST;
9492
} else if (e instanceof WebApplicationException

0 commit comments

Comments
 (0)