コード例 #1
0
 private Statement getOriginalStatement(Statement methodInvoker, Field field) {
   field.setAccessible(true);
   try {
     return (Statement) field.get(methodInvoker);
   } catch (Exception e) {
     e.printStackTrace();
     return null;
   }
 }
コード例 #2
0
  private Statement statementOrNull(Statement methodInvoker, Field field) {
    if (field.getType().isAssignableFrom(Statement.class))
      return getOriginalStatement(methodInvoker, field);

    return null;
  }