GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [java] AvoidCatchingThrowable can not detect the case: catch (java.lang.Throwable t) · Issue #2439 · pmd/pmd

[java] AvoidCatchingThrowable can not detect the case: catch (java.lang.Throwable t) #2439

New issue
Copy link
New issue
Copy link
Closed
#2678
Closed
[java] AvoidCatchingThrowable can not detect the case: catch (java.lang.Throwable t)#2439
#2678
Copy link
Labels
a:false-negativePMD doesn't flag a problematic piece of code
Milestone
6.27.0

Description

@wuchiuwong
wuchiuwong
opened on Apr 25, 2020
Issue body actions

Affects PMD Version:
6.22.0

Rule:
AvoidCatchingThrowable

Description:
AvoidCatchingThrowable can not detect the case: catch (java.lang.Throwable t).
The undetectable reason is that using if (name.hasImageEqualTo("Throwable")) { in pmd-java-6.22.0-sources.jar\net\sourceforge\pmd\lang\java\rule\errorprone\AvoidCatchingThrowableRule.java_24 to detect can't coverage this case.

Code Sample demonstrating the issue:

catch (java.lang.Throwable t) {
    throw new javax.xml.rpc.ServiceException(t);
}

Expected outcome:
false-negative

Running PMD through:
CLI

Activity

  1. wuchiuwong
    added
    a:bugPMD crashes or fails to analyse a file.
    on Apr 25, 2020
  2. oowekyala
    added
    a:false-negativePMD doesn't flag a problematic piece of code
    and removed
    a:bugPMD crashes or fails to analyse a file.
    on Apr 25, 2020
  3. adangel
    changed the title [-][java]AvoidCatchingThrowable can not detect the case: catch (java.lang.Throwable t)[/-] [+][java] AvoidCatchingThrowable can not detect the case: catch (java.lang.Throwable t)[/+] on Jul 31, 2020
  4. adangel
    added this to the 6.27.0 milestone on Jul 31, 2020
  5. adangel
    closed this as completedin df2e5bfon Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-negativePMD doesn't flag a problematic piece of code

    Type

    No type

    Projects

    No projects

      Milestone

      • 6.27.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.