You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected: only AutoValue_DuplicateSpannerConfig in target/classes/org/apache/beam/sdk/io/gcp/spanner/ and target/classes
Actual: there are many AutoValue_* classes, seemingly regenerated from binaries in beam-sdks-java-io-google-cloud-platform in target/classes/org/apache/beam/sdk/io/gcp/spanner/.
Also, it seems there are specific conditions to trigger this bug:
If I my the @AutoValue class into an inner class, only my class was processed.
I also setup a same Gradle project, instead of using Maven, it works fine
This was found by https://github.com/GoogleCloudPlatform/DataflowTemplates/actions/runs/8268070883 and reproduced locally. It is problematic for that project because the duplicated AutoValue_* classes does not handle nullable members correctly. For example, even though the decompiled dependency jar shows the @AutoValue abstract class has nullable members, e.g.
nullable annotations get lost in the duplicate (generated) AutoValue class, unless my project duplicate the sources of the dependency jar (that is what currently did in DataflowTemplates/v1/.../gcp/spanner
The text was updated successfully, but these errors were encountered:
Could it be that the Apache Beam sources are present in the compile class path? Javac could then possibly compile them and thus process them, but there likely is a workaround.
Could it be that the Apache Beam sources are present in the compile class path
Apache Beam jar (compiled .class) is present in compile class path, though the source code does not.
Current workaround is to duplicate the affected Beam sources into the project, so autovalue still generate duplicated class but with correct nullness handling
There are in fact source files in the Apache Beam jar: beam-jar-source-files.txt. I don't know if that is the source of the problem, though. It doesn't look as if any of the sources contain @AutoValue classes.
My Maven project is a java library, and it has another java library dependency, both my project and that dependency are under same package name.
Here is a minimum example.
My project has a single source file:
and declared a dependency
Run
mvn clean compile
Expected: only AutoValue_DuplicateSpannerConfig in
target/classes/org/apache/beam/sdk/io/gcp/spanner/
andtarget/classes
Actual: there are many AutoValue_* classes, seemingly regenerated from binaries in
beam-sdks-java-io-google-cloud-platform
intarget/classes/org/apache/beam/sdk/io/gcp/spanner/
.Also, it seems there are specific conditions to trigger this bug:
If I my the
@AutoValue
class into an inner class, only my class was processed.I also setup a same Gradle project, instead of using Maven, it works fine
The example is also available at https://github.com/Abacn/codesnippets/tree/master/AutoValueTest .
This was found by https://github.com/GoogleCloudPlatform/DataflowTemplates/actions/runs/8268070883 and reproduced locally. It is problematic for that project because the duplicated AutoValue_* classes does not handle nullable members correctly. For example, even though the decompiled dependency jar shows the
@AutoValue
abstract class has nullable members, e.g.and the AutoValue class in the dependency jar correctly marked it nullable
nullable annotations get lost in the duplicate (generated) AutoValue class, unless my project duplicate the sources of the dependency jar (that is what currently did in DataflowTemplates/v1/.../gcp/spanner
The text was updated successfully, but these errors were encountered: