Bug 93377 - [1.5][compiler] Multiple auto-build failures when using generics
Summary: [1.5][compiler] Multiple auto-build failures when using generics
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-01 19:01 EDT by Kory Markevich CLA
Modified: 2005-06-10 06:18 EDT (History)
1 user (show)

See Also:


Attachments
Project for bug (31.16 KB, application/octet-stream)
2005-05-01 19:02 EDT, Kory Markevich CLA
no flags Details
Batch compiler test case that shows one of the errors (2.96 KB, patch)
2005-05-31 11:30 EDT, Maxime Daniel CLA
no flags Details | Diff
Batch compiler test case that covers more of the original (5.39 KB, patch)
2005-06-01 05:27 EDT, Maxime Daniel CLA
no flags Details | Diff
Batch compiler test cases upgraded for HEAD (15.79 KB, patch)
2005-06-06 06:09 EDT, Maxime Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kory Markevich CLA 2005-05-01 19:01:30 EDT
Found in I20050426-1700.

I've been having major problems with the Eclipse auto-builder in a large project
of mine that makes extensive use of generics and other 1.5 features.  I've
managed to narrow down the source of the errors to a group of about 15 files,
and have attached a project containing them.  There are a number of bugs that
can be recreated with this project.  I've placed them under one entry as I am
unsure whether they are distinct bugs or simply different manifestations of the
same bug; at the very least they all seem related.

Bug One:

Make a modification to DeploymentPhase.java so that the auto-builder recompiles
it.  There should now be two errors, namely an "incomplete build path" and a
"cannot be resolved" error.  If another change is made to the file and
auto-recompiled, the errors disappear.  Oddly enough, if the file
Participant.java is removed from the project, this bug no longer occurs.

Bug Two:

Make a modification to Participant.java so that the auto-builder recompiles it.
 There should now be a Bound Mismatch error on line 1 of Participant.java (which
has the package declaration.)  A clean is required to clear this error.

Bug Three:

Make a modification to ClientGame.java so that the auto-builder recompiles it. 
There should now be ~4 errors in the problem list.  A clean must be performed to
clear the error.

Bug Four:

Make a modification to HostGame.java so that the auto-builder recompiles it. 
There should now be ~21 errors in the problem list, and the following exception
MAY be in the error log.  The exception does not always appear.  If another
change is made to the file and auto-recompiled, the errors disappear.

Warning 2005-05-01 15:33:08.171 java.lang.NullPointerException encountered while
running Java Builder.
java.lang.NullPointerException
	at
org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding.boundCheck(TypeVariableBinding.java:73)
	at
org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.resolve(ParameterizedTypeBinding.java:684)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:53)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superInterfaces(BinaryTypeBinding.java:784)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.detectHierarchyCycle(ClassScope.java:973)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.detectHierarchyCycle(ClassScope.java:918)
	at
org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(QualifiedTypeReference.java:75)
	at
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:141)
	at
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:104)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:1050)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:719)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchyWithoutMembers(ClassScope.java:890)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.detectHierarchyCycle(ClassScope.java:923)
	at
org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(QualifiedTypeReference.java:75)
	at
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:141)
	at
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveTypeArgument(TypeReference.java:158)
	at
org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference.internalResolveType(ParameterizedSingleTypeReference.java:134)
	at
org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference.resolveType(ParameterizedSingleTypeReference.java:214)
	at
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:104)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:1050)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:719)
	at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:856)
	at
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:243)
	at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:195)
	at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:301)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:315)
	at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:240)
	at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:190)
	at
org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.build(IncrementalImageBuilder.java:114)
	at
org.eclipse.jdt.internal.core.builder.JavaBuilder.buildDeltas(JavaBuilder.java:224)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:152)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:581)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1026)
	at org.eclipse.core.runtime.Platform.run(Platform.java:757)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:160)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:198)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:227)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1026)
	at org.eclipse.core.runtime.Platform.run(Platform.java:757)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:230)
	at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:249)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:278)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:139)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:200)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:67)

Bug Five:

If the project is compiled using javac, an "inconvertible types" error is found
on line 5 of Phase.java.  This line only causes a warning with the Eclipse compiler.
Comment 1 Kory Markevich CLA 2005-05-01 19:02:25 EDT
Created attachment 20572 [details]
Project for bug

A ZIP file of the project for this bug entry.
Comment 2 Kory Markevich CLA 2005-05-02 01:21:57 EDT
Just to note, I listed the bugs in my idea of severity.  In my full project the
first bug manifests most commonly.  Making a change to just about any file will
cause it to occur, which means that I have to turn auto-build off to get
anything done.

I realize that these may be separate bugs and thus warrant separate entries; if
so, would I attach the project to each one or just point back to the first entry...?
Comment 3 Philipe Mulet CLA 2005-05-30 19:06:06 EDT
Maxime - pls try to reproduce in latest
Comment 4 Maxime Daniel CLA 2005-05-31 08:02:02 EDT
Could reproduce all bugs on I20050426-1700.
As of 3.1 RC1 (I20050527-1300):
- Bug 1 and Bug 4 type bugs cannot be reproduced; the latter might be masked by
Bug 2 type bugs;
- Bug 2 type bugs (that is, auto build raises undue errors, clean build gets rid
of them) are observed on files:
  ClientGame.java
  Game.java
  HostGame.java
  Participant.java
  Phase.java
  StateManager.java
  StateStore.java
  (most frequent error message is 'Bound mismatch...', but others occur as
   well);
- Bug 5 still there.

I would suggest that Bug 5 be separated in a distinct bug, since it behaves the
same in auto build and clean build, hence should be observable from a batch
compiler point of view.
Comment 5 Maxime Daniel CLA 2005-05-31 10:46:25 EDT
Segregated bug 5 into a new bug,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=97494.
Comment 6 Maxime Daniel CLA 2005-05-31 11:30:26 EDT
Created attachment 22053 [details]
Batch compiler test case that shows one of the errors

Fixing this error may or may not be sufficient to fix the bug.
_test30 must be renamed to test30 to be executed.
Note that getting rid of the third type parameter on X (and applying needed
cascaded changes) suppresses the faulty behavior.
Comment 7 Maxime Daniel CLA 2005-06-01 05:27:29 EDT
Created attachment 22128 [details]
Batch compiler test case that covers more of the original

This is still simplified a bit compared to the original test case, but more
errors are raised than with 22053. Added for the sake of better coverage.
Comment 8 Maxime Daniel CLA 2005-06-06 06:09:24 EDT
Created attachment 22412 [details]
Batch compiler test cases upgraded for HEAD

These tests run OK with build N20050603-0010.
The same build runs OK against the test case provided in comment #1, except
that no extra investigation has been made for bug 5, tracked separately.
I would suggest that this bug be considered as fixed.
Comment 9 Philipe Mulet CLA 2005-06-06 06:46:47 EDT
Olivier - pls integrate Maxime tests, and tag as fixed.
Comment 10 Olivier Thomann CLA 2005-06-06 13:45:18 EDT
Fixed and released in HEAD.
Regression tests added in
org.eclipse.jdt.core.tests.compiler.regression.BatchCompilerTest.test030/test032
Comment 11 David Audel CLA 2005-06-07 14:00:24 EDT
Verified for 3.1RC2 using build N20050607-0010 + JDT/COre HEAD
Comment 12 David Audel CLA 2005-06-10 06:18:56 EDT
Verified for 3.1 RC2 using build I20050610-0010