static Object getOptIgnoreCase(O o, S field) { if (o instanceof S) o = getBot((S) o); if (o == null) ret null; if (o instanceof Class) return getOptIgnoreCase((Class) o, field); if (o.getClass().getName().equals("main$DynamicObject")) fail("not implemented"); if (o instanceof Map) ret lookupIgnoreCase((Map) o, field); ret getOptIgnoreCase_raw(o, field); } static Object getOptIgnoreCase_raw(Object o, String field) { try { Field f = getOptIgnoreCase_findField(o.getClass(), field); if (f == null) ret null; f.setAccessible(true); return f.get(o); } catch (Exception e) { throw new RuntimeException(e); } } static Object getOptIgnoreCase(Class c, String field) { try { Field f = getOptIgnoreCase_findStaticField(c, field); if (f == null) ret null; f.setAccessible(true); return f.get(null); } catch (Exception e) { throw new RuntimeException(e); } } static Field getOptIgnoreCase_findStaticField(Class c, String field) { Class _c = c; do { for (Field f : _c.getDeclaredFields()) if (eqic(f.getName(), field) && (f.getModifiers() & Modifier.STATIC) != 0) return f; _c = _c.getSuperclass(); } while (_c != null); ret null; } static Field getOptIgnoreCase_findField(Class c, String field) { Class _c = c; do { for (Field f : _c.getDeclaredFields()) if (eqic(f.getName(), field)) return f; _c = _c.getSuperclass(); } while (_c != null); ret null; }