dcsimg
CardRuntimeException
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jonas_Nilsson
Posted On:   Thursday, March 7, 2002 06:23 AM

Hi there, I am working with a small project where I would like to define my own CardRuntimeException, just like the CryptoException case. Using the same code as in CardException: public class MyException extends javacard.framework.CardRuntimeException { private static MyException systemInstance; // MyException reason codes ... public MyException(short reason) { super(reason); if (systemInstance == null) systemInstance = this; } } Every time a MyException is being thrown a JavaLa   More>>

Hi there,

I am working with a small project where I would like to define my own CardRuntimeException, just like the CryptoException case. Using the same code as in CardException:



public class MyException extends javacard.framework.CardRuntimeException


{



private static MyException systemInstance;


// MyException reason codes


...


public MyException(short reason)


{



super(reason);


if (systemInstance == null)
systemInstance = this;



}



}


Every time a MyException is being thrown a JavaLangNullException are being thrown instead. By using a simulator I found out that the reason for this is that my systemInstance in MyException is NULL.


Any ideas?

/Jonas Nilsson

   <<Less
About | Sitemap | Contact