Closed raycobd closed 5 years ago
Here: https://github.com/osglworks/java-tool/blob/master/src/main/java/org/osgl/util/Unsafe.java
static { try { STRING_BUF = String.class.getDeclaredField("value"); STRING_BUF.setAccessible(true); FASTSTR_BUF = FastStr.class.getDeclaredField("buf"); FASTSTR_BUF.setAccessible(true); char[] ca = new char[0]; if (.JAVA_VERSION >= 7) { SHARED_STR_CONSTRUCTOR = String.class.getDeclaredConstructor(ca.getClass(), Boolean.TYPE); SHARED_STR_CONSTRUCTOR.setAccessible(true); } } catch (NoSuchFieldException var1) { throw E.unexpected(var1); } catch (NoSuchMethodException var2) { throw E.unexpected(var2); } }
In the line 44:
With Java 11 it is throwing an exception:
SHARED_STR_CONSTRUCTOR = String.class.getDeclaredConstructor(ca.getClass(), Boolean.TYPE);
It seems there is no such constructor for the String class.
@raycobd osgl-tool is designed to be working on Java7 and Java8, which does not work on Java 11.
The next version of osgl library is planned to work on modern Java however.
Thanks anyway.
Here: https://github.com/osglworks/java-tool/blob/master/src/main/java/org/osgl/util/Unsafe.java
In the line 44:
With Java 11 it is throwing an exception:
SHARED_STR_CONSTRUCTOR = String.class.getDeclaredConstructor(ca.getClass(), Boolean.TYPE);
It seems there is no such constructor for the String class.