You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ki...@apache.org on 2022/05/20 22:51:35 UTC

[commons-lang] 02/02: Add Spotbugs exclusions after dependabot update (no code modification)

This is an automated email from the ASF dual-hosted git repository.

kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git

commit b9f3b72c15508057d93ad2ed9399a18400d1b2d0
Author: Bruno P. Kinoshita <ki...@users.noreply.github.com>
AuthorDate: Sat May 21 10:44:37 2022 +1200

    Add Spotbugs exclusions after dependabot update (no code modification)
---
 src/conf/spotbugs-exclude-filter.xml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml
index 7cbba7a97..2d4cf12f3 100644
--- a/src/conf/spotbugs-exclude-filter.xml
+++ b/src/conf/spotbugs-exclude-filter.xml
@@ -30,6 +30,9 @@
       <Bug pattern="EI_EXPOSE_REP" />
       <Bug pattern="EI_EXPOSE_REP2" />
       <Bug pattern="MS_EXPOSE_REP" />
+      <Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION" />
+      <Bug pattern="THROWS_METHOD_THROWS_CLAUSE_THROWABLE" />
+      <Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION" />
     </Or>
   </Match>
 


Re: [commons-lang] 02/02: Add Spotbugs exclusions after dependabot update (no code modification)

Posted by Gary Gregory <ga...@gmail.com>.
Thank you Bruno :-)

Gary

On Sat, May 21, 2022, 19:50 Bruno Kinoshita <ki...@apache.org> wrote:

> Hi Gary,
>
> Fair enough. I only checked on case, in the Functions.java where a generic
> type extends Throwable and triggers the issue in Spotbugs [1]
>
> But I agree other cases might be legit code smells that need fixing. I will
> revert the change on the master branch, and when/if Dependabot triggers a
> new PR I'll try to add notes about what can be ignored and what needs
> fixing.
>
> Thanks for spotting it!
>
> Bruno
>
> [1]
>
> https://github.com/apache/commons-lang/blob/90086a212df1069fd19fb9e4db5b6471761d02b8/src/main/java/org/apache/commons/lang3/Functions.java#L160
>
> On Sun, 22 May 2022 at 01:58, Gary Gregory <ga...@gmail.com> wrote:
>
> > -1
> >
> > Please do not allow turn off this check. These checks are real
> > anti-patterns and have allowed me to fix call sites here IIRC and in
> > other components. If there are spot cases of legitimate code like
> > "throws new RuntimeException(...)", then the code should be documented
> > in-line and each call site specifically excluded from SpotBugs.
> > Otherwise, PRs and maintainers can add "throws new
> > RuntimeException(..,)" all over the place without SpotBugs rasing this
> > as an anti-pattern.
> >
> > TY,
> > Gary
> >
> > On Fri, May 20, 2022 at 6:51 PM <ki...@apache.org> wrote:
> > >
> > > This is an automated email from the ASF dual-hosted git repository.
> > >
> > > kinow pushed a commit to branch master
> > > in repository https://gitbox.apache.org/repos/asf/commons-lang.git
> > >
> > > commit b9f3b72c15508057d93ad2ed9399a18400d1b2d0
> > > Author: Bruno P. Kinoshita <ki...@users.noreply.github.com>
> > > AuthorDate: Sat May 21 10:44:37 2022 +1200
> > >
> > >     Add Spotbugs exclusions after dependabot update (no code
> > modification)
> > > ---
> > >  src/conf/spotbugs-exclude-filter.xml | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/src/conf/spotbugs-exclude-filter.xml
> > b/src/conf/spotbugs-exclude-filter.xml
> > > index 7cbba7a97..2d4cf12f3 100644
> > > --- a/src/conf/spotbugs-exclude-filter.xml
> > > +++ b/src/conf/spotbugs-exclude-filter.xml
> > > @@ -30,6 +30,9 @@
> > >        <Bug pattern="EI_EXPOSE_REP" />
> > >        <Bug pattern="EI_EXPOSE_REP2" />
> > >        <Bug pattern="MS_EXPOSE_REP" />
> > > +      <Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION" />
> > > +      <Bug pattern="THROWS_METHOD_THROWS_CLAUSE_THROWABLE" />
> > > +      <Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION" />
> > >      </Or>
> > >    </Match>
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
>

Re: [commons-lang] 02/02: Add Spotbugs exclusions after dependabot update (no code modification)

