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.
Consider this rule/script: --- $foo = $map.get($key); if ($foo == null) { $foo = $expr$; $map.put($key, $foo); } :: $map instanceof java.util.Map => $foo = $map.computeIfAbsent($key, p -> $expr$); ;; --- And this sample file: --- Map<String, String> map = new HashMap<>(); String foo; String key = ""; foo = map.get(key); if (foo == null) { foo = ""; map.put(key, foo); } --- Applying the transformation leads to: foo = map.computeIfAbsent(key, (<any> p) -> ("")); which is not ideal. This is on: Product Version: NetBeans IDE 8.0 (Build 20140315-f817edfd05cd) Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b70 Runtime: Java(TM) SE Runtime Environment 1.8.0-b132 System: Linux version 3.16.0-30-generic running on amd64; UTF-8; en_US (nb) User directory: /usr/local/home/lahvac/.netbeans/dev Cache directory: /usr/local/home/lahvac/.netbeans/dev/var/cache
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss