google-code-export / gwt-test-utils

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

LocalizableResourcesInvocationHandler doesn't support SafeHtml return type #62

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
create an interface with
interface MyMessages extends Messages {
    SafeHtml myMessage();
}

What is the expected output? What do you see instead?
expected to see my localization wrapped inside SafeHtml, but I saw

java.lang.ClassCastException: java.lang.String cannot be cast to 
com.google.gwt.safehtml.shared.SafeHtml
    at $Proxy32.myMessage(Unknown Source) 
...

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

Please provide any additional information below.
probably wrapping the return value with SafeHtmlUtils.fromTrustedString will 
work

Original issue reported on code.google.com by sam.ji...@karoshealth.com on 8 Aug 2011 at 4:25

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 8 Aug 2011 at 4:40

GoogleCodeExporter commented 9 years ago

Original comment by gael.laz...@gmail.com on 8 Aug 2011 at 7:32

GoogleCodeExporter commented 9 years ago
I fixed this on the lastest 0.32-SNAPSHOT, 0.22.3-SNAPSHOT, 0.25.3-SNAPSHOT and 
0.28.6-SNAPSHOT.

Could you please update to try it and give me some feedback ? Thank you very 
much :-)

Original comment by gael.laz...@gmail.com on 8 Aug 2011 at 8:09

GoogleCodeExporter commented 9 years ago
I tested the latest version in trunk (r1071) and SafeHtml seems to work fine. 
Thank you for the quick response =D

On a related note, tho off topic to this issue, I'm getting a new NPE in 
0.32-SNAPSHOT but not in 0.31

my code does
NativeEvent changeEvent = Document.get().createChangeEvent();
DomEvent.fireNativeEvent(changeEvent, listBox);

fireNativeEvent calls gwt's DomEvent:91
fireNativeEvent(nativeEvent, handlerSource, null);
with the last arg relativeElem == null

and in the DomEventPatcher:54
        // fire parent elements if necessary
        bubbleEvent(relativeElem.getParentElement(), flyweight);
there is no null check on relativeElem

Original comment by sam.ji...@karoshealth.com on 8 Aug 2011 at 8:32

GoogleCodeExporter commented 9 years ago
Thank you very much for the report.

Actually, my 'event bubbling' implementation was wrong. NativeEvent triggered 
with DomEvent.fireNativeEvent should not bubble.

So, I removed the DomEventPatcher and add a WidgetPatcher instead, to patch 
onBrowserEvent. Can you check with the SNAPSHOT I've just deployed ?

Original comment by gael.laz...@gmail.com on 9 Aug 2011 at 7:49

GoogleCodeExporter commented 9 years ago
(for some reason my maven proxy never gets your snapshots =/ I made sure I 
punched in your snapshots url too, anyway)

I rebuilt again from trunk and everything seems to work fine now. feel free to 
close this ticket =)

Original comment by sam.ji...@karoshealth.com on 9 Aug 2011 at 8:27

GoogleCodeExporter commented 9 years ago
Your maven proxy issue is weird, but someone already had a problem with our 
snapshot repository when there wasn't any '.index/' folder in it. This time it 
seems ok..
I'm not a nexus specialist so I'll talk to the guy at Octo who setups the repo.

Thank you very much for your feedback ;-) 

Original comment by gael.laz...@gmail.com on 10 Aug 2011 at 5:26