java.lang.CompatibileClassChangeError:type com.google.gwt.dom.client.style$float$1不是com.google.gwt.dom.client.style的嵌套成员

chy5wohz  于 2021-09-13  发布在  Java
关注(0)|答案(0)|浏览(212)

在运行测试时有奇怪的行为。带有java 8的maven 3.6.3测试运行良好,但在尝试java 11时,在尝试执行以下代码时会出现以下错误:

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())));
    }

错误:

[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)

Java11是否改变了访问枚举的方式,或者我在这里遗漏了什么?在其他任何地方都找不到类似的问题。非常感谢。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题