Bug 14013 - Compiler should not consider 'this.CONST' as constant expression
Summary: Compiler should not consider 'this.CONST' as constant expression
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-17 11:35 EDT by Philipe Mulet CLA
Modified: 2002-04-17 11:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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