@ -94,7 +94,9 @@ import org.eclipse.jgit.revwalk.RevWalk;
* /
public abstract class RevFilter {
/** Default filter that always returns true (thread safe). */
public static final RevFilter ALL = new RevFilter ( ) {
public static final RevFilter ALL = new AllFilter ( ) ;
private static final class AllFilter extends RevFilter {
@Override
public boolean include ( final RevWalk walker , final RevCommit c ) {
return true ;
@ -109,10 +111,12 @@ public abstract class RevFilter {
public String toString ( ) {
return "ALL" ;
}
} ;
}
/** Default filter that always returns false (thread safe). */
public static final RevFilter NONE = new RevFilter ( ) {
public static final RevFilter NONE = new NoneFilter ( ) ;
private static final class NoneFilter extends RevFilter {
@Override
public boolean include ( final RevWalk walker , final RevCommit c ) {
return false ;
@ -127,10 +131,12 @@ public abstract class RevFilter {
public String toString ( ) {
return "NONE" ;
}
} ;
}
/** Excludes commits with more than one parent (thread safe). */
public static final RevFilter NO_MERGES = new RevFilter ( ) {
public static final RevFilter NO_MERGES = new NoMergesFilter ( ) ;
private static final class NoMergesFilter extends RevFilter {
@Override
public boolean include ( final RevWalk walker , final RevCommit c ) {
return c . getParentCount ( ) < 2 ;
@ -145,7 +151,7 @@ public abstract class RevFilter {
public String toString ( ) {
return "NO_MERGES" ;
}
} ;
}
/ * *
* Selects only merge bases of the starting points ( thread safe ) .
@ -155,7 +161,9 @@ public abstract class RevFilter {
* information beyond the arguments is necessary to determine if the
* supplied commit is a merge base .
* /
public static final RevFilter MERGE_BASE = new RevFilter ( ) {
public static final RevFilter MERGE_BASE = new MergeBaseFilter ( ) ;
private static final class MergeBaseFilter extends RevFilter {
@Override
public boolean include ( final RevWalk walker , final RevCommit c ) {
throw new UnsupportedOperationException ( JGitText . get ( ) . cannotBeCombined ) ;
@ -170,7 +178,7 @@ public abstract class RevFilter {
public String toString ( ) {
return "MERGE_BASE" ;
}
} ;
}
/ * *
* Create a new filter that does the opposite of this filter .