Clojure

Three-arg ExceptionInfo constructor permits nil data

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

Description

The argument check in the two-arg clojure.lang.ExceptionInfo constructor isn't present in the three-arg constructor so it's possible to create an ExceptionInfo with arbitrary (or nil) data.

E.g.:

user=> (clojure-version)
"1.5.1"

user=> (ex-info "hi" nil)
IllegalArgumentException Additional data must be a persistent map: null  clojure.lang.ExceptionInfo.<init> (ExceptionInfo.java:26)

user=> (ex-info "hi" nil (Throwable.))
NullPointerException   clojure.lang.ExceptionInfo.toString (ExceptionInfo.java:40)

Activity

Alex Miller made changes -
Field Original Value New Value
Priority Major [ 3 ] Minor [ 4 ]
Gordon Syme made changes -
Attachment clj-1380.patch [ 12875 ]
Alex Miller made changes -
Patch Code and Test [ 10002 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: