[ 
https://issues.apache.org/jira/browse/FLINK-7736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16196729#comment-16196729
 ] 

ASF GitHub Bot commented on FLINK-7736:
---------------------------------------

Github user 1m2c3t4 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4784#discussion_r143417796
  
    --- Diff: flink-java/src/main/java/org/apache/flink/api/java/Utils.java ---
    @@ -53,7 +53,7 @@ public static String getCallLocationName() {
        public static String getCallLocationName(int depth) {
                StackTraceElement[] stackTrace = 
Thread.currentThread().getStackTrace();
     
    -           if (stackTrace.length < depth) {
    +           if (stackTrace.length <= depth) {
    --- End diff --
    
    Because the subsequent statement elem = stackTrace[depth]
    will throw ArrayIndexOutOfBoundsException if stackTrace.length <= depth


> Fix some of the alerts raised by lgtm.com
> -----------------------------------------
>
>                 Key: FLINK-7736
>                 URL: https://issues.apache.org/jira/browse/FLINK-7736
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Malcolm Taylor
>            Assignee: Malcolm Taylor
>
> lgtm.com has identified a number of issues giving scope for improvement in 
> the code: [https://lgtm.com/projects/g/apache/flink/alerts/?mode=list]
> This issue is to address some of the simpler ones. Some of these are quite 
> clear bugs such as off-by-one errors. Others are areas where the code might 
> be made clearer, such as use of a variable name which shadows another 
> variable.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to