Skip to content

Conversation

popematt
Copy link
Contributor

Issue #, if available:

Description of changes:

This is an API that's safer than just calling the methods on MacroAwareIonWriter directly, and it works with the WriteAsIon interface (ish). It automatically handles expression groups. It allows you to make "prepared" E-Expressions that you can then write later, and it also supports "direct" e-expressions where the macro invocation and arguments are written directly to an IonWriter.

I know there's some junk in this PR, and there are no real tests for it yet. Ignore those parts.

The interesting bits that are worth looking at are WriteAsIon, IonManagedWriter_1_1, and maybe ArgumentBuilder

Maybe I over-designed this... I think i could probably build something workable directly into IonManagedWriter_1_1, or even into the raw writer, since the (binary) raw writer already needs to be aware of the encoding type in order to correctly write tagless arguments. ...yeah, I definitely over-designed this. If there's anything that you think is worth keeping, let me know.

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

Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 20.49689% with 384 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (ion-11-encoding@13607b9). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...n/ion/eexp/ArgumentValidatingIonWriterDecorator.kt 6.61% 126 Missing and 1 partial ⚠️
...main/java/com/amazon/ion/eexp/IonWriterRecorder.kt 0.00% 99 Missing ⚠️
...zon/ion/eexp/checkArgumentEncodingCompatibility.kt 6.12% 44 Missing and 2 partials ⚠️
...zon/ion/eexp/PreparedEExpressionArgumentBuilder.kt 0.00% 44 Missing ⚠️
...mazon/ion/eexp/DirectEExpressionArgumentBuilder.kt 40.00% 26 Missing and 4 partials ⚠️
...in/java/com/amazon/ion/eexp/PreparedEExpression.kt 0.00% 13 Missing ⚠️
...amazon/ion/impl/DefaultReaderToWriterTransfer.java 90.90% 3 Missing and 2 partials ⚠️
.../com/amazon/ion/eexp/EExpressionArgumentBuilder.kt 0.00% 4 Missing ⚠️
.../com/amazon/ion/impl/bin/IonRawBinaryWriter_1_1.kt 0.00% 4 Missing ⚠️
...va/com/amazon/ion/impl/bin/IonManagedWriter_1_1.kt 62.50% 2 Missing and 1 partial ⚠️
... and 5 more
Additional details and impacted files
@@                Coverage Diff                 @@
##             ion-11-encoding    #1087   +/-   ##
==================================================
  Coverage                   ?   70.00%           
  Complexity                 ?     7471           
==================================================
  Files                      ?      223           
  Lines                      ?    30092           
  Branches                   ?     5412           
==================================================
  Hits                       ?    21067           
  Misses                     ?     7349           
  Partials                   ?     1676           

☔ 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.

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.

1 participant