You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Paris Holley (JIRA)" <de...@myfaces.apache.org> on 2008/10/06 18:51:44 UTC

[jira] Created: (MYFACES-2006) getTableIndex

getTableIndex
-------------

                 Key: MYFACES-2006
                 URL: https://issues.apache.org/jira/browse/MYFACES-2006
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 1.1.6
            Reporter: Paris Holley
            Priority: Blocker


Have a project using MyFaces 1.1.5 and Tomahawk 1.1.7. When MyFaces 1.1.5 is upgraded to 1.1.6 classcast exceptions are thrown when elements such as HtmlInputText try to access getTabIndex through an EL expression that returns an "int". Though the spec states that the EL expression should return a string, this was not a problem in the previous version. If tag attributes are more strict in the latest release, it would help to have stated so in the release notes.

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


[jira] Commented: (MYFACES-2006) getTableIndex: Integer to String (ClassCastException)

Posted by "Taro App (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639448#action_12639448 ] 

Taro App commented on MYFACES-2006:
-----------------------------------

I have voted for this issue. This is more serious for me. The problem is not just inputText's tabindex, but more wide spread. For example,
- binding for inputText's size and maxlength must be an Integer and not null.
- binding for inputText's tabindex must be a String and not null.
- binding for inputText's disabled and readonly must not return null.
- binding for inputTextarea's rows and cols must be an Integer and not null.
- binding for graphicsImage's width and height must be a String and not null.

Firstly, it does not seem consistent. For example, inputText's size is an Integer, where graphicsImage's width is a String. If a value binding does not return matching data type, ClassCastException is thrown. In the previous releases, it just worked.
Secondly, it does not default. If a value binding returns null, NullPointerException is thrown. In the previous releases, default value is used instead.
Thirdly, arithmatic expression binding cannot be used. For example, setting size="#{bean.value * 10}" for inputText raises ClassCastExpression because the calculated value is a Long.

I have a large application which has been working on MyFaces Core 1.1.3 and Tomahawk 1.1.3. I am trying to upgrade to MyFaces Core 1.1.6 and Tomahawk 1.1.7, but this is the blocking issue.

> getTableIndex: Integer to String (ClassCastException)
> -----------------------------------------------------
>
>                 Key: MYFACES-2006
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2006
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>            Reporter: Paris Holley
>
> Have a project using MyFaces 1.1.5 and Tomahawk 1.1.7. When MyFaces 1.1.5 is upgraded to 1.1.6 classcast exceptions are thrown when elements such as HtmlInputText try to access getTabIndex through an EL expression that returns an "int". Though the spec states that the EL expression should return a string, this was not a problem in the previous version. If tag attributes are more strict in the latest release, it would help to have stated so in the release notes.

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


[jira] Commented: (MYFACES-2006) getTableIndex: Integer to String (ClassCastException)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637238#action_12637238 ] 

Leonardo Uribe commented on MYFACES-2006:
-----------------------------------------

The original code looks like this:

    public String getTabindex()
    {
        if (_tabindex != null) return _tabindex;
        ValueBinding vb = getValueBinding("tabindex");
        return vb != null ? _ComponentUtils.getStringValue(getFacesContext(), vb) : null;
    }

and the method getStringValue looks like this:

    static String getStringValue(FacesContext context, ValueBinding vb)
    {
        Object value = vb.getValue(context);
        if(value == null)
        {
            return null;
        }
        return value.toString();
    }

The effect described here comes from the use of value.toString(). If receives a EL expression that returns something different to String (in this case Integer) the effect of toString() is convert the value, so the component can handle it correctly.

The introduction of component generation using myfaces-builder-plugin, introduce without notice the change described. (It's more, there was a release candidate for 1.1.6 release before the real release) . In fact, this is not a blocker issue, because there exists a valid  solution for that (change signature on the bean to return String instead). In jsf 1.2, this behavior is not present so when you go from 1.1 to 1.2 the same problem occur.

Here comes the difficult part: If in jsf 1.2 this behavior is not present, but on previous jsf 1.1 myfaces releases this is valid, Should we change this on 1.1? 

If no objections I'll lower the priority of this issue to major. 

> getTableIndex: Integer to String (ClassCastException)
> -----------------------------------------------------
>
>                 Key: MYFACES-2006
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2006
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>            Reporter: Paris Holley
>            Priority: Blocker
>
> Have a project using MyFaces 1.1.5 and Tomahawk 1.1.7. When MyFaces 1.1.5 is upgraded to 1.1.6 classcast exceptions are thrown when elements such as HtmlInputText try to access getTabIndex through an EL expression that returns an "int". Though the spec states that the EL expression should return a string, this was not a problem in the previous version. If tag attributes are more strict in the latest release, it would help to have stated so in the release notes.

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


[jira] Resolved: (MYFACES-2006) getTableIndex: Integer to String (ClassCastException)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-2006.
-------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 1.1.7)
                   1.1.8-SNAPSHOT

