Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Value When Serialize Type Short #24

Closed
Arya1112 opened this issue Jan 10, 2017 · 5 comments
Closed

Wrong Value When Serialize Type Short #24

Arya1112 opened this issue Jan 10, 2017 · 5 comments

Comments

@Arya1112
Copy link

Arya1112 commented Jan 10, 2017

Please Help ,

I try to serialize type of short , but result serialize mode 'DYNAMIC_MODE' is not expected value .

/*

  • My Testing Code
    */
 package test.json.datatype;

import com.jsoniter.DecodingMode;
import com.jsoniter.JsonIterator;
import com.jsoniter.annotation.JsoniterAnnotationSupport;
import com.jsoniter.output.EncodingMode;
import com.jsoniter.output.JsonStream;

public class ShortJson {
    public static void main(String[] args) {
        JsoniterAnnotationSupport.enable();
        JsonIterator.setMode(DecodingMode.DYNAMIC_MODE_AND_MATCH_FIELD_STRICTLY);
        JsonStream.setMode(EncodingMode.DYNAMIC_MODE);
        Short shortParam=new Short((short)555);
        String expenctedSerializeString=shortParam.toString();
        String serializeShortValue=JsonStream.serialize(new Short((short)555));        
        if(!expenctedSerializeString.equals(serializeShortValue)){
            throw new RuntimeException("Not ExpectedValue ! expected "+ expenctedSerializeString+ " , but serializeResult "+serializeShortValue);
        }
    }
}


Thank's

taowen added a commit that referenced this issue Jan 11, 2017
@taowen
Copy link
Contributor

taowen commented Jan 11, 2017

I just fixed it. A new release will happen soon

@Arya1112
Copy link
Author

Nice , thanks for your support.

@taowen
Copy link
Contributor

taowen commented Jan 11, 2017

@Arya1112 I think I should wait for more testing from you, before cut a new release.

@Arya1112
Copy link
Author

@taowen : ok

@Arya1112
Copy link
Author

Great

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

No branches or pull requests

2 participants