String Handling in ELArithmetic is not correct
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Start in ELArithmetic at the protected coerce(Object) method shown in the issue, and trace the order of its number, String, null, and empty-string checks. Verify whether the empty-string branch is reachable and what behavior the existing tests expect; done means the conversion behavior is correct and covered by an appropriate test.
Written by the indexing model from the issue text.
Description
protected final Number coerce(final Object obj) {
if (isNumber(obj)) {
return coerce((Number) obj);
}
if (obj instanceof String) {
return coerce((String) obj);
}
if (obj == null || "".equals(obj)) {
return coerce(ZERO);
}
Class<?> objType = obj.getClass();
if (Character.class.equals(objType) || Character.TYPE == objType) {
return coerce(Short.valueOf((short) ((Character) obj).charValue()));
}
throw new IllegalArgumentException(MessageFactory.get("el.convert", obj, objType));
}
The "".equals(obj) part can never be reache or?
- Dominant language
- Java
- Stars
- 15
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eclipse-ee4j/expressly
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
eclipse-ee4j/expressly#23 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
eclipse-ee4j/expressly#21 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
eclipse-ee4j/expressly#20 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
eclipse-ee4j/expressly#15 · 5 comments ·
-
tck
eclipse-ee4j/expressly#13 · 1 assignee ·
All issues in eclipse-ee4j/expressly
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100