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.
}
public Tree visitMethod(MethodTree node, Boolean p) {
if (unit != null && info.getTreeUtilities().isSynthetic(/*should not be used:*/unit, node)) return node;
BlockTree body = (BlockTree) translateTree(node.getBody());
Tree defaultValue = translateTree(node.getDefaultValue());
List<? extends VariableTree> parameters = translateTree(node.getParameters());
System.err.println(res);
assertEquals(golden, res);
public void testDontImportSyntheticConstructors() throws Exception {
testFile = new File(getWorkDir(), "Test.java");
String originalCode =
"package test;\n" +
"public class Test {\n" +
" private void initComponents(java.util.ArrayList orig) {\n" +
" new java.util.ArrayList(orig) {};\n" +
" }\n" +
"}\n";
TestUtilities.copyStringToFile(testFile, originalCode);
String golden =
"package test;\n\n" +
"import java.util.ArrayList;\n\n" +
" private void initComponents(ArrayList orig) {\n" +
" new ArrayList(orig) {};\n" +
JavaSource src = getJavaSource(testFile);
Task<WorkingCopy> task = new Task<WorkingCopy>() {
public void run(WorkingCopy workingCopy) throws IOException {
workingCopy.toPhase(Phase.RESOLVED);
CompilationUnitTree cut = workingCopy.getCompilationUnit();
GeneratorUtilities gu = GeneratorUtilities.get(workingCopy);
workingCopy.rewrite(cut, gu.importFQNs(cut));
};
src.runModificationTask(task).commit();
String res = TestUtilities.copyFileToString(testFile);
String getGoldenPckg() {
return "";