Skip to content

Infer issue not being detected - CHECKERS_EXPENSIVE_OVERRIDES_UNANNOTATED #1923

@yorkueecsuser

Description

@yorkueecsuser

This infer bug is being detected in the Java code below CHECKERS_EXPENSIVE_OVERRIDES_UNANNOTATED with version 1.0.0, and this flag --annotation-reachability, but it's not being detected when scanned with infer 1.2.0.

Is this a known issue, and will the documentation be updated if a different flag is needed?

import java.lang.annotation.*;
@Retention(RetentionPolicy.CLASS)
@Target({
    ElementType.TYPE,
    ElementType.METHOD,    
    ElementType.FIELD,     
    ElementType.CONSTRUCTOR, 
    ElementType.PARAMETER
})
@interface Expensive {}

interface I {
    void foo();
}

class A implements I {
    @Expensive
    public void foo() {
        System.out.println("Expensive operation executed.");
    } 
    public void showBug() {
        foo();
    }
}

Command:
infer run --annotation-reachability -- javac A.java

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions