Search in sources :

Example 1 with InaccessibleFieldException

use of org.terasology.reflection.reflect.InaccessibleFieldException in project Terasology by MovingBlocks.

the class FieldAccessBenchmark method setup.

@Override
public void setup() {
    i = 0;
    comp = new DisplayNameComponent();
    try {
        accessor = reflectFactory.createFieldAccessor(DisplayNameComponent.class, DisplayNameComponent.class.getField("description"));
    } catch (InaccessibleFieldException | NoSuchFieldException e) {
        logger.error("Failed to establish field accessor object", e);
    }
}
Also used : DisplayNameComponent(org.terasology.logic.common.DisplayNameComponent) InaccessibleFieldException(org.terasology.reflection.reflect.InaccessibleFieldException)

Aggregations

DisplayNameComponent (org.terasology.logic.common.DisplayNameComponent)1 InaccessibleFieldException (org.terasology.reflection.reflect.InaccessibleFieldException)1