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

ASF subversion and git services commented on NIFI-545:
------------------------------------------------------

Commit 979671ca9719aca6789f213529991fc99d86979d in incubator-nifi's branch 
refs/heads/develop from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-nifi.git;h=979671c ]

NIFI-545: Code cleanup


> 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