Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-1105

Classes with triple-underscore cause index out of bound exception in GeneratedNamesUtil

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Workaround Description:
      Hide

      Disable name shortening of generated IOC classes with this system property:

      errai.graph_builder.short_factory_names=false
      

      Show
      Disable name shortening of generated IOC classes with this system property: errai.graph_builder.short_factory_names=false

      Description

      There is an exception on the following line when generating a marhsaller for a class with a triple-underscore: https://github.com/errai/errai/blob/master/errai-ioc/src/main/java/org/jboss/errai/ioc/util/GeneratedNamesUtil.java#L61

      Exception:

      java.util.concurrent.ExecutionException: java.lang.RuntimeException: A fatal error occurred while processing org.dashbuilder.dataset.client.editor.DataColumnDefEditor___Context
              at java.util.concurrent.FutureTask.report(FutureTask.java:122)
              at java.util.concurrent.FutureTask.get(FutureTask.java:192)
              at org.jboss.errai.config.rebind.AsyncGenerators$FutureWrapper.get(AsyncGenerators.java:112)
              at org.jboss.errai.config.rebind.AsyncGenerators$FutureWrapper.get(AsyncGenerators.java:86)
              at org.jboss.errai.config.rebind.AbstractAsyncGenerator.startAsyncGeneratorsAndWaitFor(AbstractAsyncGenerator.java:205)
              at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generate(IOCGenerator.java:62)
              at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
              at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:745)
              at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:103)
              at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78)
              at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:262)
              at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:144)
              at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:597)
              at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:483)
              at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
              at com.google.gwt.core.shared.GWT.createImpl(GWT.java:83)
              at com.google.gwt.core.client.GWT.create(GWT.java:86)
              at org.jboss.errai.ioc.client.Container.bootstrapContainer(Container.java:70)
              at org.jboss.errai.ioc.client.Container.onModuleLoad(Container.java:40)
              at org.jboss.errai.enterprise.client.cdi.AbstractErraiCDITest.gwtSetUp(AbstractErraiCDITest.java:55)
              at com.google.gwt.junit.client.GWTTestCase.setUp(GWTTestCase.java:208)
              at com.google.gwt.junit.client.GWTTestCase.runBare(GWTTestCase.java:150)
              at com.google.gwt.junit.client.GWTTestCase.__doRunTest(GWTTestCase.java:115)
              at com.google.gwt.junit.client.impl.GWTRunner.runTest(GWTRunner.java:302)
              at com.google.gwt.junit.client.impl.GWTRunner.doRunTest(GWTRunner.java:235)
              at com.google.gwt.junit.client.impl.GWTRunner.access$9(GWTRunner.java:229)
              at com.google.gwt.junit.client.impl.GWTRunner$TestBlockListener.onSuccess(GWTRunner.java:106)
              at com.google.gwt.junit.client.impl.GWTRunner$InitialResponseListener.onSuccess(GWTRunner.java:61)
              at com.google.gwt.junit.client.impl.GWTRunner$InitialResponseListener.onSuccess(GWTRunner.java:1)
              at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
              at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:250)
              at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
              at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
              at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
              at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:341)
              at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:222)
              at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:121)
              at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:573)
              at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:293)
              at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
              at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
              at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:368)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
              at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
              at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
              at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:296)
              at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:551)
              at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:368)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.RuntimeException: A fatal error occurred while processing org.dashbuilder.dataset.client.editor.DataColumnDefEditor___Context
              at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCProcessor.processType(IOCProcessor.java:665)
              at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCProcessor.processDependencies(IOCProcessor.java:606)
              at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCProcessor.process(IOCProcessor.java:197)
              at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.generateBootstrappingClassSource(IOCBootstrapGenerator.java:237)
              at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.generate(IOCBootstrapGenerator.java:132)
              at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generate(IOCGenerator.java:72)
              at org.jboss.errai.config.rebind.AbstractAsyncGenerator$1.call(AbstractAsyncGenerator.java:66)
              at org.jboss.errai.config.rebind.AbstractAsyncGenerator$1.call(AbstractAsyncGenerator.java:54)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              ... 1 more
      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
              at java.lang.String.charAt(String.java:658)
              at org.jboss.errai.ioc.util.GeneratedNamesUtil.shortenGeneratedIdentifier(GeneratedNamesUtil.java:61)
              at org.jboss.errai.ioc.util.GeneratedNamesUtil.shortenGeneratedIdentifier(GeneratedNamesUtil.java:53)
              at org.jboss.errai.ioc.rebind.ioc.graph.impl.FactoryNameGenerator.shorten(FactoryNameGenerator.java:65)
              at org.jboss.errai.ioc.rebind.ioc.graph.impl.FactoryNameGenerator.generateFor(FactoryNameGenerator.java:43)
              at org.jboss.errai.ioc.rebind.ioc.graph.impl.DependencyGraphBuilderImpl.addInjectable(DependencyGraphBuilderImpl.java:88)
              at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCProcessor.processType(IOCProcessor.java:646)
              ... 11 more
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mbarkley Max Barkley
                Reporter:
                mbarkley Max Barkley
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: