[JAVASERVERFACES_SPEC_PUBLIC-1063] Signature on UIViewParameter.getSubmittedValue should not return String, but Object. Created: 20/Dec/11  Updated: 01/Aug/14  Resolved: 21/Dec/11

Status: Closed
Project: javaserverfaces-spec-public
Component/s: Documentation: Javadoc, TLDDoc, RenderkitDoc, PDF
Affects Version/s: None
Fix Version/s: 2.2 Sprint 10

Type: Bug Priority: Major
Reporter: dougd Assignee: Ed Burns
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

N/A


Attachments: Text File 20111220-1506-i_spec_1063.patch     Text File changebundle.txt    

 Description   

API docs states:

==============
getSubmittedValue

public java.lang.String getSubmittedValue()
Assume that the submitted value is always a string.

Specified by:
getSubmittedValue in interface EditableValueHolder
Overrides:
getSubmittedValue in class UIInput
Since:
2.0
==============

So UIViewparameter extends UIInput, which implements EditableValueHolder, this method is a "EditableValueHolder" interface method and the signature should stay the same.

The below code shows how this is broken in this state now.

EditableValueHolder holder = (EditableValueHolder) new UIViewParameter();

holder.setSubmittedValue(Boolean.TRUE);

if (!((Boolean)holder.getSubmittedValue()))

{ System.out.println("FAILED"); }

 Comments   
Comment by Ed Burns [ 21/Dec/11 ]

Committed to trunk:

Sending jsf-api/src/main/java/javax/faces/component/UIViewAction.java
Sending jsf-api/src/main/java/javax/faces/component/UIViewParameter.java
Sending jsf-ri/src/main/java/com/sun/faces/context/FacesContextImpl.java
Transmitting file data ...
Committed revision 9540.

Comment by Hanspeter Duennenberger [ 27/Mar/12 ]

Since the return type on the getSubmittedValue() method signature was changed to Object, the cast to String in the return statement does not really make sense any more.

Comment by Ed Burns [ 06/Apr/12 ]

Sending jsf-api/src/main/java/javax/faces/component/UIViewParameter.java
Sending jsf-ri/src/main/java/com/sun/faces/application/view/StateManagementStrategyImpl.java
Sending jsf-ri/src/main/java/com/sun/faces/config/processor/FaceletTaglibConfigProcessor.java
Transmitting file data ...
Committed revision 9814.

http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1063 http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-787 http://java.net/jira/browse/JAVASERVERFACES-2369

SECTION: Modified Files
----------------------------
M jsf-ri/src/main/java/com/sun/faces/application/view/StateManagementStrategyImpl.java

  • in restoreView(), note that the state map will never be null due to
    the assignment statement at the top of the method. Therefore, we
    shouldn't test for null to determine the presence or absence of a
    pre-existing state map.

M jsf-ri/src/main/java/com/sun/faces/config/processor/FaceletTaglibConfigProcessor.java

  • in createMethod(), replace one or more whitespace with a single whitespace.

M jsf-api/src/main/java/javax/faces/component/UIViewParameter.java

  • in getSubmittedValue(), remove unnecessary cast to String.
Comment by Manfred Riem [ 01/Aug/14 ]

Closing resolved issue out





Generated at Wed Mar 04 09:35:42 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.