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.
Sources from 0903. GeneratorUtilities#importFQNs doesn't import FQNs from the right side of an assignment when the right side expression is a method invocation. For example using it on a method with the following body: javax.persistence.EntityManagerFactory emf = javax.persistence.Persistence.createEntityManagerFactory("PU"); imports javax.persistence.EntityManagerFactory but not javax.persistence.Persistence.
Can you, please, fix this? It seems that it is sufficient to insert the following code into 'else' branch of TranslateIdentifier.visitMemberSelect(). ExpressionTree expression = (ExpressionTree) translateTree(node.getExpression()); if (expression != node.getExpression()) { node = make.MemberSelect(expression, node.getIdentifier()); }
Thanks for the patch: http://hg.netbeans.org/main?cmd=changeset;node=ca7bf1a69370 Not an optimal solution, but hopefully will be OK for now.
Integrated into 'main-golden', available in NB_Trunk_Production #278 build Changeset: http://hg.netbeans.org/main/rev/ca7bf1a69370 User: Jan Lahoda <jlahoda@netbeans.org> Log: #114623: ability to import java.util.Collections from java.util.Collections.emptyList().