Github user JPercivall commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi/pull/33#discussion_r79616293
  
    --- Diff: 
minifi-commons/minifi-commons-schema/src/main/java/org/apache/nifi/minifi/commons/schema/ConfigSchema.java
 ---
    @@ -198,4 +305,31 @@ public ComponentStatusRepositorySchema 
getComponentStatusRepositoryProperties()
         public ProvenanceRepositorySchema getProvenanceRepositorySchema() {
             return provenanceRepositorySchema;
         }
    +
    +    public int getVersion() {
    +        return CONFIG_VERSION;
    +    }
    +
    +    /**
    +     * Will replace all characters not in [A-Za-z0-9_] with _
    +     * <p>
    +     * This has potential for collisions so it will also append numbers as 
necessary to prevent that
    +     *
    +     * @param ids  id map of already incremented numbers
    +     * @param name the name
    +     * @return a unique filesystem-friendly id
    +     */
    +    protected static String getUniqueId(Map<String, Integer> ids, String 
name) {
    +        String baseId = StringUtil.isNullOrEmpty(name) ? EMPTY_NAME : 
ID_REPLACE_PATTERN.matcher(name).replaceAll("_");
    +        String id = baseId;
    +        Integer idNum = ids.get(baseId);
    +        while (ids.containsKey(id)) {
    +            id = baseId + "_" + idNum++;
    +        }
    +        if (id != baseId) {
    --- End diff --
    
    Totally down with "!=" for this case.
    
    Lets just comment why it's a valid case so people aren't confused later on.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to