Skip to content

fix: null-safety and config validation for aws.s3.toggles source#3

Merged
anydef merged 8 commits into
mainfrom
copilot/fix-code-for-review-comments
Jul 2, 2026
Merged

fix: null-safety and config validation for aws.s3.toggles source#3
anydef merged 8 commits into
mainfrom
copilot/fix-code-for-review-comments

Conversation

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Three issues flagged in review on the aws.s3.toggles source: missing config validation causing opaque NPEs, and unsafe auto-unboxing of a nullable Property<Boolean> in the Spring demo.

Changes

  • CoreSourceFactory – Validate bucketName and togglesFolder before building S3TogglesSource; throw IllegalArgumentException with the missing key name instead of letting Lombok @NonNull or asS3Folder fail silently with no context:

    String bucketName = context.getConfiguration().getValue("otto.config.aws.s3.toggles.bucket.name");
    if (bucketName == null) {
        throw new IllegalArgumentException("Missing required configuration key: otto.config.aws.s3.toggles.bucket.name");
    }
  • demo/spring/DemoService – Replace auto-unboxing s3Toggle1.getValue() ? … with Boolean.TRUE.equals(s3Toggle1.getValue()) ? … to avoid NPE when the toggle is absent. Matches the pattern already used in the Helidon demo.

  • CoreSourceFactoryTest – Two new tests assert IllegalArgumentException is thrown when bucketName or togglesFolder is missing from configuration.

Copilot AI added 2 commits July 2, 2026 11:35
- CoreSourceFactory: validate bucketName and togglesFolder with
  IllegalArgumentException when missing from configuration
- demo/spring/DemoService: use Boolean.TRUE.equals() for null-safe
  toggle check to prevent NPE on auto-unboxing
- CoreSourceFactoryTest: add tests for missing bucket name and folder
  name validation
Copilot AI changed the title [WIP] Fix code based on review comments fix: null-safety and config validation for aws.s3.toggles source Jul 2, 2026
Copilot AI requested a review from anydef July 2, 2026 11:41
Copilot finished work on behalf of anydef July 2, 2026 11:41
@anydef anydef marked this pull request as ready for review July 2, 2026 13:53
@anydef anydef merged commit 5f5ddeb into main Jul 2, 2026
1 check passed
@anydef anydef deleted the copilot/fix-code-for-review-comments branch July 2, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants