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

possible issue #8

Closed
dagavriliu opened this issue Mar 30, 2014 · 5 comments
Closed

possible issue #8

dagavriliu opened this issue Mar 30, 2014 · 5 comments
Assignees

Comments

@dagavriliu
Copy link

In JsonWriter @ private void writeArray(Object array, boolean showType)
line 888:

boolean typeWritten = showType && !(Object[].class == arrayType);

For a reason I cannot explain due to my little knowledge of Java, the type verification for array appears invalid in Netbeans 7.4, Java 1.7, Win7
the particular error message is "lambda expression not expected here illegal start of expression ..."

I tried using

boolean typeWritten = showType && !(array instanceof Object[]);

This seems to remove that error message, but since my knowledge of Java is limited, I was hoping you could check if this is correct, and if so, perhaps change the particular line of code.
Thanks for reading this,
Have a nice day!

P.S. If this is not applicable, please remove the issue, and if possible let me know.

@jdereg
Copy link
Owner

jdereg commented Mar 30, 2014

See if it will allow the following equivalent statement:

    boolean typeWritten = showType && !(arrayType.equals(Object[].class));

If so, let me know, and I will incorporate this into the next update.

@jdereg
Copy link
Owner

jdereg commented Mar 30, 2014

I forgot to mention, the example you sent, fails in 2 test cases. You can try this if you have the TestJsonReaderWriter.java file and run the tests there. The code is working fine for me in both Eclipse and Intellij. This sounds like a bug in NetBeans. It also works fine in both Java 1.6 / 1.7.

@dagavriliu
Copy link
Author

After using your suggested variant, everything worked as expected - no
silly Netbeans error.

Thank you for your time.

On Sun, Mar 30, 2014 at 11:27 PM, John DeRegnaucourt <
notifications@github.com> wrote:

See if it will allow the following equivalent statement:

boolean typeWritten = showType && !(arrayType.equals(Object[].class));

If so, let me know, and I will incorporate this into the next update.


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-39038351
.

@jdereg
Copy link
Owner

jdereg commented Mar 30, 2014

I just committed the variant to the head of json-io. In the next release (2.5.3 or 2.6.0), it will be released. In the meantime, just use the line I sent you.

@jdereg jdereg closed this as completed Mar 30, 2014
@dagavriliu
Copy link
Author

Great ! Thank you very much and all the best !
On Mar 31, 2014 2:43 AM, "John DeRegnaucourt" notifications@github.com
wrote:

I just committed the variant to the head of json-io. In the next release
(2.5.3 or 2.6.0), it will be released. In the meantime, just use the line I
sent you.


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-39044401
.

@jdereg jdereg self-assigned this Jun 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants