Skip to content

Add null checks, improve docs, add tests for high test coverage#265

Merged
skjolber merged 28 commits intomainfrom
aiReview
May 5, 2026
Merged

Add null checks, improve docs, add tests for high test coverage#265
skjolber merged 28 commits intomainfrom
aiReview

Conversation

@skjolber
Copy link
Copy Markdown
Contributor

@skjolber skjolber commented May 4, 2026

Should be 100% test coverage for package no.entur.abt.netex.id and no.entur.abt.netex.id.predicate.

Merge this branch last.

Comment thread src/main/java/no/entur/abt/netex/id/InterningNetexIdParser.java Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens NeTEx ID handling around predicates/builders/parsers, adds regression and branch-coverage tests, and introduces a repository skill file for Java development guidance.

Changes:

  • Fixes predicate null-handling/exception paths and aligns a few public messages/constants/API signatures.
  • Adds builder/parser conveniences such as building from an existing ID and seeding string interning from a broader collection type.
  • Expands unit tests across predicates, validators, parsers, and builders; adds a java-developer skill document.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/test/java/no/entur/abt/netex/id/predicate/NetexIdPredicateBuilderTest.java Adds predicate-builder regression tests for null handling and empty builder state.
src/test/java/no/entur/abt/netex/id/predicate/NetexIdCodespaceTypePredicateTest.java Adds predicate-focused branch/exception tests.
src/test/java/no/entur/abt/netex/id/NetexIdValidatingParserTest.java Adds validating parser coverage for invalid codespace parsing.
src/test/java/no/entur/abt/netex/id/NetexIdParserBuilderTest.java Adds parser-builder coverage for seeded interning with a collection input.
src/test/java/no/entur/abt/netex/id/NetexIdNonValidatingBuilderTest.java Adds happy-path tests for building from an existing ID template.
src/test/java/no/entur/abt/netex/id/NetexIdBuilderTest.java Adds validating-builder tests for null/invalid template IDs.
src/test/java/no/entur/abt/netex/id/DefaultNetexIdValidatorTest.java Expands validator branch coverage for null, casing, digits, offsets, and malformed IDs.
src/main/java/no/entur/abt/netex/id/predicate/NetexIdTypeValidatingPredicate.java Refactors validating type predicate exception flow.
src/main/java/no/entur/abt/netex/id/predicate/NetexIdTypePredicate.java Adds null short-circuiting for non-validating type predicate.
src/main/java/no/entur/abt/netex/id/predicate/NetexIdPredicateBuilder.java Updates type validation error text.
src/main/java/no/entur/abt/netex/id/predicate/NetexIdCodespaceValidatingPredicate.java Refactors validating codespace predicate exception flow.
src/main/java/no/entur/abt/netex/id/predicate/NetexIdCodespaceTypeValidatingPredicate.java Refactors validating codespace+type predicate exception flow.
src/main/java/no/entur/abt/netex/id/predicate/NetexIdCodespaceTypePredicate.java Adds null short-circuiting for non-validating codespace+type predicate.
src/main/java/no/entur/abt/netex/id/predicate/NetexIdCodespacePredicate.java Fixes predicate Javadoc wording.
src/main/java/no/entur/abt/netex/id/NetexIdValidator.java Documents the deprecated offset-based validate overload.
src/main/java/no/entur/abt/netex/id/NetexIdTypes.java Deprecates a typoed constant and adds the corrected alias.
src/main/java/no/entur/abt/netex/id/NetexIdParserBuilder.java Broadens interning-seed API from Set to Collection and updates docs.
src/main/java/no/entur/abt/netex/id/NetexIdNonValidatingBuilder.java Adds template-based builder construction from an existing ID.
src/main/java/no/entur/abt/netex/id/InterningNetexIdParser.java Switches the interning cache to ConcurrentHashMap and simplifies insertion logic.
.github/skills/java-developer/SKILL.md Adds project-specific Java development guidance for the repository skill system.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/no/entur/abt/netex/id/NetexIdParserBuilder.java
Comment thread src/main/java/no/entur/abt/netex/id/predicate/NetexIdTypeValidatingPredicate.java Outdated
Comment thread src/main/java/no/entur/abt/netex/id/NetexIdValidator.java Outdated
skjolber and others added 3 commits May 5, 2026 08:23
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI and others added 2 commits May 5, 2026 06:31
…add null predicate tests

Agent-Logs-Url: https://github.com/entur/netex-utils/sessions/7c46646c-cbdd-4b39-98c9-aebe97c6d474

Co-authored-by: skjolber <1031478+skjolber@users.noreply.github.com>
# Conflicts:
#	src/main/java/no/entur/abt/netex/id/InterningNetexIdParser.java

Co-authored-by: skjolber <1031478+skjolber@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/skills/java-developer/SKILL.md Outdated
@skjolber skjolber marked this pull request as ready for review May 5, 2026 08:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/skills/java-developer/SKILL.md Outdated
Comment thread .github/skills/java-developer/SKILL.md Outdated
skjolber and others added 8 commits May 5, 2026 10:40
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@skjolber skjolber changed the title AI review: Fix one bug, fix multiple inconsistencies, add tests Add null checks, improve dos, add tests for high test coverage May 5, 2026
@skjolber skjolber changed the title Add null checks, improve dos, add tests for high test coverage Add null checks, improve docs, add tests for high test coverage May 5, 2026
@skjolber skjolber merged commit e542e00 into main May 5, 2026
9 checks passed
@skjolber skjolber deleted the aiReview branch May 5, 2026 12:17
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.

4 participants