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 253826

Summary: [81cat] Java hint: InfiniteRecursion testcase doesn't work
Product: qa Reporter: cezariusz <cezariusz>
Component: Test SpecificationsAssignee: Jiri Prox <jiriprox>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Windows 8 x64   
Issue Type: DEFECT Exception Reporter:

Description cezariusz 2015-07-27 06:48:59 UTC
Link: http://services.netbeans.org/synergy/client/app/#/case/4989/suite/1691

Product Version: NetBeans IDE Dev (Build 201507240001)
Java: 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_51-b16
System: Windows 8 version 6.2 running on amd64; UTF-8; pl_PL (nb)

public class InfiniteRecursion {
        
    private void method() {
        method(); //Hint: Infinite recursion
    }
    
    private void method2() {
        // Exclude methods that could be overriden - disabled
        method2(); //NoHint: Infinite recursion
    }
}

The second case (method2) doesn't work as described. I think, that the method shouldn't be private to make it work as expected.
Comment 1 Svata Dedic 2015-07-29 07:40:39 UTC
yes, exactly; the method2 must allow for override AND the 'exclude overriden' checkbox in the hint settings must be checked - then the hint will not trigger on methods which can be overriden (= they may skip super method invocation, breaking the recursion).

There could be yet another case - a final class with non-private method; such method cannot be overriden, so the hint should appear always.
Comment 2 Jiri Prox 2015-08-06 15:08:12 UTC
Sample project updated