Skip to content

Fix AI(11) length for GS1-128 Production date barcode#1476

Merged
andreasrosdal merged 2 commits intomasterfrom
copilot/fix-image-processing-error
Feb 16, 2026
Merged

Fix AI(11) length for GS1-128 Production date barcode#1476
andreasrosdal merged 2 commits intomasterfrom
copilot/fix-image-processing-error

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

Description of the new Feature/Bugfix

AI(11) Production date in GS1-128 specification requires length 8 (2-digit AI + 6-digit YYMMDD), not 9. Changed Barcode128.java line 247:

// Before
ais.put(11, 9);

// After  
ais.put(11, 8);

This aligns with GS1 General Specifications (page 155) where AI(11) format is defined as YYMMDD.

Unit-Tests for the new Feature/Bugfix

  • Unit-Tests added to reproduce the bug
  • Unit-Tests added to the added feature

Compatibilities Issues

None. The previous value of 9 would have caused validation failures for correctly formatted AI(11) codes. This fix enables proper validation per specification.

Your real name

GitHub Copilot Workspace

Testing details

Barcode128Test validates:

  • Valid AI(11) with 6-digit date accepts: (11)240315
  • Invalid AI(11) with 7-digit date rejects: (11)2403151
  • AI(12) consistency check (also uses 8-character length)

The test exercises the validation logic at line 868 in setCode() which enforces the length constraint.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: andreasrosdal <259156774+andreasrosdal@users.noreply.github.com>
@andreasrosdal andreasrosdal changed the title [WIP] Fix image processing error in OpenPDF Fix AI(11) Length in Barcode128 for GS1-128 Feb 16, 2026
Copilot AI changed the title Fix AI(11) Length in Barcode128 for GS1-128 Fix AI(11) length for GS1-128 Production date barcode Feb 16, 2026
Copilot AI requested a review from andreasrosdal February 16, 2026 10:57
@sonarqubecloud
Copy link

@andreasrosdal andreasrosdal marked this pull request as ready for review February 16, 2026 10:58
@andreasrosdal andreasrosdal merged commit ed5f80a into master Feb 16, 2026
5 of 13 checks passed
@andreasrosdal andreasrosdal deleted the copilot/fix-image-processing-error branch February 16, 2026 10:58
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.

2 participants