From 4bc13520f0082b9214b50c95ddd2703389af8761 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 26 May 2022 20:34:47 +0200 Subject: [PATCH] [core] Internalize some methods in Ant Formatter - Fixes #3787 --- docs/pages/release_notes.md | 10 ++++++++++ .../main/java/net/sourceforge/pmd/ant/Formatter.java | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 9cf3b8ec60f..df36887951f 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -39,6 +39,7 @@ the CPD GUI. See [#3974](https://github.com/pmd/pmd/pull/3974) for details. * cli * [#1445](https://github.com/pmd/pmd/issues/1445): \[core] Allow CLI to take globs as parameters * core + * [#3787](https://github.com/pmd/pmd/issues/3787): \[core] Internalize some methods in Ant Formatter * [#3942](https://github.com/pmd/pmd/issues/3942): \[core] common-io path traversal vulnerability (CVE-2021-29425) * cs (c#) * [#3974](https://github.com/pmd/pmd/pull/3974): \[cs] Add option to ignore C# attributes (annotations) @@ -69,6 +70,15 @@ the CPD GUI. See [#3974](https://github.com/pmd/pmd/pull/3974) for details. {% jdoc core::PMDConfiguration#setInputPaths(java.lang.String) %} are now deprecated. A new set of methods have been added, which use lists and do not rely on comma splitting. +#### Internal API + +Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0. +You can identify them with the `@InternalApi` annotation. You'll also get a deprecation warning. + +- 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 * [#3961](https://github.com/pmd/pmd/pull/3961): \[java] Fix #3954 - NPE in UseCollectionIsEmptyRule with record - [@flyhard](https://github.com/flyhard) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java b/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java index e248dc6f187..37c4c190f24 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java @@ -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(); @@ -111,6 +115,8 @@ public void start(String baseDir) { } } + @Deprecated + @InternalApi public void end(Report errorReport) { try { renderer.renderFileReport(errorReport); @@ -125,6 +131,8 @@ public void end(Report errorReport) { } } + @Deprecated + @InternalApi public boolean isNoOutputSupplied() { return toFile == null && !toConsole; } @@ -233,6 +241,7 @@ private static String getNativeConsoleEncoding() { return null; } + @Deprecated @InternalApi public Renderer toRenderer(final Project project, List inputPaths) { this.start(project.getBaseDir().toString());