cucumber-jvm icon indicating copy to clipboard operation
cucumber-jvm copied to clipboard

Messages should interact more gracefully with Java

Open mpkorstanje opened this issue 4 months ago • 0 comments

🤔 What's the problem you're trying to solve?

While converting the plugins to use messages I'm running into some annoyances using the messages API.

✨ What's your proposed solution?

  • Timestamp should use Timestamp(Long seconds, Integer nanos) to match Instants.getEpochSecond and getNano.
  • Location should use Location(Integer line, Integer column). There are no instances were a string in Java can be addressed with a long.
  • Same for Group(List<Group> children, Integer start, String value)

Implementing Comparators for Location and Timestamp could also help avoid some annoyances. (e.g. https://github.com/cucumber/query/blob/main/java/src/main/java/io/cucumber/query/TimestampComparator.java).

⛏ Have you considered any alternatives or workarounds?

No response

📚 Any additional context?

No response

mpkorstanje avatar Jun 10 '25 18:06 mpkorstanje