public abstract class AbstractAnalysisCache extends java.lang.Object implements AnalysisCache
Modifier and Type | Field and 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 and Description |
---|
AbstractAnalysisCache()
Creates a new empty cache
|
Modifier and Type | Method and 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
persist
protected 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)
AnalysisCache
isUpToDate
in interface AnalysisCache
sourceFile
- The file to check in the cachepublic java.util.List<RuleViolation> getCachedViolations(java.io.File sourceFile)
AnalysisCache
AnalysisCache.isUpToDate(File)
first.getCachedViolations
in interface AnalysisCache
sourceFile
- The file to check in the cachepublic void analysisFailed(java.io.File sourceFile)
AnalysisCache
analysisFailed
in interface AnalysisCache
sourceFile
- The file whose analysis failedpublic void checkValidity(RuleSets ruleSets, java.lang.ClassLoader auxclassPathClassLoader)
AnalysisCache
checkValidity
in interface AnalysisCache
ruleSets
- The rulesets configured for this analysis.auxclassPathClassLoader
- The class loader for auxclasspath configured for this analysis.public void ruleViolationAdded(RuleViolation ruleViolation)
ThreadSafeReportListener
ruleViolationAdded
in interface ThreadSafeReportListener
ruleViolation
- the found violation.public void metricAdded(Metric metric)
ThreadSafeReportListener
metricAdded
in interface ThreadSafeReportListener
metric
- the metricCopyright © 2002–2018 PMD. All rights reserved.