MCPcopy Create free account
hub / github.com/apache/tomcat / add

Method add

java/org/apache/el/lang/ELArithmetic.java:308–318  ·  view source on GitHub ↗

Add two objects, coercing them to the appropriate numeric type. @param obj0 The first operand @param obj1 The second operand @return The result of the addition

(final Object obj0, final Object obj1)

Source from the content-addressed store, hash-verified

306 * @return The result of the addition
307 */
308 public static Number add(final Object obj0, final Object obj1) {
309 final ELArithmetic delegate = findDelegate(obj0, obj1);
310 if (delegate == null) {
311 return Long.valueOf(0);
312 }
313
314 Number num0 = delegate.coerce(obj0);
315 Number num1 = delegate.coerce(obj1);
316
317 return delegate.add(num0, num1);
318 }
319
320 /**
321 * Compute the modulo of two objects, coercing them to the appropriate numeric type.

Callers 9

testAdd01Method · 0.95
testBug47371doubleMethod · 0.95
testBug47371longMethod · 0.95
getValueMethod · 0.95
averageMethod · 0.95
sumMethod · 0.95

Calls 3

findDelegateMethod · 0.95
coerceMethod · 0.95
valueOfMethod · 0.45

Tested by 6

testAdd01Method · 0.76
testBug47371doubleMethod · 0.76
testBug47371longMethod · 0.76