[EL_SPEC-16] Static fields and methods are evaluated to null in Facelets Created: 01/Sep/13  Updated: 10/Jul/14

Status: Open
Project: el-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: marfous Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

GF4.0, JSF2.2



 Description   

When I use static field or method within Facelet, it's value is evaluated to null.

Example:
#

{Integer.MAX_VALUE}

#

{Integer.toHexString(16)}

Or this shows in the rendered page that result of the static call was null
#

{[0, 1, Integer.MAX_VALUE]}

 Comments   
Comment by mdzaebel [ 10/Jul/14 ]

As static fields (and enum) access cover a significant part of the Spec I wonder why this is not commented or assigned to anyone. Is this problem already fixed or has it a workaround or are we all wrong?

Environment: GF4.0, JSF2.2, EL 3.0, Win7





[EL_SPEC-17] MethodExpression.getMethodInfo() always returns null Created: 12/Dec/13  Updated: 12/Dec/13

Status: Open
Project: el-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Harald Wellmann Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

javax.el-3.0.0.jar standalone, Oracle Java 1.7.0_45 on Linux 64-bit



 Description   

When invoking getMethodInfo() on a method expression, I always get null.

This seems to be caused by AstValue.getMethodInfo():

    public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes)
            throws ELException {
        Target t = getTarget(ctx);
        if (t.isMethodCall()) {
            return null;
        }
        Object property = t.suffixNode.getValue(ctx);
        Method m = ReflectionUtil.getMethod(t.base, property, paramTypes);
        return new MethodInfo(m.getName(), m.getReturnType(), m
                .getParameterTypes());
    }

Shouldn't this be

if ( ! t.isMethodCall()) {
    return null;
}





[EL_SPEC-15] javax.el.BeanELResolver.setValue inconsistent javadoc Created: 12/Jul/13  Updated: 12/Jul/13

Status: Open
Project: el-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: violetagg Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi,

EL 3.0 javadoc javax.el.BeanELResolver.setValue describes:

...
If the property exists but does not have a setter, then a PropertyNotFoundException is thrown.
...
PropertyNotWritableException - if this resolver was constructed in read-only mode, or if there is no setter for the property.
...

Can you please clarify which exception should be thrown when the property does not have a setter method?

Thanks
Violeta






[EL_SPEC-13] TypeConverter API documentation does not match impl. Created: 06/Jun/13  Updated: 06/Jun/13

Status: Open
Project: el-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

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

N/A



 Description   

According to the API documentation all the methods except for "convertToType" are and say exactly what the ELRosolver would do. But the Imp for any of these methods(listed below) do nothing or return null. the

getCommonPropertyType
getFeatureDescriptors
getType
getValue
isReadOnly
setValue

Example:

From the src for getValue

@Override
public Object getValue(ELContext context,
Object base,
Object property)

{ return null; }

This is what the Javadoc says

public Object getValue(ELContext context,
Object base,
Object property)
Description copied from class: ELResolver
Attempts to resolve the given property object on the given base object.
If this resolver handles the given (base, property) pair, the propertyResolved property of the ELContext object must be set to true by the resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

Specified by:
getValue in class ELResolver
Parameters:
context - The context of this evaluation.
base - The base object whose property value is to be returned, or null to resolve a top-level variable.
property - The property or variable to be resolved.
Returns:
If the propertyResolved property of ELContext was set to true, then the result of the variable or property resolution; otherwise undefined.






[EL_SPEC-20] Reduce source/target from 1.7 to 1.6 Created: 06/Jun/14  Updated: 06/Jun/14

Status: Open
Project: el-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: rotty Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Currently the el api and impl are set to source/target 1.7

However, there are no functional requirement or features of the 1.7 JRE used.

The only current barrier is with tests which fail when set to 1.6. However, when skipping tests, el compiles quite fine.

This has a transitive cost of imposing 1.7 on JSP also.



 Comments   
Comment by rotty [ 06/Jun/14 ]

See JSP-43

Comment by rotty [ 06/Jun/14 ]

After further discussion with colleagues we realized there is no need for this.

the issue can be resolved "won't fix"





[EL_SPEC-19] Javadoc for ExpressionFactory#getInitFunctionMap is incorrect Created: 20/May/14  Updated: 20/May/14

Status: Open
Project: el-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: kchung Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The javadoc for ExpressionFactory#getInitFunctionMap says:

    /**
     * Retrieve a function map containing a pre-configured function
     * mapping.  It must include the following functions.
     * <ul>
     * <li>linq:range</li>
     * <li>linq:repeat</li>
     * <li>linq:_empty</li>
     * </ul>
     * @return A initial map for functions, null if there is none.
     *
     * @since EL 3.0
     */

This is not correct, as EL 3.0 no longer has to support these functions.






[EL_SPEC-21] Property support for Optional<T> Created: 06/Dec/14  Updated: 11/Dec/14

Status: Open
Project: el-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: pdudits Assignee: kchung
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Expression language in Java EE 8 should bring special treatment for java.util.Optional, similar like it does for maps and lists:

When a base expression evaluates to instance of java.util.Optional, and the property name is not equal present, the result of the evaluation shall be equivalent to calling method map or flatMap on the optional:

  • if the base {{Optional]} has value:
    1. evaluate the property against the value of the property,
    2. if the result of an evaluation is instance of an Optional
      • return the value; otherwise
      • return the value wrapped in an Optional
  • if base optional, doesn't have value, return Optional.empty()

The property present is evaluated by invoking the method isPresent() of the base object.

An example of implementation of this behaviour can be found in this ELResolver implementation.



 Comments   
Comment by kchung [ 11/Dec/14 ]

EL 3.0 was targeted for JDK 7, and as such knows nothing about Optional. However, Optional should be supported in the next release of EL, which is presumable targeted for JDK 8. It is also likely that the next release of EL, EL 3.1 will be a MR.





[EL_SPEC-22] Make it possible to use javax.el.LambdaExpression in place of java se 8 functional interfaces Created: 06/Dec/14  Updated: 11/Dec/14

Status: Open
Project: el-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: pdudits Assignee: kchung
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Since EL Lambdas predate Java functional interfaces, custom EL resolvers must be used to as bridge between javax.el.LambdaExpression, and actual method with a accepting functional interface parameter.

Java EE 8 revision of EL should either

  1. bring sufficient support for all Java SE methods accepting functional interfaces, or
  2. offer implicit type conversion from LambdaExpression to appropriate types defined in java.util.function, or
  3. offer implicit conversion to any Functional interface conforming to ยง9.8 of JLS.

Example implementation of the first approach for java.util.Optional can be seen here



 Comments   
Comment by kchung [ 11/Dec/14 ]

Again, this is in the plan for EL 3.1.

It would be straight forward to support the conversions to all the known functions in java.util.functions, approach 2 above, but it will be difficult to support general functional interfaces, since it involves calling methods with Lambda expressions as arguments in reflection, which is hard to get right. So approach 3 is unlikely to be supported in EL 3.1.





[EL_SPEC-23] Stream operators anyMatch, allMatch, and nonMatch should return boolean Created: 15/Jan/15  Updated: 15/Jan/15

Status: Open
Project: el-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: kchung Assignee: kchung
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The stream operators anyMatch, allMatch, and noneMatch returns an Optional, while those operators in JDK 8 (java.util.stream#Stream) returns a boolean. This difference is confusing. EL spec should be changed to agree with JDK 8.

The difference happened because EL 3.0 spec was released before Java SE 8. Now that SE 8 was release, EL should be brought up to date.






[EL_SPEC-18] null String are converted to "" on the bound bean properties Created: 14/May/14  Updated: 03/Dec/14

Status: Open
Project: el-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Hanspeter Duennenberger Assignee: Unassigned
Resolution: Unresolved Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Change the spec like this:

  • 1.23.1, If X is null and Y is not a primitive type, return null.
  • 1.23.2, If A is null: return null

Justification:

JSF uses EL expressions to get and set bean properties. With the String behavior as defined in EL spec 3 null String will be converted to "" also without any user input. This is wrong behavior - null String should remain null also after an form edit roundtrip.

JSF has explicitly a parameter to define if empty String input should be handled as null. With EL 3 this null handling is rendered useless.

The problematic sections in the spec are:

  • 1.2.1 the part: In the case of lvalues, the expected type is ignored and the provided value is coerced to the actual type of the property the expression points to, before that property is set.
  • 1.23.1, If X is null and Y is not a primitive type and also not a String, return null.
  • 1.23.2, If A is null: return ""

1.2.1 is problematic for JSF using mostly Object.class as expected type for ValueExpression - but according to 1.2.1 in VE.setValue(elContext, value) the expected type is ignored and therefore the String specific exceptional rules in 1.23.1 and 1.23.2 cause null to "" conversion in VE.setValue(elContext, value).

Looking at the rules 1.23.3 - 1.23.6 for all other non-primitive types null is always remaining null. Why not also for String - it's also a non-primitive.



 Comments   
Comment by kchung [ 19/May/14 ]

I agree that it might be more useful if a null for a String is not converted to "", but remains a null. In EL 2.2, nulls for non primitive types, such as Integer, are converted to their default values (int value in case of Integer), per Java language rules. Due to complains from JSF users, we changed the behavior in EL 3.0 to not do the conversion, so a null remains a null.

The only reason we didn't do the same change for Strings was because there were several tests for String conversions in the CTS tests, and we couldn't make the change without breaking the CTS.

If this is important, we can make the change in the next EL release, release a new CTS tests, and install a backward compatibility option in the implementation for apps that require EL 3.0 behaviors.

Comment by mauromol [ 03/Dec/14 ]

This problem is causing a real headache in JSF, especially when combined with Bean Validation API... That is, how to make simple things complicated





Generated at Wed Apr 01 11:07:39 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.