//If source is an instance of Class<?>, then this is a static class reference.
data = method.invoke(getSource() instanceof Class<?> ? null : getSource(), arguments);
}
catch (ClassCastException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
throw new VariableNotFoundException(frame.getInterpreter().evalFunctionName(name, args) + " is not defined in the current frame.");
}
}
else
try {
Class<?> source = (Class<?>) (getSource() instanceof Class<?> ? getSource() : getSource().getClass());
Field field = source.getField(name);
data = field.get(getSource() instanceof Class<?> ? null : getSource());
}
catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
throw new VariableNotFoundException(name + " is not defined in the current frame.");
}
if (data == null)
return new Token();
AbstractClass<?> output = determineType(data, frame);
return new Token(output instanceof JavaClass ? new JavaObject<Object>((JavaClass<Object>) output, data) :