Bug 95326 [code manipulation] Class wizard produces junk
Env: 3.1M7 Sometimes the class wizard produces junk when generating a new class skeleton (seems that constructors are placed inside the import statements). With the following example, the bug can always reproduced: 0) no enclosing type 1) Create a new Class: JxX509TrustManager 2) Modifiers: public only 3) SuperClass: java.lang.Object 4) Interfaces: javax.net.ssl.X509TrustManager 5) Stubs: constructor, abstract methods 6) Generate comments: no 7) Finish produces: <pre> package bla.bla; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import j public JxX509TrustManager() { super(); // @todo Auto-generated constructor stub }avax.net.ssl.X509TrustManager; public class JxX509TrustManager implements X509TrustManager { public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { // @todo Auto-generated method stub } public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { // @todo Auto-generated method stub } public X509Certificate[] getAcceptedIssuers() { // @todo Auto-generated method stub return null; } } </pre>
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewTypeWizardPage.java
private JavaPackageCompletionProcessor fCurrPackageCompletionProcessor;
	private JavaTypeCompletionProcessor fEnclosingTypeCompletionProcessor;
	private StubTypeContext fSuperClassStubTypeContext;
	private StubTypeContext fSuperInterfaceStubTypeContext;
	
	protected IStatus fEnclosingTypeStatus;
	protected IStatus fPackageStatus;
	protected IStatus fTypeNameStatus;
	protected IStatus fSuperClassStatus;
	protected IStatus fModifierStatus;
	protected IStatus fSuperInterfacesStatus;	
	
	private final int PUBLIC_INDEX= 0, DEFAULT_INDEX= 1, PRIVATE_INDEX= 2, PROTECTED_INDEX= 3;
	private final int ABSTRACT_INDEX= 0, FINAL_INDEX= 1, STATIC_INDEX= 2, ENUM_ANNOT_STATIC_INDEX= 1;
	
	private int fTypeKind;
	
	/**
	 * Constant to signal that the created type is a class.
	 * @since 3.1
	 */
	public static final int CLASS_TYPE = 1;
	
	/**
	 * Constant to signal that the created type is a interface.
	 * @since 3.1
	 */
	public static final int INTERFACE_TYPE = 2;