Dali Provisional API
Release 3.2

org.eclipse.jpt.common.core.utility
Class BodySourceWriter.ImportPackage

java.lang.Object
  extended by 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. :-)


Field Summary
protected  boolean collision
           
protected  String packageName
           
 
Constructor Summary
protected BodySourceWriter.ImportPackage(String packageName)
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

packageName

protected final String packageName

collision

protected boolean collision
Constructor Detail

BodySourceWriter.ImportPackage

protected BodySourceWriter.ImportPackage(String packageName)

Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.