AnalysisCache, ThreadSafeReportListenerFileAnalysisCachepublic abstract class AbstractAnalysisCache extends java.lang.Object implements AnalysisCache
| Modifier and Type | Field | Description |
|---|---|---|
protected long |
auxClassPathChecksum |
|
protected long |
executionClassPathChecksum |
|
protected java.util.concurrent.ConcurrentMap<java.lang.String,AnalysisResult> |
fileResultsCache |
|
protected static java.util.logging.Logger |
LOG |
|
protected java.lang.String |
pmdVersion |
|
protected CachedRuleMapper |
ruleMapper |
|
protected long |
rulesetChecksum |
|
protected java.util.concurrent.ConcurrentMap<java.lang.String,AnalysisResult> |
updatedResultsCache |
| Constructor | Description |
|---|---|
AbstractAnalysisCache() |
Creates a new empty cache
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
analysisFailed(java.io.File sourceFile) |
Notifies the cache that analysis of the given file has failed and should not be cached
|
void |
checkValidity(RuleSets ruleSets,
java.lang.ClassLoader auxclassPathClassLoader) |
Checks if the cache is valid for the configured rulesets and class loader.
|
java.util.List<RuleViolation> |
getCachedViolations(java.io.File sourceFile) |
Retrieves cached violations for the given file.
|
boolean |
isUpToDate(java.io.File sourceFile) |
Check if a given file is up to date in the cache and can be skipped from analysis
|
void |
metricAdded(Metric metric) |
A new metric point has been reported.
|
void |
ruleViolationAdded(RuleViolation ruleViolation) |
A new violation has been found.
|
persistprotected static final java.util.logging.Logger LOG
protected final java.lang.String pmdVersion
protected final java.util.concurrent.ConcurrentMap<java.lang.String,AnalysisResult> fileResultsCache
protected final java.util.concurrent.ConcurrentMap<java.lang.String,AnalysisResult> updatedResultsCache
protected long rulesetChecksum
protected long auxClassPathChecksum
protected long executionClassPathChecksum
protected final CachedRuleMapper ruleMapper
public boolean isUpToDate(java.io.File sourceFile)
AnalysisCacheisUpToDate in interface AnalysisCachesourceFile - The file to check in the cachepublic java.util.List<RuleViolation> getCachedViolations(java.io.File sourceFile)
AnalysisCacheAnalysisCache.isUpToDate(File) first.getCachedViolations in interface AnalysisCachesourceFile - The file to check in the cachepublic void analysisFailed(java.io.File sourceFile)
AnalysisCacheanalysisFailed in interface AnalysisCachesourceFile - The file whose analysis failedpublic void checkValidity(RuleSets ruleSets, java.lang.ClassLoader auxclassPathClassLoader)
AnalysisCachecheckValidity in interface AnalysisCacheruleSets - The rulesets configured for this analysis.auxclassPathClassLoader - The class loader for auxclasspath configured for this analysis.public void ruleViolationAdded(RuleViolation ruleViolation)
ThreadSafeReportListenerruleViolationAdded in interface ThreadSafeReportListenerruleViolation - the found violation.public void metricAdded(Metric metric)
ThreadSafeReportListenermetricAdded in interface ThreadSafeReportListenermetric - the metricCopyright © 2002–2018 PMD. All rights reserved.