mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup, Overrides
This commit is contained in:
@@ -40,6 +40,7 @@ public class WildcardFileNameMatcher implements FileNameMatcher {
|
||||
myMatcher = PatternUtil.fromMask(pattern).matcher("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(final String filename) {
|
||||
synchronized (myMatcher) {
|
||||
myMatcher.reset(filename);
|
||||
@@ -55,6 +56,7 @@ public class WildcardFileNameMatcher implements FileNameMatcher {
|
||||
mySuffix = suffix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(final String filename) {
|
||||
return filename.endsWith(mySuffix);
|
||||
}
|
||||
@@ -67,6 +69,7 @@ public class WildcardFileNameMatcher implements FileNameMatcher {
|
||||
myPrefix = prefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(final String filename) {
|
||||
return filename.startsWith(myPrefix);
|
||||
}
|
||||
@@ -79,6 +82,7 @@ public class WildcardFileNameMatcher implements FileNameMatcher {
|
||||
myInfix = infix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(final String filename) {
|
||||
return filename.contains(myInfix);
|
||||
}
|
||||
@@ -108,10 +112,12 @@ public class WildcardFileNameMatcher implements FileNameMatcher {
|
||||
return new RegexpMatcher(pattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean accept(@NotNull String fileName) {
|
||||
return myMatcher.matches(fileName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNls
|
||||
@NotNull
|
||||
public String getPresentableString() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -73,7 +73,8 @@ public class PatternUtil {
|
||||
// String pattern = mask.replaceAll("\\.", "\\.").replaceAll("\\*", ".*").replaceAll("\\?", ".");
|
||||
try {
|
||||
return Pattern.compile(convertToRegex(mask));
|
||||
} catch (PatternSyntaxException e) {
|
||||
}
|
||||
catch (PatternSyntaxException e) {
|
||||
LOG.error(mask, e);
|
||||
return Pattern.compile("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user