protected void analyzeError( Exception e, Object obj ) { Exceptions.handle( Str.lines ( e.getClass ().getName (), String.format ( "cause %s", e.getCause () ), String.format ( "Field info name %s, type %s, class that declared field %s", this.name(), this.type(), this.getField ().getDeclaringClass () ), String.format ( "TypeType of object passed %s", obj.getClass ().getName () ) ), e ); }
protected void analyzeError( Exception e, Object obj ) { Exceptions.handle( Str.lines ( e.getClass ().getName (), String.format ( "cause %s", e.getCause () ), String.format ( "Field info name %s, type %s, class that declared field %s", this.name(), this.type(), this.getField ().getDeclaringClass () ), String.format ( "TypeType of object passed %s", obj.getClass ().getName () ) ), e ); }
public static void idx( Object object, int index, Object value ) { try { if ( isArray(object) ) { Array.set( object, index, value ); } else if ( object instanceof List ) { Lists.idx( ( List ) object, index, value ); } } catch ( Exception notExpected ) { String msg = lines( "An unexpected error has occurred", "This is likely a programming error!", String.format( "Object is %s, index is %s, and set is %s", object, index, value ), String.format( "The object is an array? %s", object == null ? "null" : object.getClass().isArray() ), String.format( "The object is of type %s", object == null ? "null" : object.getClass().getName() ), String.format( "The set is of type %s", value == null ? "null" : value.getClass().getName() ), "" ); Exceptions.handle( msg, notExpected ); } }
public static void idx( Object object, int index, Object value ) { try { if ( isArray(object) ) { Array.set( object, index, value ); } else if ( object instanceof List ) { Lists.idx( ( List ) object, index, value ); } } catch ( Exception notExpected ) { String msg = lines( "An unexpected error has occurred", "This is likely a programming error!", String.format( "Object is %s, index is %s, and set is %s", object, index, value ), String.format( "The object is an array? %s", object == null ? "null" : object.getClass().isArray() ), String.format( "The object is of type %s", object == null ? "null" : object.getClass().getName() ), String.format( "The set is of type %s", value == null ? "null" : value.getClass().getName() ), "" ); Exceptions.handle( msg, notExpected ); } }