Class AbstractAnalysisCache

    • Field Detail

      • LOG

        protected static final Logger LOG
        Deprecated.
      • FINGERPRINTER

        protected static final net.sourceforge.pmd.cache.internal.ClasspathFingerprinter FINGERPRINTER
        Deprecated.
      • pmdVersion

        protected final String pmdVersion
        Deprecated.
      • rulesetChecksum

        protected long rulesetChecksum
        Deprecated.
      • auxClassPathChecksum

        protected long auxClassPathChecksum
        Deprecated.
      • executionClassPathChecksum

        protected long executionClassPathChecksum
        Deprecated.
    • Constructor Detail

      • AbstractAnalysisCache

        public AbstractAnalysisCache()
        Deprecated.
        Creates a new empty cache
    • Method Detail

      • isUpToDate

        public boolean isUpToDate​(File sourceFile)
        Deprecated.
        Description copied from interface: AnalysisCache
        Checks if a given file is up to date in the cache and can be skipped from analysis. Regardless of the return value of this method, each call adds the parameter to the updated cache, which allows ThreadSafeReportListener.ruleViolationAdded(RuleViolation) to add a rule violation to the file. TODO is this really best behaviour? This side-effects seems counter-intuitive.
        Specified by:
        isUpToDate in interface AnalysisCache
        Parameters:
        sourceFile - The file to check in the cache
        Returns:
        True if the cache is a hit, false otherwise
      • analysisFailed

        public void analysisFailed​(File sourceFile)
        Deprecated.
        Description copied from interface: AnalysisCache
        Notifies the cache that analysis of the given file has failed and should not be cached.
        Specified by:
        analysisFailed in interface AnalysisCache
        Parameters:
        sourceFile - The file whose analysis failed
      • cacheExists

        protected abstract boolean cacheExists()
        Deprecated.
        Returns true if the cache exists. If so, normal cache validity checks will be performed. Otherwise, the cache is necessarily invalid (e.g. on a first run).
      • checkValidity

        public void checkValidity​(RuleSets ruleSets,
                                  ClassLoader auxclassPathClassLoader)
        Deprecated.
        Description copied from interface: AnalysisCache
        Checks if the cache is valid for the configured rulesets and class loader. If the provided rulesets and classpath don't match those of the cache, the cache is invalidated. This needs to be called before analysis, as it conditions the good behaviour of AnalysisCache.isUpToDate(File).
        Specified by:
        checkValidity in interface AnalysisCache
        Parameters:
        ruleSets - The rulesets configured for this analysis.
        auxclassPathClassLoader - The class loader for auxclasspath configured for this analysis.