Closed fdodino closed 8 years ago
Added a validation in constructor of Table class:
public Table(Container container, Class<R> itemType) {
super(container);
if (!itemType.isAnnotationPresent(org.uqbar.commons.utils.Observable.class)) {
throw new ArenaException("La clase " + itemType.getName() + " debe tener la annotation @Observable");
}
So now, instead of that ugly error you get this message:
Exception in thread "main" org.uqbar.arena.ArenaException: La clase org.uqbar.ejemplosWidgets.appModel.Provincia debe tener la annotation @Observable
Side effect: app used to work before, but you could see that ugly stack trace. Now app crahes (maybe it's better this way).
If you have a window with a model object that is @Observable, and create a table bound to a list property which holds objects of type "B", let say. If that class B doesn't have the @Observable annotation, then when you run the application it will log the following ugly exception, because it tries to register a listener into an instance of B class, which was not weaved, and therefore doesn't have the observable methods.