MCPcopy Create free account
hub / github.com/beanshell/beanshell / promoteToInteger

Method promoteToInteger

src/bsh/Primitive.java:596–604  ·  view source on GitHub ↗

Promote primitive wrapper type to to Integer wrapper type

(Object wrapper )

Source from the content-addressed store, hash-verified

594 Promote primitive wrapper type to to Integer wrapper type
595 */
596 static Object promoteToInteger(Object wrapper )
597 {
598 if(wrapper instanceof Character)
599 return new Integer(((Character)wrapper).charValue());
600 else if((wrapper instanceof Byte) || (wrapper instanceof Short))
601 return new Integer(((Number)wrapper).intValue());
602
603 return wrapper;
604 }
605
606 /**
607 Promote the pair of primitives to the maximum type of the two.

Callers 3

promotePrimitivesMethod · 0.95
unaryOperationMethod · 0.95

Calls 1

intValueMethod · 0.80

Tested by

no test coverage detected