[
https://issues.apache.org/jira/browse/NIFI-571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mark Latimer updated NIFI-571:
------------------------------
Attachment: 0003-Check-list-of-lists-for-ControllerServiceNode.patch
patch 1 and 2 add extra type checking which build OK against latest head and
tests pass.
Patch 3 fixes the findbugs warning checking the list of lists contains the
given service but breaks the tests.
The first break occurs at line 248 in
TestStandardControllerServiceProvider.testOrderingOfServices
where the desired outcome is two branches( 1: Service2, Service1 and 2:
Service2)
I can see three reasonable situations:
1. The test is correct and the check for the the Node In the List of Lists is
not required.
2. The test is incorrect and it Service two should appear only once.
3. I have completely misunderstood the code.
Note other rests in this file will fail as well.
> 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
> Priority: Minor
> Attachments: 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)