It seems there is no way to identify classes (java) that are Exceptions. Even the one that are used.
There are ThrownException / DeclaredException / CaughtException , all pointing to the exceptionClass, but there is no opposite property in the exception class that one could use to test whether a given class is used as an exception.
So the only way is to test whether Exception is an ancestor of a given class ?
nicolas
Indeed. It would be cool to get opposites for the exceptionClass properties. So, we would have FAMIXClass>>thrownAsException, FAMIXClass>>declaredAsException, FAMIXClass>>caughtAsException. This would also imply that we would define the implementation of exceptionClass in all subclasses of Exception.
Cheers, Doru
On Tue, Aug 21, 2012 at 1:34 PM, Nicolas Anquetil Nicolas.Anquetil@inria.fr wrote:
It seems there is no way to identify classes (java) that are Exceptions. Even the one that are used.
There are ThrownException / DeclaredException / CaughtException , all pointing to the exceptionClass, but there is no opposite property in the exception class that one could use to test whether a given class is used as an exception.
So the only way is to test whether Exception is an ancestor of a given class ?
nicolas _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Right now, we have
FAMIXException>>exceptionClass <MSEProperty: #exceptionClass type: #FAMIXClass> ^ exceptionClass
And then we have three subclasses: FAMIXCaughtException, FAMIXDeclaredException, FAMIXThrownException.
At the moment, exceptionClass does not have an opposite, but we should add one. Like this we would know if a class is caught, declared or thrown. But, to know that we would need define three properties in FAMIXClass, and to redefine the exceptionClass in the three subclasses of FAMIXException such that the declaration points the opposite to the right FAMIXClass property.
So something like:
FAMIXDeclaredException>>exceptionClass <MSEProperty: #exceptionClass type: #FAMIXClass opposite: #exceptionsWithClassAsDeclared> ...
FAMIXClass>>exceptionsWithDeclaredClass <MSEProperty: #exceptionsWithClassAsDeclared type: #FAMIXDeclaredException opposite: #exceptionClass> ...
Cheers, Doru
On Wed, Aug 22, 2012 at 12:57 PM, Stéphane Ducasse stephane.ducasse@inria.fr wrote:
This would also imply that we would define the implementation of exceptionClass in all subclasses of Exception.
what do you mean by that sentence because I could not get it clear enough. _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev