diff options
author | Alena Laskavaia | 2010-06-02 00:39:31 +0000 |
---|---|---|
committer | Alena Laskavaia | 2010-06-02 00:39:31 +0000 |
commit | 29b2cdb6679d7b9bcbc626d3467b08d3ad7f7ca3 (patch) | |
tree | bca25ce976bd40decd309d9cddfc07797e7610bf /codan | |
parent | 8def1f711a19acc5abfe4dd552fb55dd6f98a285 (diff) | |
download | org.eclipse.cdt-29b2cdb6679d7b9bcbc626d3467b08d3ad7f7ca3.tar.gz org.eclipse.cdt-29b2cdb6679d7b9bcbc626d3467b08d3ad7f7ca3.tar.xz org.eclipse.cdt-29b2cdb6679d7b9bcbc626d3467b08d3ad7f7ca3.zip |
Updated javadoc, removed duplicate method
Diffstat (limited to 'codan')
-rw-r--r-- | codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java index 8ec3b870200..bdb36f01c91 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/param/FileScopeProblemPreference.java @@ -30,15 +30,28 @@ import org.eclipse.core.runtime.Path; * Custom preference for resource scope * * @noextend This class is not intended to be extended by clients. + * @since 1.0 */ public class FileScopeProblemPreference extends AbstractProblemPreference { + /** + * Key for the scope preference + */ public static final String KEY = "fileScope"; //$NON-NLS-1$ + /** + * Exclusion attribute + */ public static final String EXCLUSION = "exclusion"; //$NON-NLS-1$ + /** + * Inclusion attribute + */ public static final String INCLUSION = "inclusion"; //$NON-NLS-1$ private IResource resource; private IPath[] inclusion = new IPath[0]; private IPath[] exclusion = new IPath[0]; + /** + * Default constructor + */ public FileScopeProblemPreference() { setKey(KEY); setLabel(Messages.FileScopeProblemPreference_Label); @@ -233,6 +246,14 @@ public class FileScopeProblemPreference extends AbstractProblemPreference { return true; } + /** + * Checks that given path matches on the paths provided as second argument + * + * @param resourcePath - resource path + * @param paths - array of path patterns, for pattern see + * {@link CharOperation#pathMatch} + * @return true if matches with at least one pattern in the array + */ public boolean matchesFilter(IPath resourcePath, IPath[] paths) { char[] path = resourcePath.toString().toCharArray(); for (int i = 0, length = paths.length; i < length; i++) { @@ -243,15 +264,4 @@ public class FileScopeProblemPreference extends AbstractProblemPreference { } return false; } - - public static boolean isExcludedPath(IPath resourcePath, IPath[] paths) { - char[] path = resourcePath.toString().toCharArray(); - for (int i = 0, length = paths.length; i < length; i++) { - char[] pattern = paths[i].toString().toCharArray(); - if (CharOperation.pathMatch(pattern, path, true, '/')) { - return true; - } - } - return false; - } } |