aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/treewalk
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-11-18 16:50:14 -0800
committerShawn O. Pearce <spearce@spearce.org>2010-11-18 16:50:14 -0800
commit3de186fbf0e79094bd07c71101d80f39b02eb0ca (patch)
tree0dbfde099157edca208700204d0c2788685ed93a /org.eclipse.jgit/src/org/eclipse/jgit/treewalk
parent2054c3fb8aeb19337caea5129003b6145c82ea1b (diff)
downloadjgit-3de186fbf0e79094bd07c71101d80f39b02eb0ca.tar.gz
jgit-3de186fbf0e79094bd07c71101d80f39b02eb0ca.zip
Name TreeFilter and MergeFilter implementations
Naming these inner classes ensures that stack traces which contain them will give us useful information about which filter is involved in the trace, rather than the generated names $1, $2, etc. This makes it much easier to understand a stack trace at a glance. Change-Id: Ia6a75fdb382ff6461e02054d94baf011bdeee5aa Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/treewalk')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java
index 50421fe7a2..9348afc8ae 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/TreeFilter.java
@@ -84,7 +84,9 @@ import org.eclipse.jgit.treewalk.TreeWalk;
*/
public abstract class TreeFilter {
/** Selects all tree entries. */
- public static final TreeFilter ALL = new TreeFilter() {
+ public static final TreeFilter ALL = new AllFilter();
+
+ private static final class AllFilter extends TreeFilter {
@Override
public boolean include(final TreeWalk walker) {
return true;
@@ -104,7 +106,7 @@ public abstract class TreeFilter {
public String toString() {
return "ALL";
}
- };
+ }
/**
* Selects only tree entries which differ between at least 2 trees.
@@ -119,7 +121,9 @@ public abstract class TreeFilter {
* against the single tree it was actually given. Applications may wish to
* treat such a difference as "all names added".
*/
- public static final TreeFilter ANY_DIFF = new TreeFilter() {
+ public static final TreeFilter ANY_DIFF = new AnyDiffFilter();
+
+ private static final class AnyDiffFilter extends TreeFilter {
private static final int baseTree = 0;
@Override
@@ -149,7 +153,7 @@ public abstract class TreeFilter {
public String toString() {
return "ANY_DIFF";
}
- };
+ }
/**
* Create a new filter that does the opposite of this filter.