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

can't decode null java date #90

Closed
wongoo opened this issue Jul 1, 2019 · 6 comments
Closed

can't decode null java date #90

wongoo opened this issue Jul 1, 2019 · 6 comments
Assignees
Labels
Milestone

Comments

@wongoo
Copy link
Contributor

wongoo commented Jul 1, 2019

What happened:
link to: apache/dubbo-go#105

What you expected to happen:
enable to decode null java date object

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

@aliiohs
Copy link
Member

aliiohs commented Jul 1, 2019

i will try it.

@wongoo
Copy link
Contributor Author

wongoo commented Jul 2, 2019

@aliiohs first u must ensure what's the encode result of null java date in java, then encode it to a zero go date, eg var _zeroDate time.Time. pls let me know for any question.

@wongoo wongoo added this to the v1.2.0 milestone Jul 2, 2019
@wongoo wongoo added the urgent label Jul 2, 2019
@lovepoem
Copy link
Member

I will have a try

@lovepoem
Copy link
Member

lovepoem commented Jul 10, 2019

/**java

/**
 * Writes a null value to the stream.
 * The null will be written with the following syntax
 * <p>
 * <code><pre>
 * N
 * </pre></code>
 *
 * @param value the string value to write.
 */
@Override
public void writeNull()
        throws IOException {
    os.write('N');
}

**/

when a field is null , the write stream is N

/**java

/**
 * Reads an arbitrary object from the input stream when the type
 * is unknown.
 */
public Object readObject(List<Class<?>> expectedTypes)
        throws IOException {
    int tag = read();

    switch (tag) {
        case 'N':
            return null;

*/

when a stream is N, then get null in java

@lovepoem
Copy link
Member

then encode it to a zero go date

What is zero go date, how to produce it ? @wongoo

@wongoo
Copy link
Contributor Author

wongoo commented Jul 10, 2019

@lovepoem a definition without assigment of time.Time is a zero go date , eg var _zeroDate time.Time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants