On May 28, 2008, at 1:32 PM, Marius Dumitru Florea wrote:

>> Hi Anca,
>>
>> A possible improvement below.
>>
>> On May 28, 2008, at 12:47 PM, lucaa (SVN) wrote:
>>
>>> Author: lucaa
>>> Date: 2008-05-28 12:47:56 +0200 (Wed, 28 May 2008)
>>> New Revision: 9958
>>>
>>> Modified:
>>>  xwiki-platform/web/trunk/gwt/src/main/java/com/xpn/xwiki/gwt/api/
>>> client/app/XWikiGWTDefaultApp.java
>>> Log:
>>> XWIKI-2408: Default XWikiService URL not created correctly in hosted
>>> mode in XWikiGWTDefaultApp
>>>
>>> * added a test for the ending character of the module base URL
>>> returned by GWT
>>>
>>>
>>> Modified: xwiki-platform/web/trunk/gwt/src/main/java/com/xpn/xwiki/
>>> gwt/api/client/app/XWikiGWTDefaultApp.java
>>> ===================================================================
>>> --- xwiki-platform/web/trunk/gwt/src/main/java/com/xpn/xwiki/gwt/ 
>>> api/
>>> client/app/XWikiGWTDefaultApp.java  2008-05-28 10:40:44 UTC (rev  
>>> 9957)
>>> +++ xwiki-platform/web/trunk/gwt/src/main/java/com/xpn/xwiki/gwt/ 
>>> api/
>>> client/app/XWikiGWTDefaultApp.java  2008-05-28 10:47:56 UTC (rev  
>>> 9958)
>>> @@ -181,10 +181,15 @@
>>>        if (serviceInstance == null) {
>>>            serviceInstance = (XWikiServiceAsync)
>>> GWT.create(XWikiService.class);
>>>            String defaultXWikiService;
>>> -            if (GWT.isScript())
>>> +            if (GWT.isScript()) {
>>>                defaultXWikiService =
>>> XWikiGWTAppConstants.XWIKI_DEFAULT_BASE_URL +
>>> XWikiGWTAppConstants.XWIKI_DEFAULT_SERVICE;
>>> -            else
>>> -                defaultXWikiService = GWT.getModuleBaseURL() +
>>> XWikiGWTAppConstants.XWIKI_DEFAULT_SERVICE;
>>> +            } else {
>>> +                String moduleBaseURL = GWT.getModuleBaseURL();
>>> +                if (moduleBaseURL.endsWith("/")) {
>>> +                    moduleBaseURL = moduleBaseURL.substring(0,
>>> moduleBaseURL.length() - 1);
>>> +                }
>>
>> // Here, explain why we need to remove the last "/" if it's there and
>> why it's not deterministic
>> String moduleBaseURL = StringUtils.chomp(GWT.getModuleBaseURL(),  
>> "/");
>>
>
> org.apache.commons.lang.StringUtils?
> How is GWT going to compile this?

I don't know much about GWT, I admit :) I thought it was java code.  
Are you saying that we can't use any external Java library in GWT code?

Thanks
-Vincent

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to