[ 
https://issues.apache.org/jira/browse/NIFI-545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mark Payne updated NIFI-545:
----------------------------
    Attachment: 0001-NIFI-545-Code-cleanup.patch

> DataFlowDaoImpl writeDataFlow creates an unused dataflow
> --------------------------------------------------------
>
>                 Key: NIFI-545
>                 URL: https://issues.apache.org/jira/browse/NIFI-545
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 0.0.2
>            Reporter: Mark Latimer
>            Assignee: Mark Payne
>            Priority: Trivial
>             Fix For: 0.2.0
>
>         Attachments: 0001-NIFI-545-Code-cleanup.patch
>
>
> {code:title=DataFlowDaoImpl.java}
>   private void writeDataFlow(final File file, final ClusterDataFlow 
> clusterDataFlow) throws IOException, JAXBException {
>         // get the data flow
>         DataFlow dataFlow = clusterDataFlow.getDataFlow();
>         // if no dataflow, then write a new dataflow
>         if (dataFlow == null) {
> //dataFlow created but not used
>             dataFlow = new StandardDataFlow(new byte[0], new byte[0], new 
> byte[0]);
>         }
>         // setup the cluster metadata
>         final ClusterMetadata clusterMetadata = new ClusterMetadata();
>         clusterMetadata.setPrimaryNodeId(clusterDataFlow.getPrimaryNodeId());
>         // write to disk
> //write the unmodified clusterDataFlow
> //if the clusterDataFlows dataFlow element is null a getEmptyFlowBytes() is 
> written
>         writeDataFlow(file, clusterDataFlow, clusterMetadata);
>     }
> {code}
> Not clear if the null check is ever true but if it is the new DataFlow is not 
> used. Another findbug reported issue.



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

Reply via email to