Details
-
Type:
Defect
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: Release 1.1, Release 1.2, Release 1.3
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
The code for proxy-call-with-super internally used by proxy-super does not handle exceptions from the call method:
(defn proxy-call-with-super [call this meth]
(let [m (proxy-mappings this)]
(update-proxy this (assoc m meth nil))
(let [ret (call)]
(update-proxy this m)
ret)))
As a result the following sequence behaves unexpectedly:
(def obj (proxy [java.lang.ClassLoader] []
(loadClass [cl] (println "enter")
(proxy-super loadClass cl))))
(.loadClass obj "nonexistent")
;; prints enter, then throws ClassNotFoundException
(.loadClass obj "nonexistent")
;; does not print anything before throwing cnfe
A try-finally block around the invocation would solve this particular issue.
Attachments
Activity
Valentin Mahrwald
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | proxy_super.patch [ 11171 ] |
Test & fix patch on latest Clojure github branch.