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.

Bug 114623 - GeneratorUtilities#importFQNs does not import FQNs from right side of assignment
Summary: GeneratorUtilities#importFQNs does not import FQNs from right side of assignment
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks: 114588
  Show dependency tree
 
Reported: 2007-09-04 13:33 UTC by Erno Mononen
Modified: 2008-06-24 04:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erno Mononen 2007-09-04 13:33:14 UTC
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.
Comment 1 Jan Stola 2008-06-09 11:19:55 UTC
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());
            }
Comment 2 Jan Lahoda 2008-06-23 14:43:30 UTC
Thanks for the patch:
http://hg.netbeans.org/main?cmd=changeset;node=ca7bf1a69370

Not an optimal solution, but hopefully will be OK for now.
Comment 3 Quality Engineering 2008-06-24 04:27:52 UTC
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().