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

JDK 9 support #376

Open
johnpoth opened this issue Apr 24, 2017 · 8 comments
Open

JDK 9 support #376

johnpoth opened this issue Apr 24, 2017 · 8 comments

Comments

@johnpoth
Copy link

The project currently fails on JDK 9:

Caused by: java.lang.ClassCastException: [B cannot be cast to [C

To reproduce:

import org.boon.core.reflection.Reflection;
@Test
    public void testJdk9Support() throws Exception {
        Reflection.respondsTo(null, "dummy");
    }

The above fails in Reflection.java's nested static initializers. I've traced the problem to org.boon.core.reflection.FastStringUtils#toCharArray(java.lang.String) which seem to rely on sun.misc.unsafe. To checkout a full fledged example, see BoonConcurrentTest but I don't think it's needed to illustrate the problem.

Thanks!

@RichardHightower
Copy link
Contributor

Yeah..Stephane Landelle reported this a few years ago. :) Then they added Unsafe back and then they took it out again. I guess it is time to fix it. I will try a fix that keeps perf for 1.8 but loses it only for 1.9. Thanks for reminding me. I am a bit under water now. But I will try to take a poke by end of May. BTW I accept PRs. :)

@cristiammercado
Copy link

Any update on this issue?

@nilskp
Copy link

nilskp commented May 17, 2018

Guess this project is dead.

@konsultaner
Copy link

@RichardHightower Are you going to let this project die because of this issue?

@nhojpatrick
Copy link

any update... or should I assume the project is dead?

for JDK 9 (9.0.4+11) I get;

Caused by: java.lang.ClassCastException: [B cannot be cast to [C
	at org.boon.core.reflection.FastStringUtils$StringImplementation$1.toCharArray(FastStringUtils.java:92)

for JDK 10 (10.0.2+13) I get;

Caused by: java.lang.ClassCastException: [B cannot be cast to [C
	at org.boon.core.reflection.FastStringUtils$StringImplementation$1.toCharArray(FastStringUtils.java:92)

for JDK 11 (11.0.2+9) I get;

Caused by: java.lang.ClassCastException: class [B cannot be cast to class [C ([B and [C are in module java.base of loader 'bootstrap')
	at org.boon.core.reflection.FastStringUtils$StringImplementation$1.toCharArray(FastStringUtils.java:92)

for JDK 12 (12+33) I get;

Caused by: java.lang.ClassCastException: class [B cannot be cast to class [C ([B and [C are in module java.base of loader 'bootstrap')
	at org.boon.core.reflection.FastStringUtils$StringImplementation$1.toCharArray(FastStringUtils.java:92)

for JDK 13 (13-ea+12) I get;

Caused by: java.lang.ClassCastException: class [B cannot be cast to class [C ([B and [C are in module java.base of loader 'bootstrap')
	at org.boon.core.reflection.FastStringUtils$StringImplementation$1.toCharArray(FastStringUtils.java:92)

@konsultaner
Copy link

konsultaner commented Mar 24, 2019

@nhojpatrick Apparently jackson now has the same performance as boon. I exchanged boon with jackson and have not been disappointed by now. The only thing I had to be aware of was to configure the mapper to work as expected (as boon works)

public static final ObjectMapper MAPPER = new ObjectMapper(){{
    this.registerModule(new ParameterNamesModule());
    this.setVisibility(FIELD, ANY);
    this.setSerializationInclusion(JsonInclude.Include.NON_NULL);
    this.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
    this.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS,false);
    this.configure(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS,false);
}};

@jsocola
Copy link

jsocola commented Jun 28, 2020

@RichardHightower do you will continue with boon and qbit?

@benjwarner
Copy link

We have a legacy system that was having this problem.

Using the system property:

-Dorg.boon.faststringutils.disable=true

...seemed to fix the problem.

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

8 participants