Skip to content

Commit

Permalink
Fix for NUTCH-2747: Fixed indentation according to http://svn.apache.…
Browse files Browse the repository at this point in the history
  • Loading branch information
balashashanka committed Oct 24, 2019
1 parent 2dc9032 commit cf2430f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
Expand Up @@ -85,7 +85,7 @@
*/
public class ReplaceIndexer implements IndexingFilter {

private static final Logger LOG = LoggerFactory
private static final Logger LOG = LoggerFactory
.getLogger(MethodHandles.lookup().lookupClass());

/** Special field name signifying the start of a host-specific match set */
Expand Down
Expand Up @@ -41,7 +41,7 @@
*/
public class MetaTagsParser implements HtmlParseFilter {

private static final Logger LOG = LoggerFactory
private static final Logger LOG = LoggerFactory
.getLogger(MethodHandles.lookup().lookupClass());

private Configuration conf;
Expand Down
Expand Up @@ -25,37 +25,37 @@

class BoilerpipeExtractorRepository {

private static final Logger LOG = LoggerFactory
private static final Logger LOG = LoggerFactory
.getLogger(MethodHandles.lookup().lookupClass());
public static final HashMap<String, BoilerpipeExtractor> extractorRepository = new HashMap<>();
public static final HashMap<String, BoilerpipeExtractor> extractorRepository = new HashMap<>();

/**
* Returns an instance of the specified extractor
*/
public static synchronized BoilerpipeExtractor getExtractor(String boilerpipeExtractorName) {
public static synchronized BoilerpipeExtractor getExtractor(String boilerpipeExtractorName) {
// Check if there's no instance of this extractor
if (!extractorRepository.containsKey(boilerpipeExtractorName)) {
if (!extractorRepository.containsKey(boilerpipeExtractorName)) {
// FQCN
boilerpipeExtractorName = "de.l3s.boilerpipe.extractors." + boilerpipeExtractorName;
boilerpipeExtractorName = "de.l3s.boilerpipe.extractors." + boilerpipeExtractorName;

// Attempt to load the class
try {
ClassLoader loader = BoilerpipeExtractor.class.getClassLoader();
Class extractorClass = loader.loadClass(boilerpipeExtractorName);
try {
ClassLoader loader = BoilerpipeExtractor.class.getClassLoader();
Class extractorClass = loader.loadClass(boilerpipeExtractorName);

// Add an instance to the repository
extractorRepository.put(boilerpipeExtractorName, (BoilerpipeExtractor)extractorClass.getConstructor().newInstance());

} catch (ClassNotFoundException e) {
LOG.error("BoilerpipeExtractor " + boilerpipeExtractorName + " not found!");
} catch (InstantiationException e) {
LOG.error("Could not instantiate " + boilerpipeExtractorName);
} catch (Exception e) {
LOG.error(e.getLocalizedMessage());
}
extractorRepository.put(boilerpipeExtractorName, (BoilerpipeExtractor)extractorClass.getConstructor().newInstance());

} catch (ClassNotFoundException e) {
LOG.error("BoilerpipeExtractor " + boilerpipeExtractorName + " not found!");
} catch (InstantiationException e) {
LOG.error("Could not instantiate " + boilerpipeExtractorName);
} catch (Exception e) {
LOG.error(e.getLocalizedMessage());
}

return extractorRepository.get(boilerpipeExtractorName);
}

return extractorRepository.get(boilerpipeExtractorName);
}

}

0 comments on commit cf2430f

Please sign in to comment.