Skip to content

Unexpected error while using a private inner module: "Unable to inject an instance of XXX because it is a private class." #184

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
Change visibility of GinMapBinder.MultimapModule to private.


What is the expected output? What do you see instead?
It is a compilation error where it shouldn't be.


What version of the product are you using? On what operating system?
HEAD


Please provide any additional information below.

Following is the stack trace, it looks like it is using a common utility where 
it shouldn't.

> E.Rebinding 
com.google.gwt.inject.client.multibindings.GinMultibinderTest.GinjectorWithRegul
arBind
>    Invoking generator com.google.gwt.inject.rebind.GinjectorGenerator
>       [ERROR] Generator 'com.google.gwt.inject.rebind.GinjectorGenerator' 
threw an exception while
> rebinding 
'com.google.gwt.inject.client.multibindings.GinMultibinderTest.GinjectorWithRegu
larBind'
> java.lang.IllegalArgumentException: Unable to inject an instance of
> com.google.gwt.inject.client.multibindings.GinMultibinder$SetModule because 
it is a private class.
>   at 
com.google.gwt.inject.rebind.reflect.ReflectUtil.getClassPackageNames(ReflectUti
l.java:237)
>   at 
com.google.gwt.inject.rebind.reflect.ReflectUtil.getTypePackageNames(ReflectUtil
.java:218)
>   at 
com.google.gwt.inject.rebind.reflect.ReflectUtil.getUserPackageName(ReflectUtil.
java:152)
>   at
> 
com.google.gwt.inject.rebind.output.GinjectorBindingsOutputter.write(GinjectorBi
ndingsOutputter.java:105)
>   at
> 
com.google.gwt.inject.rebind.output.GinjectorImplOutputter.writeInjectorHierarch
y(GinjectorImplOutputter.java:128)
>   at
> 
com.google.gwt.inject.rebind.output.GinjectorImplOutputter.writeInjectorHierarch
y(GinjectorImplOutputter.java:125)
>   at
> 
com.google.gwt.inject.rebind.output.GinjectorImplOutputter.write(GinjectorImplOu
tputter.java:115)
>   at 
com.google.gwt.inject.rebind.GinjectorGeneratorImpl.generate(GinjectorGeneratorI
mpl.java:80)
>   at 
com.google.gwt.inject.rebind.GinjectorGenerator.generate(GinjectorGenerator.java
:74)
>   at
> 
com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(Incrementa
lGenerator.java:40)
>   at
> 
com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(Stan
dardGeneratorContext.java:657)
>   at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
>   at 
com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOrac
le.java:79)
>   at 
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:2
76)
>   at 
com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:1
41)
>   at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:595)
>   at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:465)
>   at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
>   at com.google.gwt.core.shared.GWT.create(GWT.java:57)
>   at com.google.gwt.core.client.GWT.create(GWT.java:85)
>   at
> 
com.google.gwt.inject.client.multibindings.GinMultibinderTest.testInject_sameInt
erfaceBoundWithBothRegularAndMultiBind(GinMultibinderTest.java:161)
>   at
> 
com.google.gwt.inject.client.multibindings.__GinMultibinderTest_unitTestImpl.doR
unTest(__GinMultibinderTest_unitTestImpl.java:22)
>   at junit.framework.TestCase.runTest(TestCase.java:62)
>   at com.google.gwt.junit.client.GWTTestCase.runBare(GWTTestCase.java:188)
>   at com.google.gwt.junit.client.GWTTestCase.__doRunTest(GWTTestCase.java:129)
>   at com.google.gwt.junit.client.impl.GWTRunner.runTest(GWTRunner.java:390)
>   at com.google.gwt.junit.client.impl.GWTRunner.doRunTest(GWTRunner.java:318)
>   at com.google.gwt.junit.client.impl.GWTRunner.access$9(GWTRunner.java:312)
>   at 
com.google.gwt.junit.client.impl.GWTRunner$TestBlockListener.onSuccess(GWTRunner
.java:107)
>   at 
com.google.gwt.junit.client.impl.GWTRunner$TestBlockListener.onSuccess(GWTRunner
.java:1)
>   at
> 
com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(Re
questCallbackAdapter.java:232)
>   at 
com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
>   at 
com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.ja
va:395)
>   at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
>   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:43)
>   at java.lang.reflect.Method.invoke(Method.java:601)
>   at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
>   at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
>   at 
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172
)
>   at
> 
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForRetu
rn(BrowserChannelServer.java:338)
>   at 
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelSer
ver.java:219)
>   at 
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
>   at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
>   at 
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
>   at 
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:9
1)
>   at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
>   at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:249)
>   at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
>   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:43)
>   at java.lang.reflect.Method.invoke(Method.java:601)
>   at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
>   at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
>   at 
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172
)
>   at 
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServ
er.java:293)
>   at 
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelSe
rver.java:547)
>   at 
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
>   at java.lang.Thread.run(Thread.java:722)
> [ERROR] Deferred binding failed for
> 
'com.google.gwt.inject.client.multibindings.GinMultibinderTest.GinjectorWithRegu
larBind'; expect
> subsequent failures
> 

Original issue reported on code.google.com by gok...@google.com on 1 Feb 2013 at 11:48

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions