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

Mark Payne commented on NIFI-571:
---------------------------------

Joe,

If you have Service A that depends on Service C, and Service B that depends on 
Service C... then you can end up with Service C in the list twice. But we then 
check isEnabled() before trying to enable it. So having it in the list twice is 
not a problem.

> Findbugs issue in StandardControllerServiceProvider
> ---------------------------------------------------
>
>                 Key: NIFI-571
>                 URL: https://issues.apache.org/jira/browse/NIFI-571
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 0.0.2
>            Reporter: Mark Latimer
>            Assignee: Mark Payne
>            Priority: Minor
>             Fix For: 0.2.0
>
>         Attachments: 
> 0001-NIFI-571-Removed-checking-List-List-ControllerServic.patch, 
> 0001-type-check-StandardControllerServiceProvider.patch, 
> 0002-type-check-TestStandardControllerService.patch, 
> 0003-Check-list-of-lists-for-ControllerServiceNode.patch
>
>
> I am trying and mostly failing to understand a findbugs issue in 
> StandardControllerServiceProvider.
> The error reported is an invalid type error where a ControllerServiceNode is 
> checked against a List of Lists of ControllerServicesNodes. I am inclined to 
> agree this a level of indirection off.
> {code}
>   static List<List<ControllerServiceNode>> determineEnablingOrder(final 
> Map<String, ControllerServiceNode> serviceNodeMap) {
>         final List<List<ControllerServiceNode>> orderedNodeLists = new 
> ArrayList<List<ControllerServiceNode>>();
>         for (final ControllerServiceNode node : serviceNodeMap.values()) {
> //Node is a ControllerServiceNode but orderedList is a List of Lists of 
> ControllerService nodes
>             if (orderedNodeLists.contains(node)) { 
>                 continue;   // this node is already in the list.
>             }
>             final List<ControllerServiceNode> branch = new 
> ArrayList<ControllerServiceNode>();
>             determineEnablingOrder(serviceNodeMap, node, branch, new 
> HashSet<ControllerServiceNode>());
>             orderedNodeLists.add(branch);
>         }
>         return orderedNodeLists;
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to