Skip to content

Fix deprecated Boolean is-prefix properties in plugin task/config classes (removed in Gradle 9.0) #22

Description

@Besi97

Deprecation Warning

Methods like isXxx() returning boxed Boolean violate the Java Bean specification. Gradle currently recognizes them as properties but will stop doing so in Gradle 9.0. This affects task inputs and may cause tasks to be incorrectly considered up-to-date.

Where

Plugin Java source classes:

  • GraphQLCodegenGradleTask
  • GraphQLCodegenConfiguration
  • SchemaFinderConfig

Affected properties

isGenerateModelOpenClasses, isGenerateModelsWithPublicFields, isGenerateNoArgsConstructorOnly, isGenerateSealedInterfaces, isInitializeNullableTypes, isSkip, isSupportUnknownFields, isRecursive

Fix (option 1 - non-breaking)

Add getXxx() methods alongside the existing isXxx() methods:

@Deprecated
@ReplacedBy("getGenerateModelOpenClasses")
public Boolean isGenerateModelOpenClasses() { return generateModelOpenClasses; }

@Input
public Boolean getGenerateModelOpenClasses() { return generateModelOpenClasses; }

Fix (option 2 - breaking)

Change the return type from Boolean to primitive boolean.

Removed in

Gradle 9.0

Resource

https://docs.gradle.org/8.14.3/userguide/upgrading_version_8.html#groovy_boolean_properties

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions