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

ASF GitHub Bot commented on NIFI-4215:
--------------------------------------

Github user Wesley-Lawrence commented on the issue:

    https://github.com/apache/nifi/pull/2034
  
    Thanks for taking a look @jvwing!
    
    I didn't want to change it, but I keep getting the following error with it;
    ```
    [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-checkstyle-plugin:2.15:check (check-style) on 
project nifi-avro-record-utils: You have 1 Checkstyle violation. -> [Help 1]
    ```
    
    Earlier in the maven log;
    ```
    [INFO] --- maven-checkstyle-plugin:2.15:check (check-style) @ 
nifi-avro-record-utils ---
    [WARNING] src/main/java/org/apache/nifi/avro/AvroTypeUtil.java[275:17] 
(blocks) RightCurly: '}' should be on the same line.
    ```
    
    Which references a `}` I added here;
    ```
    273                if (knownRecordTypes.containsKey(schemaFullName)) {
    274                    return knownRecordTypes.get(schemaFullName);
    275            --> }
    276                else {
    ```
    
    However, this is the style used everywhere in NiFi, and is the one defined 
by the `RightCurly` section below the one I removed.
    
    I suspect it's something weird in my environment, but removing the default 
`RightCurly` definition fixed my issue, and it looks like it was just left over 
from some old migration, so I figured it could be safely removed.
    
    Out of curiosity, if you run a contrib check, do you get the same error I 
do?


> Avro schemas with records that have a field of themselves fail to parse, 
> causing stackoverflow exception
> --------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-4215
>                 URL: https://issues.apache.org/jira/browse/NIFI-4215
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: Wesley L Lawrence
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: nifi-4215.patch
>
>
> Noticed this while attempting to use the AvroSchemaRegsitry with some complex 
> schema. Boiled down, Avro lets you define a schema such as;
> {code}
> { 
>   "namespace": "org.apache.nifi.testing", 
>   "name": "CompositRecord", 
>   "type": "record", 
>   "fields": [ 
>     { 
>       "name": "id", 
>       "type": "int" 
>     }, 
>     { 
>       "name": "value", 
>       "type": "string" 
>     }, 
>     { 
>       "name": "parent", 
>       "type": [
>         "null",
>         "CompositRecord"
>       ]
>     } 
>   ] 
> }
> {code}
> The AvroSchemaRegistry (AvroTypeUtil specifically) will fail to parse, and 
> generate a stackoverflow exception.
> I've whipped up a fix, tested it out in 1.4.0, and am just running through 
> the contrib build before I submit a patch.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to