[ 
https://issues.apache.org/jira/browse/BEAM-11530?focusedWorklogId=529482&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-529482
 ]

ASF GitHub Bot logged work on BEAM-11530:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Dec/20 11:53
            Start Date: 30/Dec/20 11:53
    Worklog Time Spent: 10m 
      Work Description: krakowski commented on pull request #13622:
URL: https://github.com/apache/beam/pull/13622#issuecomment-752471261


   I removed the custom annotation and replaced it with 
`org.apache.avro.reflect.Nullable`. I also refactored the methods responsible 
for checking if a `@Nullable` annotation is present (e.g 
[here](https://github.com/apache/beam/pull/13622/files#diff-beba37fb866fda6032626b6e228d47968f6ff0fee229246061d1fb96b04355cbR192-R198)).
   
   I didn't really know where to put the comment, so I placed it [on top of the 
test 
method](https://github.com/apache/beam/pull/13622/files#diff-404854b8f39406bdf5683ce4ae69f4ca4d055a40511e5c8208aeee9d4fd6ee0aR222-R234)
 as a javadoc.
   
   It looks like I ran into some kind of race condition by force pushing twice 
in a row since the Dataflow check is failing because of a locking problem.
   
   > Cannot lock Java compile cache 
(/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_Examples_Dataflow_Java11_Commit/src/.gradle/6.7.1/javaCompile)
 as it has already been locked by this process.
   
   Is it possible to rerun this check?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 529482)
    Time Spent: 2h 50m  (was: 2h 40m)

> Annotated setter parameters handled wrong in schema creation
> ------------------------------------------------------------
>
>                 Key: BEAM-11530
>                 URL: https://issues.apache.org/jira/browse/BEAM-11530
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>    Affects Versions: 2.26.0
>         Environment: Linux & OpenJDK 15
>            Reporter: Filip Krakowski
>            Priority: P0
>              Labels: annotation, fieldtype, parameter, schema
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> I'm facing an exception telling me that my JavaBean contained a setter for a 
> field that had a mismatching nullable attribute, although both getter and 
> setter (parameters) are annotated with @Nullable.
>  
> The code responsible for determining if a setter's parameter is nullable 
> looks wrong to me, since it -does check if the type (class) itself is 
> annotated with @Nullable instead of checking the actual parameter's 
> annotations- only considers type annotations instead of looking at parameter 
> annotations, too. Java distinguishes between parameter annotations and type 
> annotations. Therefore annotations declared without 
> _java.lang.annotation.ElementType#TYPE_USE_ can't be accessed through 
> _Executable#getAnnotatedParameterTypes()_.
>  
> [FieldValueTypeInformation|https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/FieldValueTypeInformation.java#L234-L236]
> {code:java}
> boolean nullable =
>   Arrays.stream(method.getParameters()[0].getAnnotatedType().getAnnotations())
>         .anyMatch(annotation -> isNullableAnnotation(annotation));{code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to