The class file for ... has been changed; but the change cannot be applied because objects based on the old class file still exist.

I typically get this warning after editing a class and it is very familiar to me. In particular, I also know that deleting all instances of a class or issuing "clear classes" gets rid of this warning. However, I am wondering if there is any more specific information available about when not clearing the class is really dangerous.
For example, I find that simply editing a class method never seems to produce any ill consequences. The changes I make to the method always seem to go through in spite of the warning. Can I always count on this? Might it only be changes to properties and class attributes that matter?
It would be convenient if that were the case. 99% of the time, I invoke this warning due to editing a class method while objects of the class are still in the workspace. It would be nice to know that I can safely ignore the warning, since deleting/reconstructing instances of the class every time I need to revise a class method is somewhat of a bother.

 Respuesta aceptada

per isakson
per isakson el 23 de Jul. de 2013
Editada: per isakson el 6 de Ag. de 2013
I don't know for sure but
  • I have not seen any "any more specific information "
  • After adding (or renaming) methods or properties clear classes is required; i.e. after changing info in the meta-data.
  • After editing code inside methods it is safe to ignore the warning.
.
2013-08-06. I just stumbled upon some "more specific information "
I think it confirms my description.

2 comentarios

Thanks, per. I'll leave the question open in case any TMW personnel can confirm your remarks, but you have my +1.
I've added a link to the answer.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 23 de Jul. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by