robotoworks / mechanoid

Eclipse plugin providing a set of DSL's for the rapid development of Android apps
58 stars 26 forks source link

[MECHDB] Calling ActiveRecord.save() throws error if no value was changed #137

Open imhoff opened 11 years ago

imhoff commented 11 years ago

When creating an ActiveRecord and calling the save() method without touching its values will throw an IllegalArgumentsException: Empty Values. It is not checked whether the constructed ContentValues Object contains any values.

fluxtah commented 11 years ago

Hi, I am not sure what to do about this one because it sounds like a good thing rather than a bad thing.

Any idea what you would expect to happen? We could possibly catch the exception and raise a more specific one.

imhoff commented 11 years ago

I was just a little surprised that the Exception was thrown. Given the name and the behavior of the ActiveRecords, I assumed that it would do just nothing if there is nothing to be saved. As the class already tracks which portions have changed (dirty flag) it seems strange that there is an error at all. But its just my point of view.

fluxtah commented 11 years ago

Cheers, you are not wrong, we should probably just make it fail silently in this scenario, I will look into it.