Bug 91696 - [1.5][compiler] Spurious errors and NPE during auto-build
Summary: [1.5][compiler] Spurious errors and NPE during auto-build
Status: RESOLVED DUPLICATE of bug 90881
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 M7   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-17 17:19 EDT by Kory Markevich CLA
Modified: 2005-04-18 15:19 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 Kory Markevich CLA 2005-04-17 17:19:31 EDT
Found in 3.1M6.  The following classes/interfaces, each in separate files:

public interface A< K extends A.BK< S >, S extends A.BS >
{
    public interface BS extends Serializable { }
    public interface BK< SS > extends Serializable {
        public void put( SS a );
    }
    
    public P< K, S > getP( );
}

public class P< K extends A.BK< S >, S extends A.BS >
{
    K k;
    S s;
    
    public void put( )
    {
        k.put( s );
    }
}

public class C< T > implements A< C.K, C.S >
{
    public static class K implements A.BK< C.S > {
        public void put( S a )
        {
        }
    }
    protected static class S implements A.BS { }
    
    public P< K, S > getP( )
    {
        return null;
    }
}

Compile without error under javac, as well as with a full-build after a clean. 
When auto-built however they generate spurious bound mismatch errors.

Further, though these small examples do NOT generate it, a larger project with
similar code caused an NPE during every auto-build:

Warning 2005-04-17 13:21:45.78 java.lang.NullPointerException encountered while
running Java Builder.
java.lang.NullPointerException
at
org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveType(QualifiedAllocationExpression.java:239)
at
org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:291)
at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:780)
at
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:415)
at
org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:167)
at
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:393)
at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1061)
at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1110)
at
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:300)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:510)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:335)
at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:239)
at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:189)
at
org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.build(IncrementalImageBuilder.java:113)
at
org.eclipse.jdt.internal.core.builder.JavaBuilder.buildDeltas(JavaBuilder.java:223)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:151)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:581)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1021)
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:1021)
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)

This NPE stopped occuring after a restart of Eclipse.

Also the errors reported would be corrupt: a bound mismatch error was reported
with a line number of 0, and another (which only appeared in the editor, not the
problem view) would have a nonsensical description of "implements
some.class.method".  I believe the 0-line error then prevented the type from
being compiled at all, resulting in a huge number of "cannot be resolved" errors.
Comment 1 Philipe Mulet CLA 2005-04-18 03:25:37 EDT
Your guess is right. Dup.
Added GenericTypeTest#test611

*** This bug has been marked as a duplicate of 90881 ***
Comment 2 Kory Markevich CLA 2005-04-18 14:50:54 EDT
I downloaded I20050414-1107 and the bound error is still present; I assume the
fix didn't make it into that I-build.  Will it make the next I-build or should I
just wait until the bug is marked verified?
Comment 3 Philipe Mulet CLA 2005-04-18 15:19:21 EDT
It isn't released to HEAD yet, as it is part of a group of changes which are
being worked on at once (near capture conversion).
It should be released soon (understand during this week, but likely after the
next integration build).