This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271449 - Warning for unused constructor parameters missing
Summary: Warning for unused constructor parameters missing
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.2
Hardware: PC Windows 10
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-08 12:01 UTC by milanka
Modified: 2017-11-24 00:56 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description milanka 2017-09-08 12:01:44 UTC
public class Test {
    
    private int a;
    private int b;
    private int c;

    public Test(int a, int b, int c) { // "c" is not marked as unused
        this.a = a;
        this.b = b;
    }
}

In the case above I have added "c" to parameters and as a private variable, but forgotten to do the assignment. Of course if I had marked all variables as final I would have noticed the error, but showing a warning would nevertheless be a good thing in my opinion.

Issue https://netbeans.org/bugzilla/show_bug.cgi?id=199451 is related, but I think this issue has less potential problems.