Repository: amzn/ion-java
Pull request #311 (2020-09-04 22:24:26)

Revert "Adds a space after a fieldname's colon when pretty-printing (…
…#289)"

This reverts commit 5d62f9ab6ee912f2812071fcec9454bd17c3d134.

*Issue #, if available:*

*Description of changes:*


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


codecov[bot]: # [Codecov](https://codecov.io/gh/amzn/ion-java/pull/311?src=pr&el=h1) Report
> Merging [#311](https://codecov.io/gh/amzn/ion-java/pull/311?src=pr&el=desc) into [master](https://codecov.io/gh/amzn/ion-java/commit/73e26b1c5e6b7d943b64652d6c6efb69e083a809?el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/amzn/ion-java/pull/311/graphs/tree.svg?width=650&height=150&src=pr&token=M93Y3e3kKn)](https://codecov.io/gh/amzn/ion-java/pull/311?src=pr&el=tree)

```diff
@@             Coverage Diff              @@
##             master     #311      +/-   ##
============================================
- Coverage     63.89%   63.87%   -0.02%     
+ Complexity     4811     4809       -2     
============================================
  Files           136      136              
  Lines         21062    21060       -2     
  Branches       3817     3816       -1     
============================================
- Hits          13457    13452       -5     
- Misses         6267     6268       +1     
- Partials       1338     1340       +2     
```


| [Impacted Files](https://codecov.io/gh/amzn/ion-java/pull/311?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [src/com/amazon/ion/impl/IonWriterSystemText.java](https://codecov.io/gh/amzn/ion-java/pull/311/diff?src=pr&el=tree#diff-c3JjL2NvbS9hbWF6b24vaW9uL2ltcGwvSW9uV3JpdGVyU3lzdGVtVGV4dC5qYXZh) | `85.62% <ø> (-0.09%)` | `102.00 <0.00> (-1.00)` | |
| [src/com/amazon/ion/impl/BlockedBuffer.java](https://codecov.io/gh/amzn/ion-java/pull/311/diff?src=pr&el=tree#diff-c3JjL2NvbS9hbWF6b24vaW9uL2ltcGwvQmxvY2tlZEJ1ZmZlci5qYXZh) | `50.60% <0.00%> (-0.37%)` | `76.00% <0.00%> (-1.00%)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/amzn/ion-java/pull/311?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/amzn/ion-java/pull/311?src=pr&el=footer). Last update [73e26b1...674307e](https://codecov.io/gh/amzn/ion-java/pull/311?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/src/com/amazon/ion/impl/IonWriterSystemText.java b/src/com/amazon/ion/impl/IonWriterSystemText.java
index f577c26e..0e78e95c 100644
--- a/src/com/amazon/ion/impl/IonWriterSystemText.java
+++ b/src/com/amazon/ion/impl/IonWriterSystemText.java
@@ -366,9 +366,6 @@ class IonWriterSystemText
             SymbolToken sym = assumeFieldNameSymbol();
             writeFieldNameToken(sym);
             _output.appendAscii(':');
-            if (_options.isPrettyPrintOn()) {
-                _output.appendAscii(' ');
-            }
             clearFieldName();
             followingLongString = false;
         }


Test patch:
diff --git a/test/com/amazon/ion/impl/IonMarkupWriterTest.java b/test/com/amazon/ion/impl/IonMarkupWriterTest.java
index f7067d05..b84d7a7d 100644
--- a/test/com/amazon/ion/impl/IonMarkupWriterTest.java
+++ b/test/com/amazon/ion/impl/IonMarkupWriterTest.java
@@ -54,7 +54,7 @@ public class IonMarkupWriterTest extends IonTestCase {
             "%n<beforeAnnotations STRUCT><beforeEachAnnotation STRUCT>abcd" +
             "<afterEachAnnotation STRUCT>::<afterAnnotations STRUCT><beforeData" +
             " STRUCT>{<afterStepIn STRUCT>%n  <beforeFieldName SEXP>hello" +
-            "<afterFieldName SEXP>: <beforeData SEXP>(<afterStepIn SEXP>%n    " +
+            "<afterFieldName SEXP>:<beforeData SEXP>(<afterStepIn SEXP>%n    " +
             "<beforeData SYMBOL>sexp<afterData SYMBOL><beforeSeparator SEXP>" +
             "%n    <afterSeparator SEXP><beforeData INT>1<afterData INT>" +
             "<beforeSeparator SEXP>%n    <afterSeparator SEXP><beforeData INT>2" +
@@ -62,12 +62,12 @@ public class IonMarkupWriterTest extends IonTestCase {
             "<beforeData STRING>\"str\"<afterData STRING><beforeStepOut SEXP>%n  " +
             ")<afterData SEXP><beforeSeparator STRUCT>,%n  " +
             "<afterSeparator STRUCT><beforeFieldName LIST>list<afterFieldName " +
-            "LIST>: <beforeData LIST>[<afterStepIn LIST>%n    <beforeData " +
+            "LIST>:<beforeData LIST>[<afterStepIn LIST>%n    <beforeData " +
             "DECIMAL>3.2<afterData DECIMAL><beforeSeparator LIST>,%n    " +
             "<afterSeparator LIST><beforeData FLOAT>3.2e0<afterData FLOAT>" +
             "<beforeStepOut LIST>%n  ]<afterData LIST><beforeSeparator STRUCT>" +
             ",%n  <afterSeparator STRUCT><beforeFieldName BLOB>blob" +
-            "<afterFieldName BLOB>: <beforeAnnotations BLOB>" +
+            "<afterFieldName BLOB>:<beforeAnnotations BLOB>" +
             "<beforeEachAnnotation BLOB>annot<afterEachAnnotation BLOB>::" +
             "<afterAnnotations BLOB><beforeData BLOB>" +
             "{{ T25lIEJpZyBGYXQgVGVzdCBCbG9iIEZvciBZb3VyIFBsZWFzdXJl }}" +
diff --git a/test/com/amazon/ion/impl/TextWriterTest.java b/test/com/amazon/ion/impl/TextWriterTest.java
index 8c8b527b..ba57d634 100644
--- a/test/com/amazon/ion/impl/TextWriterTest.java
+++ b/test/com/amazon/ion/impl/TextWriterTest.java
@@ -287,14 +287,14 @@ public class TextWriterTest
                 "%n" +
                 "'''looong'''%n" +
                 "{%n" +
-                "  a: '''looong''',%n" +
-                "  b: \"hello\",%n" +
-                "  c: '''hello\n" +
+                        "  a:'''looong''',%n" +
+                "  b:\"hello\",%n" +
+                "  c:'''hello\n" +
                         "nurse''',%n" +
-                "  d: '''what\\'s\n" +
+                        "  d:'''what\\'s\n" +
                         "up\n" +
                         "doc'''%n" +
-                "}"
+                        "}"
             ),
             dg
         );