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

[Bug] Protostuff serialization protocol not support for java.sql.Date #4384

Closed
2 tasks done
fitzf opened this issue Jun 25, 2019 · 0 comments · Fixed by #4386
Closed
2 tasks done

[Bug] Protostuff serialization protocol not support for java.sql.Date #4384

fitzf opened this issue Jun 25, 2019 · 0 comments · Fixed by #4386

Comments

@fitzf
Copy link
Contributor

fitzf commented Jun 25, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.2
  • Operating System version: OSX
  • Java version: 1.8

Steps to reproduce this issue

@Test
public void testSerializeSqlDate() throws IOException, ClassNotFoundException {
    java.sql.Date originTime = new java.sql.Date(System.currentTimeMillis());
    this.protostuffObjectOutput.writeObject(originTime);
    this.flushToInput();

    java.sql.Date serializedTime = protostuffObjectInput.readObject(java.sql.Date.class);
    assertThat(serializedTime, is(originTime));
}

Expected Result

What do you expected from the above steps?

Actual Result

Expected: is <2019-06-25>
   but: was <1970-01-01>
Expected :is <2019-06-25>
  Actual   :<1970-01-01>

If there is an exception, please attach the exception trace:

@fitzf fitzf changed the title [Bug] Protostuff serialization protocol support for java.sql.Date [Bug] Protostuff serialization protocol not support for java.sql.Date Jun 25, 2019
fitzf added a commit to fitzf/dubbo that referenced this issue Jun 25, 2019
CrazyHZM pushed a commit that referenced this issue Jul 3, 2019
…n method for java.sql.Date #4384 (#4386)

* fix: #3727

* style: code tidy up

* style: add apache license

* fix: #3914 protostuff serialize java.sql.Timestamp

* fix: add SqlDateDelegate to fix protostuff custon serialize java.sql.Date

fix #4384
rolandhe pushed a commit to rolandhe/dubbo that referenced this issue Sep 9, 2019
…n method for java.sql.Date apache#4384 (apache#4386)

* fix: apache#3727

* style: code tidy up

* style: add apache license

* fix: apache#3914 protostuff serialize java.sql.Timestamp

* fix: add SqlDateDelegate to fix protostuff custon serialize java.sql.Date

fix apache#4384
rolandhe pushed a commit to rolandhe/dubbo that referenced this issue Sep 9, 2019
…n method for java.sql.Date apache#4384 (apache#4386)

* fix: apache#3727

* style: code tidy up

* style: add apache license

* fix: apache#3914 protostuff serialize java.sql.Timestamp

* fix: add SqlDateDelegate to fix protostuff custon serialize java.sql.Date

fix apache#4384
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant