Bug 14013

Summary: Compiler should not consider 'this.CONST' as constant expression
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Philipe Mulet CLA 2002-04-17 11:35:08 EDT
Build 20020416

From Rodrigo:

I've been looking into building Eclipse using javac instead of the JDT compiler 
and found that the following method from 
org.eclipse.pde.internal.core.schema.SchemaCompositor does not compile 
properly. The workaround is to replace this.ALL with ALL and so on. 

	public void write(String indent, PrintWriter writer) {
		writeComments(writer);
		String tag = null;

		switch (kind) {
			case this.ALL :
				tag = "all";
				break;
			case this.CHOICE :
				tag = "choice";
				break;
			case this.GROUP :
				tag = "group";
				break;
			case this.SEQUENCE :
				tag = "sequence";
				break;
		}
		if (tag == null)
			return;
		writer.print(indent + "<" + tag);
		if (getMinOccurs() != 1 && getMaxOccurs() != 1) {
			String min = "" + getMinOccurs();
			String max =
				getMaxOccurs() == 
Integer.MAX_VALUE ? "unbounded" : ("" + getMaxOccurs());
			writer.print(" minOccurs=\"" + min + "\" maxOccurs=\"" 
+ max + "\"");
		}
		writer.println(">");
		String indent2 = indent + Schema.INDENT;
		for (int i = 0; i < children.size(); i++) {
			Object obj = children.elementAt(i);
			if (obj instanceof IWritable) {
				((IWritable) obj).write(indent2, writer);
			}
		}
		writer.println(indent + "</" + tag + ">");
	}
Comment 1 Philipe Mulet CLA 2002-04-17 11:36:19 EDT
This is a bug in our compiler as per constant expressions specs. Both javac 
1.3.1 and javac 1.4 are rejecting this code.

Fixed