Tabnine Logo
FilePredicates.not
Code IndexAdd Tabnine to your IDE (free)

How to use
not
method
in
org.sonar.api.batch.fs.FilePredicates

Best Java code snippets using org.sonar.api.batch.fs.FilePredicates.not (Showing top 3 results out of 315)

origin: SonarSource/sonarqube

@Test
public void not() {
 assertThat(predicates.not(predicates.hasType(InputFile.Type.MAIN)).apply(javaFile)).isFalse();
 assertThat(predicates.not(predicates.hasType(InputFile.Type.TEST)).apply(javaFile)).isTrue();
}
origin: spotbugs/sonar-findbugs

/**
 * Determine if the project has Java source files. This is used to determine if the project has no compiled classes on
 * purpose or because the compilation was omit from the process.
 * @return If at least one Java file is present
 */
private boolean hasSourceFiles() {
 FilePredicates pred = fileSystem.predicates();
 return fileSystem.hasFiles(
     pred.and(
         pred.hasType(Type.MAIN),
         pred.or(FindbugsPlugin.getSupportedLanguagesFilePredicate(pred)),
         //package-info.java will not generate any class files.
         //See: https://github.com/SonarQubeCommunity/sonar-findbugs/issues/36
         pred.not(pred.matchesPathPattern("**/package-info.java")),
         pred.not(pred.matchesPathPattern("**/module-info.java")),
         pred.not(pred.matchesPathPattern("**/*.jsp"))
     )
 );
}
origin: org.sonarsource.sonarqube/sonar-batch

private void setFields(Project project,
 Settings settings, FileIndexer indexer, ModuleFileSystemInitializer initializer, ComponentIndexer componentIndexer, DefaultAnalysisMode mode) {
 this.componentIndexer = componentIndexer;
 this.moduleKey = project.getKey();
 this.settings = settings;
 this.indexer = indexer;
 setWorkDir(initializer.workingDir());
 this.buildDir = initializer.buildDir();
 this.sourceDirsOrFiles = initializer.sources();
 this.testDirsOrFiles = initializer.tests();
 this.binaryDirs = initializer.binaryDirs();
 // filter the files sensors have access to
 if (!mode.scanAllFiles()) {
  setDefaultPredicate(predicates.not(predicates.hasStatus(Status.SAME)));
 }
}
org.sonar.api.batch.fsFilePredicatesnot

Popular methods of FilePredicates

  • hasLanguage
  • and
  • hasType
  • hasPath
    if the parameter represents an absolute path for the running environment, then returns #hasAbsoluteP
  • hasAbsolutePath
    Predicate that find file by its absolute path. The parameter accepts forward/back slashes as separat
  • hasRelativePath
    Predicate that gets a file by its relative path. The parameter accepts forward/back slashes as separ
  • all
    Predicate that always evaluates to true
  • matchesPathPattern
    Predicate that gets the files which "path" matches a wildcard pattern. The path is the path part of
  • or
  • hasLanguages
  • is
    Warning - may not be supported in SonarLint
  • hasStatus
    Look for InputFile having a specific InputFile#status()
  • is,
  • hasStatus,
  • doesNotMatchPathPatterns,
  • hasAnyStatus,
  • matchesPathPatterns,
  • doesNotMatchPathPattern,
  • hasExtension,
  • hasFilename,
  • hasURI

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
  • Permission (java.security)
    Legacy security code; do not use.
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Reference (javax.naming)
  • JOptionPane (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now