SourceTypeCollisionException in Eclipse project

677 views
Skip to first unread message

Dave Borowitz

unread,
May 10, 2017, 2:20:05 PM5/10/17
to repo-discuss
I reproducibly get this uncaught exception in the Eclipse compiler when building Gerrit on Mac. Anybody seen it before?

It only happens on Mac and on Neon, not Mars/Oxygen (prerelease). Things seem to have compiled except for some of the AutoValue classes weren't generated.

This used to happen on my old laptop; I just got a new laptop yesterday and it still happens, with a completely fresh OS+Eclipse install and everything.

org.eclipse.jdt.internal.compiler.lookup.SourceTypeCollisionException
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:144)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:211)
at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:820)
at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:936)
at org.eclipse.jdt.internal.compiler.Compiler.processCompiledUnits(Compiler.java:608)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:462)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:417)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:368)
at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:179)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:332)
at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:61)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:256)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:180)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Matthias Sohn

unread,
May 10, 2017, 4:20:28 PM5/10/17
to Dave Borowitz, repo-discuss

Dave Borowitz

unread,
May 10, 2017, 4:23:48 PM5/10/17
to Matthias Sohn, repo-discuss
Yeah, seems like upstream doesn't care about it though, and that bug doesn't suggest any workarounds.

Matthias Sohn

unread,
May 10, 2017, 4:27:50 PM5/10/17
to Dave Borowitz, repo-discuss
I asked Dani Megert to have a look

Dave Borowitz

unread,
May 10, 2017, 4:28:36 PM5/10/17
to Matthias Sohn, repo-discuss
Thanks Matthias :)

David Ostrovsky

unread,
May 10, 2017, 4:47:54 PM5/10/17
to Repo and Gerrit Discussion, Alasha

On Wednesday, May 10, 2017 at 8:20:05 PM UTC+2, Dave Borowitz wrote:
I reproducibly get this uncaught exception in the Eclipse compiler when building Gerrit on Mac. Anybody seen it before?

Yes. Alan Tokaev had that problem, and he solved that by checking one
check box in Eclipse setting related to annotation processing. I forgot what
it was.

Matthias Sohn

unread,
May 11, 2017, 7:28:58 AM5/11/17
to Dave Borowitz, repo-discuss
Here is the response from Dani. 

Can you comment in

Bug 469031: SourceTypeCollisionException escapes from compiler

and provide steps to reproduce ?

---------- Forwarded message ----------
From: Daniel Megert <daniel...@ch.ibm.com>
Date: Thu, May 11, 2017 at 11:24 AM
Subject: Re: Fwd: SourceTypeCollisionException in Eclipse project
To: Matthias Sohn <matthi...@gmail.com>


Hi Matthias

This is most likely caused by a bug in the compiler when it processes annotations (APT). I suggest to post a comment into
Bug 469031: SourceTypeCollisionException escapes from compiler

Best with steps.

alan Tokaev

unread,
May 14, 2017, 7:22:53 PM5/14/17
to David Ostrovsky, Repo and Gerrit Discussion
Hi,

I can't find my old mail with a comprehensive description. Just play with annotation processing settings in this area of project properies:
--
Mit freundlichen Grüßen/ Kind regards
Alan Tokaev
------------------------------------------------------
Gabelsbergerstr. 6a
30163 Hannover

Bruce Zu

unread,
Sep 17, 2019, 6:44:53 PM9/17/19
to Repo and Gerrit Discussion

Eclipse Version: 2019-06 (4.12.0) 
Gerrit 2cf768e8a

run into error twice: 
Errors occurred during the build.
Errors running builder 'Java Builder' on project 'gerrit'.
org.eclipse.jdt.internal.compiler.lookup.SourceTypeCollisionException

I tried  
 - DmaxCompiledUnitsAtOnce=1000000
and they do not work
Message has been deleted

Bruce Zu

unread,
Sep 17, 2019, 8:18:55 PM9/17/19
to Repo and Gerrit Discussion

restart Eclipse does NOT apply the update
close Eclipse and starts it again. it works now.
Reply all
Reply to author
Forward
0 new messages