Skip to content

Commit

Permalink
fix SingleBreakOrContinue
Browse files Browse the repository at this point in the history
  • Loading branch information
Calixte committed Sep 16, 2024
1 parent d8ed710 commit f0d8d82
Showing 1 changed file with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -68,24 +61,20 @@ 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)) {
continue;
}

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
Expand Down

0 comments on commit f0d8d82

Please sign in to comment.