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

Method isBshAssignable

src/bsh/Types.java:368–379  ·  view source on GitHub ↗

Test if a type can be converted to another type via BeanShell extended syntax rules (a superset of Java conversion rules).

( Class toType, Class fromType )

Source from the content-addressed store, hash-verified

366 extended syntax rules (a superset of Java conversion rules).
367 */
368 static boolean isBshAssignable( Class toType, Class fromType )
369 {
370 try {
371 return castObject(
372 toType, fromType, null/*fromValue*/,
373 ASSIGNMENT, true/*checkOnly*/
374 ) == VALID_CAST;
375 } catch ( UtilEvalError e ) {
376 // This should not happen with checkOnly true
377 throw new InterpreterError("err in cast check: "+e);
378 }
379 }
380
381 /** Find array element type for class.
382 * Roll back component type until class is not an array anymore.

Callers 1

isSignatureAssignableMethod · 0.95

Calls 1

castObjectMethod · 0.95

Tested by

no test coverage detected