Hi,
I am trying to register Java exceptions using REGISTER-JAVA-EXCEPTION but it does not seem to work for me as evidenced by the transcript below.
Is there anything that I may have missed?
Armed Bear Common Lisp 0.23.1 Java 1.6.0_20 Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM Low-level initialization completed in 0.354 seconds. Startup completed in 1.579 seconds. Type ":help" for a list of available commands. CL-USER(1): (define-condition java-illegal-argument-error (java-exception) ()) JAVA-ILLEGAL-ARGUMENT-ERROR CL-USER(2): (register-java-exception "java.lang.IllegalArgumentException" 'java-illegal-argument-error) NIL CL-USER(3): (ignore-errors (jstatic (jmethod "java.lang.String" "valueOf" "int") "java.lang.String" "12")) NIL #<JAVA-EXCEPTION {4A6F19D5}> CL-USER(4): (jstatic (jmethod "java.lang.String" "valueOf" "int") "java.lang.String" "12") #<THREAD "interpreter" {2690ED81}>: Debugger invoked on condition of type JAVA-EXCEPTION #<JAVA-EXCEPTION {74D8C3EE}> Restarts: 0: TOP-LEVEL Return to top level. [1] CL-USER(5): 0 CL-USER(6):
Kind regards, Martin.
Hi,
to follow up on the issue: Erik pointed me to the source of the problem (that he also documented as ticket #123 [1]). It was caused by breakage in one Java implementation of subclassp, probably left over by the reimplementation of java-class in Lisp. I fixed it by reusing the (amended) generic implementation in the LispClass.subclassp static method. In the process I also fixed register-java-exception to signal meaningful errors if you feed it an object that does not name a class. This is available on trunk as revision 13221 [2]. Please check if your code now works.
Best regards, Alessio
[1] http://trac.common-lisp.net/armedbear/ticket/123 [2] http://trac.common-lisp.net/armedbear/changeset/13221
On Thu, Jan 20, 2011 at 6:12 PM, William will.wadsworth.10@gmail.com wrote:
Hi,
I am trying to register Java exceptions using REGISTER-JAVA-EXCEPTION but it does not seem to work for me as evidenced by the transcript below.
Is there anything that I may have missed?
Armed Bear Common Lisp 0.23.1 Java 1.6.0_20 Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM Low-level initialization completed in 0.354 seconds. Startup completed in 1.579 seconds. Type ":help" for a list of available commands. CL-USER(1): (define-condition java-illegal-argument-error (java-exception) ()) JAVA-ILLEGAL-ARGUMENT-ERROR CL-USER(2): (register-java-exception "java.lang.IllegalArgumentException" 'java-illegal-argument-error) NIL CL-USER(3): (ignore-errors (jstatic (jmethod "java.lang.String" "valueOf" "int") "java.lang.String" "12")) NIL #<JAVA-EXCEPTION {4A6F19D5}> CL-USER(4): (jstatic (jmethod "java.lang.String" "valueOf" "int") "java.lang.String" "12") #<THREAD "interpreter" {2690ED81}>: Debugger invoked on condition of type JAVA-EXCEPTION #<JAVA-EXCEPTION {74D8C3EE}> Restarts: 0: TOP-LEVEL Return to top level. [1] CL-USER(5): 0 CL-USER(6):
Kind regards, Martin.
armedbear-devel mailing list armedbear-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel
armedbear-devel@common-lisp.net