Calypso icon indicating copy to clipboard operation
Calypso copied to clipboard

Improve stability on wrong #isAbstract

Open jecisc opened this issue 6 years ago • 4 comments

I currently have an intern that is a beginner with Pharo and one thing happen a lot is that he creates a method #isAbstract and forget the return, which is a common mistake in Pharo.

In that case Calypso class pane crash because of a #mustBeBoolean error.

I think Calypso code should be more reliable on this and catch a potential error on #isAbstract.

jecisc avatar May 22 '19 14:05 jecisc

Perhaps a QA rule would also help - if it could quick detect method name is "isAbstract" before it is saved?

bencoman avatar May 23 '19 12:05 bencoman

QA rule can be added to help fix a potential error in a #isAbstract method, but it cannot help with my initial problem for two reasons:

  • First, QA is launched after the saving of the method, so Calypso will already be crashed
  • Second, it's probably not recommended but maybe one day someone will want to implement #isAbstract method for their model, not using it in its original intended way. I don't think Calypso should crash if it happens.

So, IMO the minimal fix for it is to catch a potential error and consider the class as non-abstract in that case. Adding a QA rule might be good as a next step.

jecisc avatar May 23 '19 12:05 jecisc

I think it needs to be protected in more general way (not just isAbstract case). Any table decoration can be broken or half implemented. And browser should not crash because of that

dionisiydk avatar May 23 '19 18:05 dionisiydk

From the other side isAbstract is used in many different features (not only to show italic class names). So users need to be protected

dionisiydk avatar May 23 '19 18:05 dionisiydk