Package org.sonar.duplications.internal.pmd

Examples of org.sonar.duplications.internal.pmd.TokenizerBridge


      executorService.shutdown();
    }
  }

  private void populateIndex(String languageKey, List<InputFile> sourceFiles, CpdMapping mapping, SonarDuplicationsIndex index) {
    TokenizerBridge bridge = null;
    if (mapping != null) {
      bridge = new TokenizerBridge(mapping.getTokenizer(), fs.encoding().name(), getBlockSize(languageKey));
    }
    for (InputFile inputFile : sourceFiles) {
      LOG.debug("Populating index from {}", inputFile);
      String resourceEffectiveKey = ((DeprecatedDefaultInputFile) inputFile).key();
      FileBlocks fileBlocks = duplicationCache.byComponent(resourceEffectiveKey);
      if (fileBlocks != null) {
        index.insert(inputFile, fileBlocks.blocks());
      } else if (bridge != null) {
        List<Block> blocks2 = bridge.chunk(resourceEffectiveKey, inputFile.file());
        index.insert(inputFile, blocks2);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.sonar.duplications.internal.pmd.TokenizerBridge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.