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.
This bug was originally marked as duplicate of bug 226050, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE 8.1 (Build 201510222201) VM: Java HotSpot(TM) 64-Bit Server VM, 25.40-b25, Java(TM) SE Runtime Environment, 1.8.0_40-b26 OS: Windows 7 User Comments: GUEST: <Please provide a description of the problem or the steps to reproduce>not sure how the exception triggered. i think i saw it when at netbeans started GUEST: package objectstreams; import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.math.BigDecimal; import java.util.Calendar; public class ObjectStreams { static final String dataFile = "invoicedata"; static final BigDecimal[] ceny = { new BigDecimal("19.99"), new BigDecimal("9.99"), new BigDecimal("15.90"), new BigDecimal("3.99"), new BigDecimal("4.99") }; static final int[] jednotky = {12, 8, 13, 29, 50}; static final String[] popisy = { "Tricko Java", "Hrncek Java", "Figurka Java", "Odznak Java", "Klicenka Java" }; public static void main(String[] args) throws IOException, ClassNotFoundException { ObjectOutputStream vystup = null; try { vystup = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(dataFile))); vystup.writeObject(Calendar.getInstance()); for (int i = 0; i < ceny.l GUEST: Running an application that simply queries data and prints an output to the screen GUEST: fuk ye mum m90<Please provide a description of the problem or the steps to reproduce> GUEST: no idea Stacktrace: java.lang.NullPointerException at com.sun.source.util.TreePath.<init>(TreePath.java:102) at org.netbeans.modules.java.source.matching.CopyFinder.checkListsWithMultistatementTrees(CopyFinder.java:762) at org.netbeans.modules.java.source.matching.CopyFinder.checkLists(CopyFinder.java:631) at org.netbeans.modules.java.source.matching.CopyFinder.visitBlock(CopyFinder.java:808) at org.netbeans.modules.java.source.matching.CopyFinder.visitBlock(CopyFinder.java:120) at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:924)
Created attachment 157491 [details] stacktrace
Created attachment 158156 [details] stacktrace Cut out a body of text from a source file with command+c. Exception immediately came.
Null should not be passed as a parent path to the TreePath constructor.
Reporters: could you please attach the entire source, or at least a fragment of it ? The defect is triggered by a piece of code which is a candidate to convert to try-with-resources: [final] X var = ...; // X extends AutoCloseable ... (code possibly wrapped in try - finally) var.close(); // possibly in finally clause It's possible that the code fragment which triggers the defect contains a syntax error or something which screws up the parse tree. Dusane: It seems the null item in the BlockTree.getStatements() list comes from javac's output for the source code, not the pattern. The defect exists across different javac versions in the code path triggered by the same set of patterns.
Created attachment 164593 [details] stacktrace Not sure what triggered it.