Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DateUtil.getFiscalWeek throws IllegalArgumentException

    Tried the following with 3/13 and 5/19 Power builds:

    Code:
    package com.scratchpad.canvasitems.client;
    
    import java.util.Date;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.util.DateUtil;
    import com.smartgwt.client.widgets.FiscalCalendar;
    import com.smartgwt.client.widgets.FiscalYear;
    
    public final class CanvasItemsEntryPoint implements EntryPoint {
    
    	public void onModuleLoad() {
    		
    		FiscalYear lastYear = new FiscalYear(2012, 5, 1);
    		FiscalYear thisYear = new FiscalYear(2013, 5, 1);
    		FiscalYear nextYear = new FiscalYear(2014, 5, 1);
    		
    		FiscalCalendar fc = new FiscalCalendar();
    		fc.setFiscalYears(lastYear, thisYear, nextYear);
    		
    		DateUtil.setFiscalCalendar(fc);
    		DateUtil.setShowChooserFiscalYearPickers(true);
    		DateUtil.setShowChooserWeekPickers(true);
    
    		Integer wk = DateUtil.getFiscalWeek(new Date(), fc);
    	}
    }
    Both yield

    Code:
    java.lang.IllegalArgumentException: Something other than a Java object was returned from JSNI method '@com.smartgwt.client.util.DateUtil::getFiscalWeek(Ljava/util/Date;Lcom/smartgwt/client/widgets/FiscalCalendar;)': JS value of type int, expected java.lang.Object
        at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:178)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:281)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.smartgwt.client.util.DateUtil.getFiscalWeek(DateUtil.java)
        at com.scratchpad.canvasitems.client.CanvasItemsEntryPoint.onModuleLoad(CanvasItemsEntryPoint.java:48)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:406)
        at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
        at java.lang.Thread.run(Thread.java:662)

    #2
    This is fixed in 3.1p - please retest with a nightly build dated May 24 or later

    Comment

    Working...
    X