org.eclipse.jpt.common.core.utility
Class BodySourceWriter.ImportPackage
java.lang.Object
org.eclipse.jpt.common.core.utility.BodySourceWriter.ImportPackage
- Enclosing class:
- BodySourceWriter
protected static class BodySourceWriter.ImportPackage
- extends Object
We need a 'collision' flag for when we encounter a class from
'java.lang' followed by a class from the current compilation unit's
package. We will need to include the explicit import of the
'java.lang' class and all the references to the other class will
have to be fully-qualified.
If the classes are encountered in the opposite order (i.e. the class
from the current compilation unit's package followed by the class
from 'java.lang'), we do *not* need to import the first class while
all the references to the 'java.lang' class will be fully-qualified.
Unfortunately, we still have a problem: if we reference a class from
'java.lang' and there is a conflicting class from the current
compilation unit's package (but that class is *not* revealed to us
here), the simple name will be resolved to the non-'java.lang' class.
Unless we simply force an import of *all* 'java.lang' classes.... :-(
This shouldn't happen very often. :-)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
packageName
protected final String packageName
collision
protected boolean collision
BodySourceWriter.ImportPackage
protected BodySourceWriter.ImportPackage(String packageName)
Copyright (c) 2012 Oracle. All rights reserved.