> getTableIndex: Integer to String (ClassCastException)
> -----------------------------------------------------
>
>                 Key: MYFACES-2006
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2006
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>            Reporter: Paris Holley
>            Assignee: Leonardo Uribe
>             Fix For: 1.1.8-SNAPSHOT
>
>         Attachments: MYFACES-2006-core.patch
>
>
> Have a project using MyFaces 1.1.5 and Tomahawk 1.1.7. When MyFaces 1.1.5 is upgraded to 1.1.6 classcast exceptions are thrown when elements such as HtmlInputText try to access getTabIndex through an EL expression that returns an "int". Though the spec states that the EL expression should return a string, this was not a problem in the previous version. If tag attributes are more strict in the latest release, it would help to have stated so in the release notes.

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


[jira] Updated: (MYFACES-2006) getTableIndex: Integer to String (ClassCastException)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe updated MYFACES-2006:
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.7-SNAPSHOT
           Status: Resolved  (was: Patch Available)

> getTableIndex: Integer to String (ClassCastException)
> -----------------------------------------------------
>
>                 Key: MYFACES-2006
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2006
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>            Reporter: Paris Holley
>            Assignee: Leonardo Uribe
>             Fix For: 1.1.7-SNAPSHOT
>
>         Attachments: MYFACES-2006-core.patch
>
>
> Have a project using MyFaces 1.1.5 and Tomahawk 1.1.7. When MyFaces 1.1.5 is upgraded to 1.1.6 classcast exceptions are thrown when elements such as HtmlInputText try to access getTabIndex through an EL expression that returns an "int". Though the spec states that the EL expression should return a string, this was not a problem in the previous version. If tag attributes are more strict in the latest release, it would help to have stated so in the release notes.

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


[jira] Updated: (MYFACES-2006) getTableIndex: Integer to String (ClassCastException)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe updated MYFACES-2006:
------------------------------------

    Status: Patch Available  (was: Open)

> getTableIndex: Integer to String (ClassCastException)
> -----------------------------------------------------
>
>                 Key: MYFACES-2006
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2006
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>            Reporter: Paris Holley
>         Attachments: MYFACES-2006-core.patch
>
>
> Have a project using MyFaces 1.1.5 and Tomahawk 1.1.7. When MyFaces 1.1.5 is upgraded to 1.1.6 classcast exceptions are thrown when elements such as HtmlInputText try to access getTabIndex through an EL expression that returns an "int". Though the spec states that the EL expression should return a string, this was not a problem in the previous version. If tag attributes are more strict in the latest release, it would help to have stated so in the release notes.

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


[jira] Commented: (MYFACES-2006) getTableIndex: Integer to String (ClassCastException)

Posted by "Paris Holley (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637249#action_12637249 ] 

Paris Holley commented on MYFACES-2006:
---------------------------------------

Indeed, this does not appear to be a blocker issue.

So the best solution I would assume (on my end), is to return an Integer instead of a String (so that there are no conflicts), however the question you present is an interesting dilemma.

In my opinion, introducing "new standards" within the JSF 1.1 releases wouldn't seem appropriate given that it is an older version and it has been used since the MyFaces 1.0.x releases. I am always for standards (which surely should be put in place on JSF 1.2), however I think that at some point backwards compatibility is just as important (particularly if you consider the 1.0.x releases a "legacy" library).

> getTableIndex: Integer to String (ClassCastException)
> -----------------------------------------------------
>
>                 Key: MYFACES-2006
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2006
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>            Reporter: Paris Holley
>            Priority: Blocker
>
> Have a project using MyFaces 1.1.5 and Tomahawk 1.1.7. When MyFaces 1.1.5 is upgraded to 1.1.6 classcast exceptions are thrown when elements such as HtmlInputText try to access getTabIndex through an EL expression that returns an "int". Though the spec states that the EL expression should return a string, this was not a problem in the previous version. If tag attributes are more strict in the latest release, it would help to have stated so in the release notes.

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


[jira] Reopened: (MYFACES-2006) getTableIndex: Integer to String (ClassCastException)

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe reopened MYFACES-2006:
-------------------------------------


If the ValueBinding returns null, it should return null, otherwise call on this value toString();

> getTableIndex: Integer to String (ClassCastException)
> -----------------------------------------------------
>
>                 Key: MYFACES-2006
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2006
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>            Reporter: Paris Holley
>            Assignee: Leonardo Uribe
>             Fix For: 1.1.7
>
>         Attachments: MYFACES-2006-core.patch
>
>
> Have a project using MyFaces 1.1.5 and Tomahawk 1.1.7. When MyFaces 1.1.5 is upgraded to 1.1.6 classcast exceptions are thrown when elements such as HtmlInputText try to access getTabIndex through an EL expression that returns an "int". Though the spec states that the EL expression should return a string, this was not a problem in the previous version. If tag attributes are more strict in the latest release, it would help to have stated so in the release notes.

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