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

Roman Leventov edited comment on FLINK-16503 at 3/9/20, 9:40 AM:
-----------------------------------------------------------------

Another pattern that should be checked in CI static analysis is a "Java - Class 
Member" pattern:

{{$Type$ $x$ = $y$;}}

Where the "Text" of {{$Type$}} is {{ExecutorService|Executor}} and the "Type" 
of {{$y$}} is {{ScheduledThreadPoolExecutor}}, within type hierarchy.

Currently, this pattern doesn't result in violation findings in production code.


was (Author: leventov):
Another pattern that should be checked in CI static analysis is a "Java - Class 
Member" pattern:

{{$Type$ $x$ = $y$;}}

Where the type of {{$Type$}} is {{ExecutorService|Executor}} and the type of 
{{$y$}} is {{ScheduledThreadPoolExecutor|ForkJoinPool}}, within type hierarchy.

Currently, this pattern doesn't result in violation findings in production code.

> Don't assign ScheduledExecutorService into variables of ExecutorService or 
> Executor types
> -----------------------------------------------------------------------------------------
>
>                 Key: FLINK-16503
>                 URL: https://issues.apache.org/jira/browse/FLINK-16503
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Roman Leventov
>            Priority: Minor
>
> There is an unnecessary efficiency cost to assigning ScheduledExecutorService 
> (typically, ScheduledThreadPoolExecutor) into variables of ExecutorService or 
> Executor types.
> Currently, there is one such occurrence in production code, in 
> TaskManagerRunner, and three more in tests.
> They could be found using IntelliJ's Structural search pattern (and 
> Structural Search inspection):
> {{$x$ = $y$;}}
> Where the Type of {{$x$}} is set to {{ExecutorService|Executor}} ("within 
> type hierarchy" checkbox is off), and the Type of {{$y$}} is set to 
> {{ScheduledThreadPoolExecutor }}("within type hierarchy" checkbox is on).
>   
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to