diff --git a/net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/projectconfig/filters/PackageFilter.java b/net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/projectconfig/filters/PackageFilter.java index e06140db5..4e2047895 100644 --- a/net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/projectconfig/filters/PackageFilter.java +++ b/net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/projectconfig/filters/PackageFilter.java @@ -49,15 +49,8 @@ public class PackageFilter extends AbstractFilter { @Override public boolean accept(Object object) { - - boolean goesThrough = true; - - if (object instanceof IResource) { - - IResource resource = (IResource) object; - - IContainer folder = null; - + if (object instanceof IResource resource) { + IContainer folder; if (resource instanceof IContainer) { folder = (IContainer) resource; } else { @@ -68,7 +61,6 @@ public boolean accept(Object object) { int size = mData != null ? mData.size() : 0; for (int i = 0; i < size; i++) { - String element = mData.get(i); if (RECURSE_OFF_MARKER.equals(element)) { @@ -76,16 +68,13 @@ public boolean accept(Object object) { } IPath filteredPath = new Path(element); - if (mExcludeSubPackages && filteredPath.isPrefixOf(projRelativPath)) { - goesThrough = false; - break; - } else if (!mExcludeSubPackages && filteredPath.equals(projRelativPath)) { - goesThrough = false; - break; + if (mExcludeSubPackages && filteredPath.isPrefixOf(projRelativPath) + || !mExcludeSubPackages && filteredPath.equals(projRelativPath)) { + return false; } } } - return goesThrough; + return true; } @Override