From f449cc72e394709fc918f1db52e145c347f49d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Fri, 6 Sep 2019 17:34:02 +0200 Subject: [PATCH] Deprecate Report::hasMetrics and Report::metrics --- docs/pages/release_notes.md | 3 ++- pmd-core/src/main/java/net/sourceforge/pmd/Report.java | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 3ae2fa6739..ba778b55fe 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -80,7 +80,8 @@ about the usage and features of the rule designer. * The method {% jdoc !!core::processor.AbstractPMDProcessor#filenameFrom(DataSource) %} has been deprecated. It was used to determine a "short name" of the file being analyzed, so that the report can use short names. However, this logic has been moved to the renderers. - +* The method {% jdoc !!core::Report#metrics() %} and {% jdoc core::Report::hasMetrics() %} have + been deprecated. They were leftovers from a previous deprecation round targeting {% jdoc core::lang.rule.StatisticalRule %}. ##### Internal APIs diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/Report.java b/pmd-core/src/main/java/net/sourceforge/pmd/Report.java index 064b0ad231..b257537eb2 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/Report.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/Report.java @@ -417,7 +417,10 @@ public class Report implements Iterable { * * @return true if there are metrics, false * otherwise + * + * @deprecated see {@link StatisticalRule} */ + @Deprecated public boolean hasMetrics() { return !metrics.isEmpty(); } @@ -426,7 +429,10 @@ public class Report implements Iterable { * Iterate over the metrics. * * @return an iterator over the metrics + * + * @deprecated see {@link StatisticalRule} */ + @Deprecated public Iterator metrics() { return metrics.iterator(); }