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] AbstractClassWithoutAbstractMethod false negative with inner abstract classes · Issue #2398 · pmd/pmd

[java] AbstractClassWithoutAbstractMethod false negative with inner abstract classes #2398

New issue
Copy link
New issue
Copy link
Closed
#2377
Closed
[java] AbstractClassWithoutAbstractMethod false negative with inner abstract classes#2398
#2377
Copy link
Labels
a:false-negativePMD doesn't flag a problematic piece of code
Milestone
6.23.0

Description

@adangel
adangel
opened on Apr 4, 2020
Issue body actions

Affects PMD Version: 6.22.0

Rule: AbstractClassWithoutAbstractMethod

Description:

When a abstract class contains a abstract inner class which has some abstract methods, then the outer abstract class is not detected, that it has no abstract methods.

Code Sample demonstrating the issue:

Test cases "Abstract class with inner classes false-negative 2" and "Abstract class with inner classes false-negative 3" are failing right now.

    <test-code>
        <description>Abstract class with inner classes false-negative 1</description>
        <expected-problems>1</expected-problems>
        <expected-linenumbers>1</expected-linenumbers>
        <code><![CDATA[
public abstract class Foo {
    public void concreteMethod() {}
    public abstract static class MyInner implements Other {
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>Abstract class with inner classes false-negative 2</description>
        <expected-problems>1</expected-problems>
        <expected-linenumbers>1</expected-linenumbers>
        <code><![CDATA[
public abstract class Foo {
    public void concreteMethod() {}
    public abstract static class MyInner extends Other {
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>Abstract class with inner classes false-negative 3</description>
        <expected-problems>1</expected-problems>
        <expected-linenumbers>1</expected-linenumbers>
        <code><![CDATA[
public abstract class Foo {
    public void concreteMethod() {}
    public abstract static class MyInner {
        public abstract void someMethod();
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>Class with abstract inner class false-negative</description>
        <expected-problems>1</expected-problems>
        <expected-linenumbers>2</expected-linenumbers>
        <code><![CDATA[
public class Foo {
    public abstract static class MyInner {
        public void concreteMethod() {}
    }
}
        ]]></code>
    </test-code>

Expected outcome:

  • This is a false negative

Additional notes:

  • This is being fixed with the changes in [all] Update all XPath rules to XPath 2.0 #2377 .

Activity

  1. adangel
    added this to the 6.23.0 milestone on Apr 4, 2020
  2. adangel
    added
    a:false-negativePMD doesn't flag a problematic piece of code
    has:pr
    on Apr 4, 2020
  3. adangel
    linked a pull request that will close this issue[all] Update all XPath rules to XPath 2.0 #2377on Apr 18, 2020
  4. adangel
    closed this as completedin 054b3acon Apr 18, 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.23.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.