test_class.declarator: temporaryFolder = new TemporaryFolder()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public TemporaryFolder temporaryFolder = new TemporaryFolder();
test_class.type: TemporaryFolder
test_class.var_name: temporaryFolder
test_class.declarator: indexDir = null
test_class.modifier: private
test_class.original_string: private File indexDir = null;
test_class.type: File
test_class.var_name: indexDir
test_class.declarator: csv = null
test_class.modifier: private
test_class.original_string: private File csv = null;
test_class.type: File
test_class.var_name: csv
test_class.declarator: textWriter = new FakeTextWriter()
test_class.modifier: private
test_class.original_string: private FakeTextWriter textWriter = new FakeTextWriter();
test_class.type: FakeTextWriter
test_class.var_name: textWriter
test_class.declarator: stats = new PopulatorStats()
test_class.modifier: private
test_class.original_string: private PopulatorStats stats = new PopulatorStats();
test_class.type: PopulatorStats
test_class.var_name: stats
test_class.declarator: textPopulator = new TextPopulator(textWriter)
test_class.modifier: private
test_class.original_string: private TextPopulator textPopulator = new TextPopulator(textWriter);
test_class.type: TextPopulator
test_class.var_name: textPopulator
test_class.file: oak-run/src/test/java/org/apache/jackrabbit/oak/plugins/tika/TextPopulatorTest.java
test_class.identifier: TextPopulatorTest
test_case.body: @Test
      public void multiFTField() throws Exception {
          setupCSV("/multi");
  
          textPopulator.populate(csv, indexDir);
          assertEquals("Multi FT field in a doc not marked as error",
                  1, stats.errored);
  
          textPopulator.populate(csv, indexDir);
          assertEquals("Repeated run for multi FT error should get processed again", 0, stats.ignored);
  
          assertStatsInvariants();
      }
test_case.class_method_signature: TextPopulatorTest.multiFTField()
test_case.full_signature: @Test public void multiFTField()
test_case.identifier: multiFTField
test_case.invocations: setupCSV populate assertEquals populate assertEquals assertStatsInvariants
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void multiFTField()
focal_class.declarator: log = LoggerFactory.getLogger(TextPopulator.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(TextPopulator.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: BLOB_ID = "blobId"
focal_class.modifier: static final
focal_class.original_string: static final String BLOB_ID = "blobId";
focal_class.type: String
focal_class.var_name: BLOB_ID
focal_class.declarator: ERROR_TEXT = "TextExtractionError"
focal_class.modifier: static final
focal_class.original_string: static final String ERROR_TEXT = "TextExtractionError";
focal_class.type: String
focal_class.var_name: ERROR_TEXT
focal_class.declarator: textWriter
focal_class.modifier: private final
focal_class.original_string: private final TextWriter textWriter;
focal_class.type: TextWriter
focal_class.var_name: textWriter
focal_class.declarator: stats
focal_class.modifier: private
focal_class.original_string: private PopulatorStats stats;
focal_class.type: PopulatorStats
focal_class.var_name: stats
focal_class.file: oak-run/src/main/java/org/apache/jackrabbit/oak/plugins/tika/TextPopulator.java
focal_class.identifier: TextPopulator
focal_class.class_method_signature: TextPopulator.TextPopulator(TextWriter textWriter)
focal_class.full_signature:   TextPopulator(TextWriter textWriter)
focal_class.identifier: TextPopulator
focal_class.parameters: (TextWriter textWriter)
focal_class.signature:  TextPopulator(TextWriter textWriter)
focal_class.class_method_signature: TextPopulator.setStats(PopulatorStats stats)
focal_class.full_signature:  void setStats(PopulatorStats stats)
focal_class.identifier: setStats
focal_class.parameters: (PopulatorStats stats)
focal_class.return: void
focal_class.signature: void setStats(PopulatorStats stats)
focal_class.class_method_signature: TextPopulator.populate(File dataFile, File indexDir)
focal_class.full_signature:  void populate(File dataFile, File indexDir)
focal_class.identifier: populate
focal_class.parameters: (File dataFile, File indexDir)
focal_class.return: void
focal_class.signature: void populate(File dataFile, File indexDir)
focal_class.class_method_signature: TextPopulator.getText(DirectoryReader reader, IndexSearcher searcher, String path)
focal_class.full_signature: private static String getText(DirectoryReader reader, IndexSearcher searcher, String path)
focal_class.identifier: getText
focal_class.modifiers: private static
focal_class.parameters: (DirectoryReader reader, IndexSearcher searcher, String path)
focal_class.return: String
focal_class.signature: String getText(DirectoryReader reader, IndexSearcher searcher, String path)
focal_method.body: void populate(File dataFile, File indexDir) throws IOException {
          try (Closer closer = Closer.create()) {
              Iterable<CSVRecord> csvRecords = closer.register(CSVParser.parse(dataFile, UTF_8, FORMAT));
  
              final FSDirectory dir = closer.register(FSDirectory.open(indexDir));
              final DirectoryReader reader = closer.register(DirectoryReader.open(dir));
              final IndexSearcher searcher = new IndexSearcher(reader);
  
              for (CSVRecord record : csvRecords) {
                  String blobId = record.get(BLOB_ID);
                  String jcrPath = record.get(JCR_PATH);
  
                  if (!textWriter.isProcessed(blobId)) {
                      String text = getText(reader, searcher, jcrPath);
  
                      stats.processed++;
  
                      if (text == null) {
                          // Ignore errors as we might be processing partial OR incorrect index
                          // writer.markError(blobId);
                          stats.errored++;
                      } else if (ERROR_TEXT.equals(text)) {
                          textWriter.markError(blobId);
                          stats.errored++;
                      } else if (text.length() == 0) {
                          textWriter.markEmpty(blobId);
                          stats.empty++;
                      } else {
                          textWriter.write(blobId, text);
                          stats.parsed++;
                      }
                  } else {
                      stats.ignored++;
                  }
  
                  stats.readAndDumpStatsIfRequired(jcrPath);
              }
              log.info(stats.toString());
          }
      }
focal_method.class_method_signature: TextPopulator.populate(File dataFile, File indexDir)
focal_method.full_signature:  void populate(File dataFile, File indexDir)
focal_method.identifier: populate
focal_method.invocations: create register parse register open register open get get isProcessed getText equals markError length markEmpty write readAndDumpStatsIfRequired info toString
focal_method.parameters: (File dataFile, File indexDir)
focal_method.return: void
focal_method.signature: void populate(File dataFile, File indexDir)