Skip to content

Adds Macro APIs - #1105

Merged
popematt merged 4 commits into
amazon-ion:ion11from
popematt:macro-api
Oct 8, 2025
Merged

popematt merged 4 commits into
amazon-ion:ion11from
popematt:macro-api

Conversation

@popematt

@popematt popematt commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

Issue #, if available:

None.

Description of changes:

  • Adds interfaces for an Ion 1.1 capable managed Ion writer, and an Ion 1.1 raw writer
  • Adds Macro interface, along with an implementation, with a fluent builder for creating the template body.
  • Incidental changes
    • Updates JUnit dependency because 4.13.0 has a vulnerability (although we were not affected by it)
    • Updates a few dependencies so that we can build with (and test against) Java 25.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov

codecov Bot commented Oct 7, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.50000% with 68 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (ion11@2e80a92). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/main/java/com/amazon/ion/ion_1_1/MacroImpl.kt 38.70% 36 Missing and 2 partials ⚠️
.../java/com/amazon/ion/ion_1_1/TemplateExpression.kt 20.00% 28 Missing ⚠️
...in/java/com/amazon/ion/ion_1_1/IonRawWriter_1_1.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             ion11    #1105   +/-   ##
========================================
  Coverage         ?   68.07%           
  Complexity       ?     5709           
========================================
  Files            ?      181           
  Lines            ?    23816           
  Branches         ?     4228           
========================================
  Hits             ?    16212           
  Misses           ?     6304           
  Partials         ?     1300           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/main/java/com/amazon/ion/ion_1_1/IonRawWriter_1_1.kt
Comment thread src/main/java/com/amazon/ion/ion_1_1/IonRawWriter_1_1.kt Outdated
Comment thread src/main/java/com/amazon/ion/ion_1_1/IonRawWriter_1_1.kt Outdated

fun writeTaglessPlaceholder(taglessEncodingOpcode: Int)

fun stepInDirective(directive: Int) {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Enum?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure after what we learned about ints vs enums in IonCursorBinary. Since it's the raw writer, I think that ints are okay here, but I need to add proper documentation before I merge the PR.

fun writeClob(value: ByteArray) = writeClob(value, 0, value.size)
fun writeClob(value: ByteArray, start: Int, length: Int)

fun stepInTaglessElementList(type: Int)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Enum?

@popematt
popematt merged commit 45f34fc into amazon-ion:ion11 Oct 8, 2025
27 of 33 checks passed
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