Permalink
Browse files

Can't check for deprecations on reflective calls

  • Loading branch information...
1 parent 2ce05df commit 18e8a7612483f20982295f9553ed7706fae6f73f @jonase committed Jan 15, 2012
Showing with 11 additions and 9 deletions.
  1. +1 −1 src/eastwood/core.clj
  2. +10 −8 src/eastwood/linters/deprecated.clj
View
@@ -39,4 +39,4 @@
(doseq [ns namespaces]
(lint exprs ns))))
-;(lint-ns 'brittle.core :only [:reflection])
+;(lint-ns 'brittle.core)
@@ -9,16 +9,18 @@
(-> expr :var meta :deprecated))
(defmethod deprecated :instance-method [expr]
- (-> expr
- :Expr-obj
- .method
- (.isAnnotationPresent java.lang.Deprecated)))
+ (let [method (-> expr
+ :Expr-obj
+ .method)]
+ (when method
+ (.isAnnotationPresent method java.lang.Deprecated))))
(defmethod deprecated :static-field [expr]
- (-> expr
- :Expr-obj
- .field
- (.isAnnotationPresent java.lang.Deprecated)))
+ (let [field (-> expr
+ :Expr-obj
+ .field)]
+ (when field
+ (.isAnnotationPresent field java.lang.Deprecated))))
(defmethod deprecated :new [expr]
(-> expr

0 comments on commit 18e8a76

Please sign in to comment.