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

Dan Bress commented on NIFI-716:
--------------------------------

Mark,
  +1 on catching this as soon as possible(like in the test runner)

   I agree with your thinking about making it invalid, the only reason I was 
iffy on this was because this is a situation where a component is invalid, and 
you (as a user) cannot do anything to make it valid.  But hopefully this type 
of bug would never get past a developer and to a user.

   I'm wondering if we could have some type of ComponentAnalyzer that could run 
some of these checks for us.  Maybe its a maven plugin?  Maybe its done as part 
of the TestRunner?  I could see it checking these common things I mess up all 
the time(p.s. I know sometimes there are valid cases for doing some of the 
things I forget to do, so not sure how to handle that)

# Defining two PropertyDescriptors with the same name
# Defining two PropertyDescriptors with the same description
# Defining two Relationships with the same name
## this is a slightly different behavior than with PropertyDescriptor, but an 
issue none the less
# Defining a PropertyDescriptor, but not adding it to either supported or 
supported dynamic properties
# Defining a Relationship, but not adding it to the list of relationships
# Defining a Processor/ControllerService/ReportingTask but not adding it to the 
service file.
# Not using descriptive annotations(@CapabilityDescription, @Tags)

> Framework allows you to define two properties with the same name
> ----------------------------------------------------------------
>
>                 Key: NIFI-716
>                 URL: https://issues.apache.org/jira/browse/NIFI-716
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 0.1.0
>            Reporter: Dan Bress
>            Priority: Minor
>              Labels: beginner, newbie
>
> If you are lazy and copy and paste a PropertyDescriptor and forget to change 
> the value assigned to name(), the framework(test or regular) does not detect 
> this and proceeds happily.
> It would be great if this situation was detected as soon as possible, and 
> either mark the processor as invalid, or fail to consider it as a possible 
> processor.
> Example
> {code}
> public static final PropertyDescriptor MIN_SIZE = new 
> PropertyDescriptor.Builder()
> .name("Minimum Group Size")
> .description("The minimum size of for the bundle")
> .required(true)
> .defaultValue("0 B")
> .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
> .build();
> public static final PropertyDescriptor MAX_SIZE = new 
> PropertyDescriptor.Builder()
> .name("Minimum Group Size")
> .description("The maximum size for the bundle. If not specified, there is no 
> maximum.")
> .required(false)
> .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
> .build();
> {code}



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

Reply via email to