Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b476680

Browse files
committed
fix #182 trim lazy any toString
1 parent c1ef60a commit b476680

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

‎src/main/java/com/jsoniter/any/LazyAny.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public final <T> T as(TypeLiteral<T> typeLiteral) {
6868
}
6969

7070
public String toString() {
71-
return new String(data, head, tail - head);
71+
return new String(data, head, tail - head).trim();
7272
}
7373

7474
protected final JsonIterator parse() {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.jsoniter.any;
2+
3+
import junit.framework.TestCase;
4+
5+
public class TestLong extends TestCase {
6+
public void test_to_string_should_trim() {
7+
Any any = Any.lazyLong(" 1000".getBytes(), 0, " 1000".length());
8+
assertEquals("1000", any.toString());
9+
}
10+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /