[EL_SPEC-14] null string value is converted to "" Created: 04/Jul/13  Updated: 07/Oct/13  Resolved: 07/Oct/13

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

Type: Bug Priority: Critical
Reporter: jasonzhang2002gmailcom Assignee: Unassigned
Resolution: Works as designed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

glassfish 4.0, el 3.0


Tags: empty, jsf2_2, string

 Description   

null string from JSF is converted to empty string.
I traced to code com.sun.el.lang.ELSupport 350. Should this decision be left to EL client?



 Comments   
Comment by Kim Haase [ 07/Oct/13 ]

I believe this bug corresponds to https://java.net/jira/browse/JAVAEETUTORIAL-249. The zip file attached to that issue reproduces the problem on EE 7. I will attach another zip file to that issue to show that the problem is new in EL 3.0, because when the test example is run in an EE 6 environment, it runs correctly.

Comment by kchung [ 07/Oct/13 ]

EL 3.0 spec (1.23.2 Coerce A to String) clearly says

If A is null: return ""

So this is behaving according to the spec.





[EL_SPEC-1] ResourceBundleELResolver.getFeatureDescriptors return type is not generic Created: 29/Nov/11  Updated: 19/Mar/13  Resolved: 19/Mar/13

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

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


 Description   

ResourceBundleELResolver.getFeatureDescriptors returns a Iterator, while ELResolver.getFeatureDescriptors returns a Iterator<java.beans.FeatureDescriptor>



 Comments   
Comment by kchung [ 19/Mar/13 ]

This has already been fixed.





[EL_SPEC-7] Typo in Javadoc for ElProcessor.defineFunction Created: 05/Nov/12  Updated: 14/Mar/13  Resolved: 14/Mar/13

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

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

N/A



 Description   

Simple type to fix.

ClassNoFoundException - if the specified class does not exists. <--- Should be ClassNotFoundException just missing the "t"



 Comments   
Comment by kchung [ 14/Mar/13 ]

Fixed.





[EL_SPEC-9] ELProcessor.defineFunction methods do not check for null args... Created: 05/Nov/12  Updated: 20/Feb/13  Resolved: 20/Feb/13

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

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

N/A



 Description   

API documentation states for both of the defineFunction methods that a NullPointerException should be thrown if any arg is null. Niether on of the methods looks to be testing for null args.

Example below.

public void defineFunction(String prefix, String function, Method method) {

if (prefix == null || function == null || method == null)

{ <-- need to add something like this. throw new NullPointerException(); }

if (function.equals(""))

{ function = method.getName(); }

elManager.mapFunction(prefix, function, method);
}



 Comments   
Comment by kchung [ 20/Feb/13 ]

Fixed.

Note the spec has also been modified to also throw a NoSuchMethodException if the method is not static. See the javadocs for detailed.





[EL_SPEC-6] Rewrite the spec for collection support Created: 31/Oct/12  Updated: 14/Mar/13  Resolved: 14/Mar/13

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

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

Tags: EE7_GF4

 Description   

The EL spec needs to align with Java Se8 regarding the support for collection operators. The part about LINQ operator needs to be removed, and replace with similar operations in SE 8.

The operators also need to be implemented.



 Comments   
Comment by kchung [ 14/Mar/13 ]

fixed.





[EL_SPEC-5] Collections defaultIfEmpty operator does not exist Created: 02/Aug/12  Updated: 02/Aug/12  Resolved: 02/Aug/12

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

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

N/A



 Description   

There appears to be no code for defaultIfEmpty operator.

products.orderByDescending(p->p.unitPrice).elementAtOrDefault(3).defaultIfEmpty()
ERROR: Exception at:
ERROR: javax.el.MethodNotFoundException:



 Comments   
Comment by kchung [ 02/Aug/12 ]

Fixed





[EL_SPEC-4] Collections average operator does not return null Created: 02/Aug/12  Updated: 02/Aug/12  Resolved: 02/Aug/12

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

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

N/A



 Description   

The specification states the following for the average operator section 2.3.44.2

"The average operator returns null for an empty collection."

The below should return null and does not.

"[].average()"



 Comments   
Comment by kchung [ 02/Aug/12 ]

Fixed





[EL_SPEC-2] Backwards Compatibility Issue with Binary Operator "+" Created: 27/Apr/12  Updated: 14/Mar/13  Resolved: 14/Mar/13

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

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

N/A



 Description   

In section 1.7.1 Binary Operators of the Expression Language Specification Version 3.0, there has been an additional Rule added that causes a Backwards compatibility issue.

From version 3.0 of the specification its states the following:

1.7.1 Binary operators - A {+,-,*} B
■ If the operator is a +, and either A or B is a String, then + is a string concatenation <---- This is the newly added Rule.
operator.
■ If A and B are null, return (Long)0
■ If A or B is a BigDecimal, coerce both to BigDecimal and then:
■ If operator is +, return A.add(B)
■ If operator is -, return A.subtract(B)
■ If operator is *, return A.multiply(B)
■ If A or B is a Float, Double, or String containing ., e, or E: <---------- This Rule never gets reached now !!!!!
■ If A or B is BigInteger, coerce both A and B to BigDecimal and apply
operator.
■ Otherwise, coerce both A and B to Double and apply operator
■ If A or B is BigInteger, coerce both to BigInteger and then:
■ If operator is +, return A.add(B)
■ If operator is -, return A.subtract(B)
■ If operator is *, return A.multiply(B)
■ Otherwise coerce both A and B to Long and apply operator
■ If operator results in exception, error

The problem with the newly added rule at the top of the order is that they " If A or B is a Float, Double, or String containing ., e, or E:" Never gets a chance to be parsed. This breaks backwards compatibility.



 Comments   
Comment by dougd [ 27/Apr/12 ]

Maybe we can do something like this.

1.7.1 Binary operators - A {+,-,*} B
■ If the operator is a +, and either A or B is a String:
■ If A or B is a Float, Double, or String containing ., e, or E:
■ If A or B is BigInteger, coerce both A and B to BigDecimal and apply operator.
■ Otherwise, coerce both A and B to Double and apply operator
■ Otherwise + is a string concatenation operator.
■ If A and B are null, return (Long)0
■ If A or B is a BigDecimal, coerce both to BigDecimal and then:
■ If operator is +, return A.add(B)
■ If operator is -, return A.subtract(B)
■ If operator is *, return A.multiply(B)
■ If A or B is BigInteger, coerce both to BigInteger and then:
■ If operator is +, return A.add(B)
■ If operator is -, return A.subtract(B)
■ If operator is *, return A.multiply(B)
■ Otherwise coerce both A and B to Long and apply operator
■ If operator results in exception, error

Comment by kchung [ 14/Mar/13 ]

The symbol + is no longer used as a concatenation operator in PFD.





[EL_SPEC-3] Backwards Compatibility Issue with coercion of null to String Created: 11/May/12  Updated: 20/Feb/13  Resolved: 20/Feb/13

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

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

N/A



 Description   

Previous versions of EL when coercing a null to a String would return an empty string. WE know return a null.

This issue is being opened to track backwards compatibility for the above mentioned.



 Comments   
Comment by kchung [ 20/Feb/13 ]

The latest spec does not have this issue any more. That is coercing a null to String is still "".





[EL_SPEC-11] Clarify how single variable evaluates to method Created: 08/Jan/13  Updated: 19/Mar/13  Resolved: 19/Mar/13

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

Type: Improvement Priority: Major
Reporter: arjan tijms Assignee: Unassigned
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: clarification, evaluation, methodexpression

 Description   

Section 1.2.1.2 in the EL specification mentions that a method expression can consist of a single variable:

 
A method expression shares the same syntax as an lvalue. 
That is, it can only consist of either a single variable
(e.g. ${name}) or a property resolution on some object, 
via the . or [] operator (e.g. ${employee.name}).

As it appears, it's not entirely clear how such single variable should be evaluated.

In the reference implementation for example, we see that in this case a MethodExpressionImpl will reference an AstIdentifier, which will use the context's variable mapper to obtain a ValueExpression. The value is then obtained from this value expression, and it's expected to be a MethodExpression, which is then invoked.

This can be seen at http://java.net/projects/el-spec/sources/source-code/content/trunk/impl/src/main/java/com/sun/el/parser/AstIdentifier.java?rev=198 where the method getMethodExpression at line 198 demonstrates the "value expression wrapping a method expression" assumption. invoke at line 183 then shows this obtained method expression is simply invoked.

Comments on line 198 and 209 explicitly mention 2 cases:

case A: ValueExpression exists, getValue which must
be a MethodExpression

[...]

case B: evaluate the identity against the ELResolver, again, must be
a MethodExpression to be able to invoke

These cases however are not outlined in the specification. As a result, alternative EL implementations (like JUEL) have taken a completely different approach. In the case of JUEL, it also expects a ValueExpression, but then guessed that this value expression should be wrapping a Method. This on its turn leads to unexpected behavior and bugs such as reported here: http://code.google.com/p/omnifaces/issues/detail?id=100

In order to ensure portability between EL implementations, I would like to request this specific case to be clarified in the specification.



 Comments   
Comment by beckchr [ 08/Jan/13 ]

See also this issue from 2006: http://java.net/jira/browse/JSP_SPEC_PUBLIC-164

Comment by kchung [ 19/Mar/13 ]

What about adding the following clarification to 1.2.1.2

When a MethodExpression created from an EL expression of the form $

{name}

is invoked,

1. The identifier "name" is first evaluated.
a. If "name" is an EL variable, the ValueExpression associated with the variable is evaluated.
b. Else obtain the value resolved in the ELResolvers.
2. If the identifier evaluates to a MethodExpression, it is invoked and its result is returned.
3. Else error.

Comment by kchung [ 19/Mar/13 ]

Added a new section 1.5.4. in EL 3.0 spec to clarify the issue.

Comment by arjan tijms [ 19/Mar/13 ]

What about adding the following clarification to 1.2.1.2 [...]

It sounds okay to me, thanks!





[EL_SPEC-10] API doc errors for javax.el.TypeConverter Created: 14/Nov/12  Updated: 20/Feb/13  Resolved: 20/Feb/13

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

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

N/A



 Description   

Here is the Example that we have provided in the API docs.

ELProcessor elp = new ELProcessor();
elp.getELManager().addELResolver(new TypeConverter() {
Object convertToType(ELContext context, Object obj, Class type) {
if (obj instanceof String) && type == MyDate.class)

{ context.setPropertyResoved(obj, type); return (obj == null)? null: new MyDate(obj.toString()); }

return null;
}
};

Below I have put the various fixes in spelling and syntax.

ELProcessor elp = new ELProcessor();
elp.getELManager().addELResolver(new TypeConverter() {
Object convertToType(ELContext context, Object obj, Class type) {
if ((obj instanceof String) && type == MyDate.class)

{ <------ Added missing "(" context.setPropertyResolved(obj, type); <------ Fixed Spelling on Method call. return (obj == null)? null: new MyDate(obj.toString()); }

return null;
}
};



 Comments   
Comment by kchung [ 20/Feb/13 ]

Fixed.





Generated at Fri Feb 24 16:02:45 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.