You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Travis Newby (JIRA)" <ji...@apache.org> on 2009/03/03 22:57:45 UTC

[jira] Issue Comment Edited: (WW-2971) type conversion cannot convert negative numbers to Double

    [ https://issues.apache.org/struts/browse/WW-2971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45668#action_45668 ] 

travis.newby edited comment on WW-2971 at 3/3/09 1:56 PM:
----------------------------------------------------------

The issue is caused by the isInRange method of the XWorkBasicConverter using (Double | Float).MIN_VALUE.  These constants normally return the smallest POSITIVE value, rather than the most negative value as seems to be the intent.

      was (Author: travis.newby):
    The issue is caused by the isInRange method of the XWorkBasicConverter using (Double | Float).MIN_VALUE.  These constants normally return the smallest POSITIVE value, rather than the largest negative value as seems to be the intent.
  
> type conversion cannot convert negative numbers to Double 
> ----------------------------------------------------------
>
>                 Key: WW-2971
>                 URL: https://issues.apache.org/struts/browse/WW-2971
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Expression Language
>    Affects Versions: 2.1.6
>         Environment: Struts 2.1.6, 2.1.6 Conventions plugin 
>            Reporter: Allen Lee
>         Attachments: tdartest.tar.bz2
>
>
> Replicate via the following:
> 1. create an action with a Double property
> 2. post to the action with a negative number for that property
> 3. exception stack trace similar to the following will appear, where LongitudeLatitudeBox has a Double maximumLongitude property :
> expr: longitudeLatitudeBox.maximumLongitude val: [Ljava.lang.String;@bf2f7c context: ognl.OgnlContext@39042078 root:[org.tdar.struts.action.DatasetController@13072d, com.opensymphony.xwork2.DefaultTextProvider@17fd168] value: [Ljava.lang.String;@bf2f7c
> ognl.MethodFailedException: Method "setMinimumLongitude" failed for object org.tdar.core.bean.coverage.LongitudeLatitudeBox@299813 [java.lang.NoSuchMethodException: setMinimumLongitude([Ljava.lang.String;)]   
>         at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823)
>         at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964)
>         at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75)
>         at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131)
>         at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:28)
>         at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
>         at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
>         at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
>         at ognl.SimpleNode.setValue(SimpleNode.java:246)
>         at ognl.ASTChain.setValueBody(ASTChain.java:172)
>         at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
>         at ognl.SimpleNode.setValue(SimpleNode.java:246)
>         at ognl.Ognl.setValue(Ognl.java:476)
>         at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:192)
>         at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:155)
>         at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:143)
>         at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:276)
>         at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187)
>         at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
>         at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
>         at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>         at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.