nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: amzn/ion-java
Pull request #184 (2018-12-12 01:08:05)

Ignores pseudo-IVMs as expected by the specification
*Issues:* #88, #114

*Description of changes:*  top-level values such as `'$ion_1_0'` and `$2` were previously incorrectly processed as IVMs.  Such values are now ignored, which is the expected behavior per the Ion specification.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.



Patch:
diff --git a/src/software/amazon/ion/impl/IonReaderTextRawX.java b/src/software/amazon/ion/impl/IonReaderTextRawX.java
index 8a4e6337..57715b85 100644
--- a/src/software/amazon/ion/impl/IonReaderTextRawX.java
+++ b/src/software/amazon/ion/impl/IonReaderTextRawX.java
@@ -944,7 +944,7 @@ abstract class IonReaderTextRawX
             case ACTION_LOAD_SCALAR:
                 if (t == IonTokenConstsX.TOKEN_SYMBOL_IDENTIFIER) {
                     sb = token_contents_load(t);
-                    int _value_keyword = IonTokenConstsX.keyword(sb, 0, sb.length());
+                    _value_keyword = IonTokenConstsX.keyword(sb, 0, sb.length());
                     switch (_value_keyword) {
                     case IonTokenConstsX.KEYWORD_NULL:
                     {
diff --git a/src/software/amazon/ion/impl/IonReaderTextUserX.java b/src/software/amazon/ion/impl/IonReaderTextUserX.java
index 64fa372a..b1dfc8d5 100644
--- a/src/software/amazon/ion/impl/IonReaderTextUserX.java
+++ b/src/software/amazon/ion/impl/IonReaderTextUserX.java
@@ -146,8 +146,11 @@ class IonReaderTextUserX
                         {
                             if (ION_1_0.equals(version))
                             {
-                                symbol_table_reset();
-                                push_symbol_table(_system_symtab);
+                                if (_value_keyword != IonTokenConstsX.KEYWORD_sid)
+                                {
+                                    symbol_table_reset();
+                                    push_symbol_table(_system_symtab);
+                                }
                                 _has_next_called = false;
                             }
                             else


Test patch:
diff --git a/test/software/amazon/ion/TestUtils.java b/test/software/amazon/ion/TestUtils.java
index f76b96d7..187af1a6 100644
--- a/test/software/amazon/ion/TestUtils.java
+++ b/test/software/amazon/ion/TestUtils.java
@@ -139,7 +139,6 @@ public class TestUtils
             , "bad/utf8/surrogate_2.ion"                    // TODO amzn/ion-java#105
             , "bad/utf8/surrogate_4.ion"                    // TODO amzn/ion-java#105
             , "equivs/paddedInts.10n"                       // TODO amzn/ion-java#54
-            , "equivs/nonIVMNoOps.ion"                      // TODO amzn/ion-java#114
             , "good/subfieldVarUInt32bit.ion"               // TODO amzn/ion-java#62
             , "good/utf16.ion"                              // TODO amzn/ion-java#61
             , "good/utf32.ion"                              // TODO amzn/ion-java#61