Bug 94567 - [compiler] Bogus errors
Summary: [compiler] Bogus errors
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0.2   Edit
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-10 18:38 EDT by Eric Nickell CLA
Modified: 2006-03-27 06:48 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Nickell CLA 2005-05-10 18:38:19 EDT
FIRST ------------------------------

The eclipse JDT is frequently giving bogus errors in two portions of my code.

In test.parc.augustus.FooTest the snippet


public class FooTest extends TestCase {
	...
	public static class MyCategorizableReportable extends 
CategorizableReportable {

		private static final ColumnTemplate[] COLUMN_TEMPLATES = {
				ColumnTemplate.staticColumn("pop"),
		};
	...

eclipse complains about staticColumn. But in com.parc.augustus.ColumnTemplate, 
there is no compilation error for

public class ColumnTemplate {
	...
	public static ColumnTemplate staticTemplate(String columnName) {
		return new ColumnTemplate() {
			public void addColumnNames(List columns) {
			}
		};
	}
	...
}

Is it worth mentioning that when this error first appeared, that 
ColumnTemplate was abstract, but was de-abstracted in a failed attempt to 
understand what eclipse was complaining about?

SECOND -----------------------------------------


public interface Splitter {

	String getCategory(Sighting sighting);

	Collection/*String*/ allCategories();

	Splitter BY_THROWABLE = new Splitter() {
		private final Set USES_FOO = new HashSet(Arrays.asList(new 
String[] {
				"ge", "ck", "st"}));
		private final Set USES_BAR = new HashSet(Arrays.asList(new 
String[] {
				"or", "er", "ue", }));
		private final Set USES_NOTHING = new HashSet(Arrays.asList(new 
String[] {
				"id", "an",
		}));

This will compile just fine for a while. Then (without any edits to that 
file), it will decide that "The blank final field 'USES_NOTHING' may not have 
been initialized." What???

Sometimes, I can make this second error go away by reordering USES_FOO, 
USES_BAR, and USES_NOTHING. Sometimes I can't. Sometimes I can make it 
disappear by deleting Splitter.class from the file structure and doing a 
rebuild. A rebuild by itself doesn't help.


Overall, these two errors are hampering my day-to-day work significantly, and 
changing my impression of eclipse 3.0.2 as a stable, usable platform for work.

I apologize in advance that I cannot post anything but sanitized versions 
these files, and that I do not have time to try to produce minimal, failing 
examples.
Comment 1 Philipe Mulet CLA 2005-05-11 04:50:05 EDT
First time we hear about these issues.
Do you reproduce these issues in a recent 3.1 build ? (try M6 or better).
Comment 2 Eric Nickell CLA 2005-05-12 18:54:05 EDT
Please ignore the FIRST part. It was a typo, driven by a lack of sleep. Please 
accept my apologies on that score.

The SECOND, however, is real, and does persist into 3.1M6. However, it may be 
de-escalated from "blocker" because the workaround (which would have occurred 
to me had I had enough sleep) is to remove the keyword "final".
Comment 3 Philipe Mulet CLA 2005-05-17 12:48:50 EDT
Cannot reproduce in 3.1m7 with following testcase. It only complains about
missing abstract method implementations.

import java.util.*;

interface Splitter {

	String getCategory(Sighting sighting);

	Collection/*String*/ allCategories();

	Splitter BY_THROWABLE = new Splitter() {
		private final Set USES_FOO = new HashSet(Arrays.asList(new String[] {	"ge",
"ck", "st"}));
		private final Set USES_BAR = new HashSet(Arrays.asList(new String[] {	"or",
"er", "ue", }));
		private final Set USES_NOTHING = new HashSet(Arrays.asList(new String[] {
"id", "an", }));
	};
}
class Sighting {}
Comment 4 Philipe Mulet CLA 2005-05-19 18:24:34 EDT
Please reopen if you can provide reproduceable steps
Comment 5 Eric Nickell CLA 2005-05-19 18:28:43 EDT
Sorry. Cannot provide reproduceable steps at the present time, due to time 
constraints. Problem persists in my workspace, but workaround continues to 
work as well.

Will re-open if current workload lightens, and I can strip to minimal problem, 
and sanitize for public consumption.
Comment 6 Philipe Mulet CLA 2006-03-27 06:44:18 EST
reopening to close properly
Comment 7 Philipe Mulet CLA 2006-03-27 06:45:15 EST
Not reproduced in a long time. Also many changes occurred in this area since then.
Comment 8 Philipe Mulet CLA 2006-03-27 06:48:09 EST
oops, did mean to close as worksforme
Comment 9 Philipe Mulet CLA 2006-03-27 06:48:25 EST
worksforme