Skip to content

Conversation

@mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Nov 4, 2025

🤔 What's changed?

⚡️ What's your motivation?

🏷️ What kind of change is this?

  • 💥 Breaking change (incompatible changes to the API)

📋 Checklist:

Currently, messages are a bit cumbersome to use in combination with
Java. The generated code currently uses long values where Java would
use integers. This leads to some silly code:

```java
lines.add((int) (long) location.getLine());
```

Unfortunately, long values are needed for the timestamp and duration. So
simply replacing longs with integers wouldn't work.

By specifying some upper bounds the code generation can make a more
informed choice about the size of number to use. The choice for 2^31 - 1
is somewhat arbitrary but matches the maximum length of strings in Java
and .Net. In practice, I would expect Gherkin documents to have a much
more reasonable length though.
# Conflicts:
#	jsonschema/src/Attachment.json
#	jsonschema/src/Duration.json
#	jsonschema/src/GherkinDocument.json
#	jsonschema/src/Meta.json
#	jsonschema/src/Pickle.json
#	jsonschema/src/Source.json
#	jsonschema/src/SourceReference.json
#	jsonschema/src/TestCase.json
#	jsonschema/src/TestCaseStarted.json
#	jsonschema/src/Timestamp.json
#	perl/lib/Cucumber/Messages.pm
#	python/src/cucumber_messages/_messages.py
#	ruby/lib/cucumber/messages/attachment.rb
#	ruby/lib/cucumber/messages/gherkin_document.rb
#	ruby/lib/cucumber/messages/meta.rb
#	ruby/lib/cucumber/messages/pickle.rb
#	ruby/lib/cucumber/messages/source.rb
#	ruby/lib/cucumber/messages/source_reference.rb
#	ruby/lib/cucumber/messages/step_match_argument.rb
#	ruby/lib/cucumber/messages/test_case_started.rb
#	ruby/lib/cucumber/messages/test_step.rb
* Set default release version to 17
* Enable Error prone with Nullaway
@mpkorstanje mpkorstanje mentioned this pull request Nov 10, 2025
10 tasks
@mpkorstanje mpkorstanje marked this pull request as draft November 10, 2025 17:09
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