google-code-export / gwt-test-utils

Automatically exported from code.google.com/p/gwt-test-utils
1 stars 0 forks source link

Create/replace-with handling does not correctly deal with inner classes #144

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  create a replace-with for a type which is an inner class e.g. 
  <replace-with class="com.sencha.gxt.theme.blue.client.tabs.BluePlainTabPanelAppearance">
    <when-type-is class="com.sencha.gxt.widget.core.client.PlainTabPanel.PlainTabPanelAppearance" />
  </replace-with>

2.  The replacewith will not match as DeferredReplaceWithCreateHandler uses the 
literal class name as the key for lookup ( 
"com.sencha.gxt.widget.core.client.PlainTabPanel$PlainTabPanelAppearance" not 
"com.sencha.gxt.widget.core.client.PlainTabPanel.PlainTabPanelAppearance" )

What is the expected output? What do you see instead?
The replacewith match should work and create the correct class

What version of the product are you using? On what operating system?
test-utils 0.38
gwt 2.4.0

Please provide any additional information below.

Original issue reported on code.google.com by louis.em...@gmail.com on 8 May 2012 at 10:58

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 8 May 2012 at 12:59

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 8 May 2012 at 7:38

GoogleCodeExporter commented 9 years ago
I've just deployed a new 0.39-SNAPSHOT with a fix for this issue, could you 
please five it a try and post some feedback ? Thanks !

Original comment by gael.laz...@gmail.com on 9 May 2012 at 6:01

GoogleCodeExporter commented 9 years ago
no, the fix still doesn't work for this particular use case.  The issue is the 
line
in DeferredReplaceWithCreateHandler

    List<ReplaceWithData> replaceWithList = ModuleData.get().getReplaceWithListMap().get(
        classLiteral.getName());

Changing this to 
    List<ReplaceWithData> replaceWithList = ModuleData.get().getReplaceWithListMap().get(
        classLiteral.getName().replace("$",".));

works but isn't exactly elegant!  

Original comment by louis.em...@gmail.com on 10 May 2012 at 3:31