Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Consolidate @InternalApi classes #4809

Merged
merged 38 commits into from
Feb 22, 2024

Conversation

adangel
Copy link
Member

@adangel adangel commented Jan 26, 2024

Describe the PR

  • [core] Internalize AnalysisCache and related types

    • net.sourceforge.pmd.cache.AbstractAnalysisCache
    • net.sourceforge.pmd.cache.AnalysisCache
    • net.sourceforge.pmd.cache.AnalysisCacheListener
    • net.sourceforge.pmd.cache.AnalysisResult
    • net.sourceforge.pmd.cache.CachedRuleMapper
    • net.sourceforge.pmd.cache.CachedRuleViolation
    • net.sourceforge.pmd.cache.ChecksumAware
    • net.sourceforge.pmd.cache.FileAnalysisCache
    • net.sourceforge.pmd.cache.NoopAnalysisCache
    • whole package net.sourceforge.pmd.cache
  • PmdReporter

    • Already in internal packages
      • net.sourceforge.pmd.util.log.internal.ErrorsAsWarningsReporter
      • net.sourceforge.pmd.util.log.internal.QuietReporter
      • net.sourceforge.pmd.util.log.internal.SimpleMessageReporter
    • Renamed MessageReporter to PmdReporter - and removed InternalApi, since the reporter is supposed to be configurable via AbstractConfiguration#setReporter, so is part of the public API
  • net.sourceforge.pmd.util.ResourceLoader

    • moved to net.sourceforge.pmd.util.internal.ResourceLoader
  • net.sourceforge.pmd.cpd.Tokens

    • ctor net.sourceforge.pmd.cpd.Tokens#Tokens() is hidden now
    • the class itself is not anymore InternalApi, because it is used in public API: net.sourceforge.pmd.cpd.TokenEntry#getImage
  • net.sourceforge.pmd.properties.PropertyTypeId

  • net.sourceforge.pmd.properties.PropertyDescriptor#getTypeId

  • net.sourceforge.pmd.lang.document.FileCollector

    • #newCollector(net.sourceforge.pmd.lang.LanguageVersionDiscoverer, net.sourceforge.pmd.util.log.MessageReporter) and #newCollector(net.sourceforge.pmd.util.log.MessageReporter)
    • #getCollectedFiles and #getReporter are promoted to public API
  • net.sourceforge.pmd.lang.rule.RuleTargetSelector#isRuleChain

    • removed, as it was only used in a unit test
  • net.sourceforge.pmd.lang.LanguageProcessor.AnalysisTask#AnalysisTask

    • also make net.sourceforge.pmd.lang.LanguageProcessor.AnalysisTask#withFiles internal, that's the other way to create a new AnalysisTask
  • net.sourceforge.pmd.renderers.AbstractAccumulatingRenderer#renderFileReport

    • the method is made final, so that it can't be overridden anymore in subclasses. That's how the AccumulatingRenderer works now.
  • net.sourceforge.pmd.Report - made the following methods private

  • net.sourceforge.pmd.RuleContext

  • pmd-ant

    • Formatter
      • The method getRenderer() has been removed (not used, can access field directly here)
      • The method start(String) is private now and not accessible anymore.
      • The method end(Report) has been removed (has not been used)
      • The method isNoOutputSupplied() is now package private and not accessible anymore.
      • The method newListener(Project) is now package private and not accessible anymore. Added InternalApiBridge, so that we access it from PMDTaskImpl
    • PMDTask
      • The method getRelativizeRoots() has been removed - actually moved into PMDTaskImpl
  • pmd-apex - cleanups done, see [core] Consolidate @InternalApi classes #4348

  • pmd-java - cleanups done, see [core] Consolidate @InternalApi classes #4348

  • pmd-jsp

  • pmd-modelica

  • pmd-plsql

  • pmd-scala

  • pmd-visualforce

  • Accept ADR 3 ([doc] ADR 3 - API evolution principles #4756)

  • javadoc generation - exclude internal

  • net.sourceforge.pmd.lang.rule.ParametricRuleViolation - to be done after [core] Consolidate n.s.pmd.reporting package #4803

  • net.sourceforge.pmd.RuleSet etc. - to be done after [core] Consolidate n.s.pmd.lang.rule package #4799

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@adangel adangel mentioned this pull request Jan 26, 2024
55 tasks
@adangel adangel changed the title [core] Internalize AnalysisCache and related types [core] Consolidate @InternalApi classes Jan 26, 2024
PmdReporter is supposed to be used when configuring PMD
(see AbstractConfiguration#setReporter), so it can't be internal.

Refs pmd#4348
@pmd-test
Copy link

pmd-test commented Jan 26, 2024

1 Message
📖 Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact

Generated by 🚫 Danger

@adangel adangel added this to the 7.0.0 milestone Jan 27, 2024
oowekyala

This comment was marked as resolved.

@adangel

This comment was marked as resolved.

@adangel
Copy link
Member Author

adangel commented Feb 10, 2024

This is finally ready now.

@adangel adangel marked this pull request as ready for review February 10, 2024 12:12
@adangel adangel added the in:pmd-internals Affects PMD's internals label Feb 10, 2024
@adangel adangel merged commit 609e364 into pmd:master Feb 22, 2024
3 checks passed
@adangel adangel deleted the issue-4348-internal-api branch February 22, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:pmd-internals Affects PMD's internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] Consolidate @InternalApi classes
3 participants