Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Added check for detecting abstract Adapters.

  • Loading branch information...
commit 858d664c8b4b417a75e1293bba30b998e2b7a95c 1 parent 28ac637
@aroemers authored
2  src-java/test/adapter/
@@ -6,7 +6,7 @@
import test.modelb.SubSubB;
-public class SubBtoA implements A {
+public abstract class SubBtoA implements A {
private SubB adaptee;
4 src/gluer/logic.clj
@@ -42,6 +42,9 @@
(def adapter-not-statically-accesible
"Adapter %s is not statically accessible. Make sure it is a top-level class, or a static inner class.")
+(def adapter-not-concrete
+ "Adapter %s is not a concrete class (it is abstract or an interface).")
(defn format-issue
[message file-name line-nr]
(format "%s:%s %s" file-name line-nr message))
@@ -139,6 +142,7 @@
(when (empty? (:adapts-to data)) (format adapts-to-nothing-error name))
(when (empty? (:adapts-from data)) (format adapts-from-nothing-error name))
(when-not (r/public? ctclass) (format adapter-not-public name))
+ (when (r/abstract? ctclass) (format adapter-not-concrete name))
(when (and (r/inner? ctclass) (not (r/static? ctclass)))
(format adapter-not-statically-accesible name)))))]
(-> (reduce check-adapter {} adapter-library)
5 src/gluer/resources.clj
@@ -72,6 +72,11 @@
(Modifier/isStatic (modifiers ctclass)))
+(defn abstract?
+ "Returns true if the supplied class is an abstract class, false otherwise."
+ [ctclass]
+ (Modifier/isAbstract (modifiers ctclass)))
(def supertypes-of
"A function that returns a set of the names of the direct supertypes
(classes and interfaces) of the supplied class. The function is memoized and

0 comments on commit 858d664

Please sign in to comment.
Something went wrong with that request. Please try again.