Skip to content

Commit

Permalink
adds an handy constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus committed Apr 22, 2016
1 parent 809f7a2 commit 6fa8c67
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/spoon/reflect/visitor/filter/AbstractFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,18 @@ public AbstractFilter(Class<? super T> type) {
this.type = (Class<T>) type;
}

/**
* Creates a filter with the no typing constraint.
*/
@SuppressWarnings("unchecked")
public AbstractFilter() {
this.type = (Class<T>) CtElement.class;
}

public Class<T> getType() {
return type;
}

@Override
public boolean matches(T element) {
return type.isAssignableFrom(element.getClass());
Expand Down

0 comments on commit 6fa8c67

Please sign in to comment.