2

Having strange behavior when running tests. Maven 3.6.3 with Java 8 tests run fine, but when trying Java 11 get the below error when trying to execute the following code:

    public void testUpdateAlignment()
    {
        ImageConfig imageConfig = new ImageConfig();
        imageConfig.setAlignment(ImageAlignment.TOP);

        ImageElement image = Document.get().createImageElement();
        // Apply left alignment.
        image.getStyle().setFloat(com.google.gwt.dom.client.Style.Float.LEFT);
        // Update the alignment.
        imageConfigDOMWriter.write(imageConfig, image);

        assertEquals(ImageAlignment.TOP, imageConfigDOMReader.read(image).getAlignment());
        assertTrue(StringUtils.isEmpty(image.getStyle().getProperty(Style.FLOAT.getJSName())));
    }

Error:

[INFO] java.lang.IncompatibleClassChangeError: Type com.google.gwt.dom.client.Style$Float$1 is not a nest member of com.google.gwt.dom.client.Style: current type is not listed as a nest member
[INFO]  at com.google.gwt.dom.client.Style$Float$1.<init>(Style.java:411)
[INFO]  at com.google.gwt.dom.client.Style$Float.<clinit>(Style.java:411)
[INFO]  at org.xwiki.gwt.wysiwyg.client.plugin.image.ImageConfigDOMWriterTest.testUpdateAlignment(ImageConfigDOMWriterTest.java:136)
[INFO]  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO]  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO]  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:566)
[INFO]  at com.google.gwt.junit.client.impl.GWTTestAccessor.invoke(GWTTestAccessor.java:39)
[INFO]  at com.google.gwt.junit.client.impl.GWTRunner.executeTestMethod(GWTRunner.java:226)
[INFO]  at com.google.gwt.junit.client.GWTTestCase.doRunTest(GWTTestCase.java:157)
[INFO]  at junit.framework.TestCase.runTest(TestCase.java:59)
[INFO]  at com.google.gwt.junit.client.GWTTestCase.runBare(GWTTestCase.java:151)
[INFO]  at com.google.gwt.junit.client.GWTTestCase.__doRunTest(GWTTestCase.java:115)
[INFO]  at com.google.gwt.junit.client.impl.GWTRunner.runTest(GWTRunner.java:302)
[INFO]  at com.google.gwt.junit.client.impl.GWTRunner.doRunTest(GWTRunner.java:235)
[INFO]  at com.google.gwt.junit.client.impl.GWTRunner$TestBlockListener.onSuccess(GWTRunner.java:106)
[INFO]  at com.google.gwt.junit.client.impl.GWTRunner$TestBlockListener.onSuccess(GWTRunner.java:1)
[INFO]  at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
[INFO]  at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:250)
[INFO]  at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412)
[INFO]  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO]  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO]  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:566)
[INFO]  at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
[INFO]  at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
[INFO]  at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
[INFO]  at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:341)
[INFO]  at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:222)
[INFO]  at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:121)
[INFO]  at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:573)
[INFO]  at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:293)
[INFO]  at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
[INFO]  at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
[INFO]  at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:368)
[INFO]  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO]  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO]  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:566)
[INFO]  at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
[INFO]  at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
[INFO]  at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
[INFO]  at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:296)
[INFO]  at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:551)
[INFO]  at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:368)
[INFO]  at java.lang.Thread.run(Thread.java:834)

Did Java 11 change the way enums are accessed, or am I missing something here? Wasn't able to find similar issues any where else. Thank you!

  • 1
    jdk-11 did introduce nest-mates, yes, but the fact that you get a `IncompatibleClassChangeError` might mean a simpler thing here. do you do `mvn clean` before running your tests? – Eugene Jul 26 '21 at 17:03
  • Yes the command that I run every time is `mvn clean install` followed by the flag arguments. – tunnelvisions Jul 27 '21 at 14:56
  • What version of `gwt` are you using? is it compatible with Java-11? You might have to upgrade. – Naman Jul 27 '21 at 15:11
  • Great question, yes I'm using [gwt 2.9](http://www.gwtproject.org/release-notes.html#Release_Notes_2_9_0) which is compatible with Java 11. – tunnelvisions Jul 27 '21 at 15:55

0 Answers0