Converting Old Griffon App to Latest Version

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Converting Old Griffon App to Latest Version

mecorusfc
This post has NOT been accepted by the mailing list yet.
In an old Griffon 0.9 app that I'm upgrading, I am having issues getting unit tests to run when a controller with models is instantiated.  Here is the error:

java.lang.NumberFormatException: For input string: "[:]"

        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1250)
        at java.lang.Float.valueOf(Float.java:417)
        at org.codehaus.groovy.runtime.StringGroovyMethods.toFloat(StringGroovyMethods.java:3313)
        at org.codehaus.groovy.runtime.StringGroovyMethods.toFloat(StringGroovyMethods.java:3322)
        at org.codehaus.groovy.runtime.StringGroovyMethods.asType(StringGroovyMethods.java:211)
        at org.codehaus.groovy.runtime.StringGroovyMethods.asType(StringGroovyMethods.java:157)
        at org.codehaus.groovy.runtime.dgm$1045.doMethodInvoke(Unknown Source)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1212)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
        at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:923)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:906)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:168)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.asType(ScriptBytecodeAdapter.java:591)
        at MyApp.MyAppModel.<init>(MyAppModel.groovy:19)
...

In the model, it has a method that is typed Float and it does some calculations.  It seems that in the old version of Griifon and GlazedLists, it wasn't a problem.  Perhaps in the newer versions it tries to run the calculation even though no values are set?  I'm not sure.  Here is the code I believe may be causing this:

In an outer model:
    EventList<MyAppModel> things = new BasicEventList<MyAppModel>()

In MyAppModel
  Float calculateStuff() {
    (intValue * numberValue1 + containedModel.numberValue2 + containedModel.numberValue3).toFloat().round(2)
  }

It was working in the old versions.  What would I need to do to get the constructor to work in the new versions of Griffon and GlazedLists?