Posted by Bruno Kinoshita <ki...@apache.org>.
Hi Gary,

Fair enough. I only checked on case, in the Functions.java where a generic
type extends Throwable and triggers the issue in Spotbugs [1]

But I agree other cases might be legit code smells that need fixing. I will
revert the change on the master branch, and when/if Dependabot triggers a
new PR I'll try to add notes about what can be ignored and what needs
fixing.

Thanks for spotting it!

Bruno

[1]
https://github.com/apache/commons-lang/blob/90086a212df1069fd19fb9e4db5b6471761d02b8/src/main/java/org/apache/commons/lang3/Functions.java#L160

On Sun, 22 May 2022 at 01:58, Gary Gregory <ga...@gmail.com> wrote:

> -1
>
> Please do not allow turn off this check. These checks are real
> anti-patterns and have allowed me to fix call sites here IIRC and in
> other components. If there are spot cases of legitimate code like
> "throws new RuntimeException(...)", then the code should be documented
> in-line and each call site specifically excluded from SpotBugs.
> Otherwise, PRs and maintainers can add "throws new
> RuntimeException(..,)" all over the place without SpotBugs rasing this
> as an anti-pattern.
>
> TY,
> Gary
>
> On Fri, May 20, 2022 at 6:51 PM <ki...@apache.org> wrote:
> >
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > kinow pushed a commit to branch master
> > in repository https://gitbox.apache.org/repos/asf/commons-lang.git
> >
> > commit b9f3b72c15508057d93ad2ed9399a18400d1b2d0
> > Author: Bruno P. Kinoshita <ki...@users.noreply.github.com>
> > AuthorDate: Sat May 21 10:44:37 2022 +1200
> >
> >     Add Spotbugs exclusions after dependabot update (no code
> modification)
> > ---
> >  src/conf/spotbugs-exclude-filter.xml | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/src/conf/spotbugs-exclude-filter.xml
> b/src/conf/spotbugs-exclude-filter.xml
> > index 7cbba7a97..2d4cf12f3 100644
> > --- a/src/conf/spotbugs-exclude-filter.xml
> > +++ b/src/conf/spotbugs-exclude-filter.xml
> > @@ -30,6 +30,9 @@
> >        <Bug pattern="EI_EXPOSE_REP" />
> >        <Bug pattern="EI_EXPOSE_REP2" />
> >        <Bug pattern="MS_EXPOSE_REP" />
> > +      <Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION" />
> > +      <Bug pattern="THROWS_METHOD_THROWS_CLAUSE_THROWABLE" />
> > +      <Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION" />
> >      </Or>
> >    </Match>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: [commons-lang] 02/02: Add Spotbugs exclusions after dependabot update (no code modification)

Posted by Gary Gregory <ga...@gmail.com>.
-1

Please do not allow turn off this check. These checks are real
anti-patterns and have allowed me to fix call sites here IIRC and in
other components. If there are spot cases of legitimate code like
"throws new RuntimeException(...)", then the code should be documented
in-line and each call site specifically excluded from SpotBugs.
Otherwise, PRs and maintainers can add "throws new
RuntimeException(..,)" all over the place without SpotBugs rasing this
as an anti-pattern.

TY,
Gary

On Fri, May 20, 2022 at 6:51 PM <ki...@apache.org> wrote:
>
> This is an automated email from the ASF dual-hosted git repository.
>
> kinow pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/commons-lang.git
>
> commit b9f3b72c15508057d93ad2ed9399a18400d1b2d0
> Author: Bruno P. Kinoshita <ki...@users.noreply.github.com>
> AuthorDate: Sat May 21 10:44:37 2022 +1200
>
>     Add Spotbugs exclusions after dependabot update (no code modification)
> ---
>  src/conf/spotbugs-exclude-filter.xml | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml
> index 7cbba7a97..2d4cf12f3 100644
> --- a/src/conf/spotbugs-exclude-filter.xml
> +++ b/src/conf/spotbugs-exclude-filter.xml
> @@ -30,6 +30,9 @@
>        <Bug pattern="EI_EXPOSE_REP" />
>        <Bug pattern="EI_EXPOSE_REP2" />
>        <Bug pattern="MS_EXPOSE_REP" />
> +      <Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION" />
> +      <Bug pattern="THROWS_METHOD_THROWS_CLAUSE_THROWABLE" />
> +      <Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION" />
>      </Or>
>    </Match>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org