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.
Product Version: NetBeans IDE 8.0.1 (Build 201408251540) Updates: NetBeans IDE is updated to version NetBeans 8.0.1 Patch 1.1 Java: 1.8.0_25; Java HotSpot(TM) 64-Bit Server VM 25.25-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b18 System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb) User directory: C:\Users\Gili\AppData\Roaming\NetBeans\8.0.1 Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\8.0.1 Given: DefaultRequestScope() { this.queryDslConfiguration = LazyReference.create(() -> { SQLTemplates dialect = new PostgresTemplates(); Configuration result = new Configuration(dialect); if (parent.getRunMode() == RunMode.DEBUG) { DebugLockMonitor debugLockMonitor = (DebugLockMonitor) getLockMonitor(); result.addListener(debugLockMonitor); } return result; }); } where getLockMonitor() is a non-final method in a non-final class. I believe the hint is wrong because the lambda function is not invoked by the constructor. The lambda is passed into a method that constructs an anonymous class that invokes the lambda. See https://bitbucket.org/cowwoc/pouch/src/26a1127f6a4bbafe08706d5abff7dd5ebb916301/src/main/java/org/bitbucket/cowwoc/pouch/LazyReference.java?at=default#cl-32 for the implementation in question. Expected behavior: the editor should not display this warning for lamda functions, unless it can prove that they are invoked by the constructor.
Maybe whatever technique prevents "leaking this in constructor", when 'this' is used in a lambda in a constructor, would also work for this bug.
*** This bug has been marked as a duplicate of bug 254526 ***