This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
commit 9e9b3c9344f033982ee02c099e32f2f5cfa05247 Author: Gary David Gregory (Code signing key) <[email protected]> AuthorDate: Sat Jun 22 11:31:55 2024 -0400 Deprecate TransitiveHull.INGORED in favor of TransitiveHull.getIgnored() --- src/changes/changes.xml | 1 + src/conf/spotbugs-exclude-filter.xml | 28 +++++++++++++++++++++++++--- src/examples/TransitiveHull.java | 11 +++++++++-- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 2b506a9c..d0b76af9 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -72,6 +72,7 @@ The <action> type attribute can be add,update,fix,remove. <action type="update" dev="ggregory" due-to="Gary Gregory">Fix SpotBugs RV_ABSOLUTE_VALUE_OF_HASHCODE in Mini.Environment.</action> <action type="update" dev="ggregory" due-to="Gary Gregory">Fix SpotBugs DM_DEFAULT_ENCODING in Mini.MiniC.</action> <action type="update" dev="ggregory" due-to="Gary Gregory">Fix SpotBugs WMI_WRONG_MAP_ITERATOR in Package.go(String[]).</action> + <action type="update" dev="ggregory" due-to="Gary Gregory">Deprecate TransitiveHull.INGORED in favor of TransitiveHull.getIgnored().</action> <!-- ADD --> <action type="update" dev="ggregory" due-to="nbauma109, Gary Gregory, Mark Roberts">Add accessors to model and unit tests, Javadoc #183.</action> <!-- UPDATE --> diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml index 0de6c655..f7c0cdf0 100644 --- a/src/conf/spotbugs-exclude-filter.xml +++ b/src/conf/spotbugs-exclude-filter.xml @@ -65,14 +65,19 @@ <Class name="org.apache.bcel.Repository"/> <Method name="setRepository"/> <Bug pattern="EI_EXPOSE_STATIC_REP2"/> - </Match> - + </Match> + <!-- Binary compatibility --> <Match> <Class name="org.apache.bcel.Repository"/> <Method name="getRepository"/> <Bug pattern="MS_EXPOSE_REP"/> </Match> - + <!-- Binary compatibility --> + <Match> + <Class name="TransitiveHull"/> + <Field name="IGNORED"/> + <Bug pattern="MS_PKGPROTECT"/> + </Match> <!-- TODO: this should probably be sinplified @@ -160,6 +165,11 @@ <Method name="optimizeIFs"/> <Bug pattern="EC_UNRELATED_TYPES_USING_POINTER_EQUALITY"/> </Match> + <!-- TODO Needs a redo, looks like very old code. --> + <Match> + <Class name="Mini.Environment"/> + <Bug pattern="CN_IDIOM_NO_SUPER_CALL"/> + </Match> <!-- Skip JavaCC generated code. --> <Match> @@ -189,4 +199,16 @@ <Match> <Class name="Mini.ASTIfExpr"/> </Match> + <!-- Skip JavaCC generated code. --> + <Match> + <Class name="Mini.MiniParserTreeConstants"/> + </Match> + <!-- FALSE POSITIVE. --> + <Match> + <Class name="Mini.MiniC"/> + <Field name="errors"/> + <Field name="file"/> + <Field name="warnings"/> + <Bug pattern="UWF_UNWRITTEN_FIELD"/> + </Match> </FindBugsFilter> diff --git a/src/examples/TransitiveHull.java b/src/examples/TransitiveHull.java index 719eb429..9a34c1db 100644 --- a/src/examples/TransitiveHull.java +++ b/src/examples/TransitiveHull.java @@ -35,6 +35,7 @@ import org.apache.bcel.generic.ObjectType; import org.apache.bcel.generic.Type; import org.apache.bcel.util.ClassQueue; import org.apache.bcel.util.ClassSet; +import org.apache.commons.lang3.ArrayUtils; /** * Find all classes referenced by given start class and all classes referenced by those and so on. In other words: @@ -52,6 +53,12 @@ import org.apache.bcel.util.ClassSet; */ public class TransitiveHull extends org.apache.bcel.classfile.EmptyVisitor { + /** + * Should be private. + * + * @deprecated Use {@link #getIgnored()}. + */ + @Deprecated public static final String[] IGNORED = {"java[.].*", "javax[.].*", "sun[.].*", "sunw[.].*", "com[.]sun[.].*", "org[.]omg[.].*", "org[.]w3c[.].*", "org[.]xml[.].*", "net[.]jini[.].*"}; @@ -129,7 +136,7 @@ public class TransitiveHull extends org.apache.bcel.classfile.EmptyVisitor { } public String[] getIgnored() { - return ignored; + return ignored != null ? ignored.clone() : null; } /** @@ -138,7 +145,7 @@ public class TransitiveHull extends org.apache.bcel.classfile.EmptyVisitor { * @param v Value to assign to ignored. */ public void setIgnored(final String[] v) { - ignored = v; + ignored = ArrayUtils.clone(v); } /**
