Skip to content

Commit

Permalink
Merge pull request #3980 from adangel:deprecate-ant-formatter
Browse files Browse the repository at this point in the history
[core] Internalize some methods in Ant Formatter #3980
  • Loading branch information
adangel committed May 28, 2022
2 parents ede4c6d + 4bc1352 commit 09c1abb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/pages/release_notes.md
Expand Up @@ -85,6 +85,7 @@ ruleset. Use the new rule {% rule java/codestyle/UnnecessarySemicolon %} instead
* [#1445](https://github.com/pmd/pmd/issues/1445): \[core] Allow CLI to take globs as parameters
* core
* [#2352](https://github.com/pmd/pmd/issues/2352): \[core] Deprecate \<lang\>-\<ruleset\> hyphen notation for ruleset references
* [#3787](https://github.com/pmd/pmd/issues/3787): \[core] Internalize some methods in Ant Formatter
* [#3835](https://github.com/pmd/pmd/issues/3835): \[core] Deprecate system properties of CPDCommandLineInterface
* [#3942](https://github.com/pmd/pmd/issues/3942): \[core] common-io path traversal vulnerability (CVE-2021-29425)
* cs (c#)
Expand Down Expand Up @@ -140,6 +141,9 @@ You can identify them with the `@InternalApi` annotation. You'll also get a depr
{% jdoc !!core::cpd.CPD#run(java.lang.String...) %} or {% jdoc !!core::cpd.CPD#main(java.lang.String[]) %}
should be used.
- Several members of {% jdoc test::cli.BaseCPDCLITest %} have been deprecated with replacements.
- The methods {% jdoc !!core::ant.Formatter#start(java.lang.String) %},
{% jdoc !!core::ant.Formatter#end(net.sourceforge.pmd.Report) %}, {% jdoc !!core::ant.Formatter#getRenderer() %},
and {% jdoc !!core::ant.Formatter#isNoOutputSupplied() %} have been internalized.

### External Contributions

Expand Down
9 changes: 9 additions & 0 deletions pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java
Expand Up @@ -61,10 +61,14 @@ public void addConfiguredParam(Parameter parameter) {
this.parameters.add(parameter);
}

@Deprecated
@InternalApi
public Renderer getRenderer() {
return renderer;
}

@Deprecated
@InternalApi
public void start(String baseDir) {

Properties properties = createProperties();
Expand Down Expand Up @@ -111,6 +115,8 @@ public void start(String baseDir) {
}
}

@Deprecated
@InternalApi
public void end(Report errorReport) {
try {
renderer.renderFileReport(errorReport);
Expand All @@ -125,6 +131,8 @@ public void end(Report errorReport) {
}
}

@Deprecated
@InternalApi
public boolean isNoOutputSupplied() {
return toFile == null && !toConsole;
}
Expand Down Expand Up @@ -233,6 +241,7 @@ private static String getNativeConsoleEncoding() {
return null;
}

@Deprecated
@InternalApi
public Renderer toRenderer(final Project project, List<String> inputPaths) {
this.start(project.getBaseDir().toString());
Expand Down

0 comments on commit 09c1abb

Please sign in to comment.