Bug 471217 - Errors running builder 'Java Builder' on project ends with SourceTypeCollisionException
Summary: Errors running builder 'Java Builder' on project ends with SourceTypeCollisio...
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: APT (show other bugs)
Version: 4.5   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Generic inbox for the JDT-APT component CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
: 527116 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-06-27 18:15 EDT by Benjamin Mueller CLA
Modified: 2023-04-02 18:08 EDT (History)
5 users (show)

See Also:


Attachments
Log file (5.33 KB, application/octet-stream)
2015-06-27 18:15 EDT, Benjamin Mueller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Mueller CLA 2015-06-27 18:15:38 EDT
Created attachment 254775 [details]
Log file

Compiling failed at the point where the annotation processor should start. Same worked in Luna and mars m releases. Please see attached log file.
Comment 1 Ralf Hauser CLA 2016-06-26 08:22:51 EDT
Bug 496789  similar with  ArrayIndexOutOfBoundsException
Comment 2 Jann Schneider CLA 2016-09-20 03:56:42 EDT
These build errors still occur. Tested with:
* MacOS El Capitan 
* JDK 1.8.0_102 
* Eclipse Neon, package "Eclipse for Java Developers" 

Any suggestions how to avoid these issues?
Comment 3 Jay Arthanareeswaran CLA 2016-09-20 04:09:12 EDT
(In reply to Ralf Hauser from comment #1)
> Bug 496789  similar with  ArrayIndexOutOfBoundsException

This appears to be a different issue, although the end result is same - compilation interrupted.

(In reply to Jann Schneider from comment #2)
> These build errors still occur. Tested with:
> * MacOS El Capitan 
> * JDK 1.8.0_102 
> * Eclipse Neon, package "Eclipse for Java Developers" 
> 
> Any suggestions how to avoid these issues?

It would be good if you can share the steps to reproduce this bug.
Comment 4 Jay Arthanareeswaran CLA 2017-11-12 23:41:30 EST
*** Bug 527116 has been marked as a duplicate of this bug. ***
Comment 5 Benjamin Mueller CLA 2017-11-17 06:31:41 EST
(In reply to Jay Arthanareeswaran from comment #3)
> (In reply to Ralf Hauser from comment #1)
> > Bug 496789  similar with  ArrayIndexOutOfBoundsException
> 
> This appears to be a different issue, although the end result is same -
> compilation interrupted.
> 
> (In reply to Jann Schneider from comment #2)
> > These build errors still occur. Tested with:
> > * MacOS El Capitan 
> > * JDK 1.8.0_102 
> > * Eclipse Neon, package "Eclipse for Java Developers" 
> > 
> > Any suggestions how to avoid these issues?
> 
> It would be good if you can share the steps to reproduce this bug.

Hi Jay, sorry I missed your request for further steps. Unfortunately, I am only able to reproduce this issue with customer code and our proprietary annotation processor so I cannot share it.
I saw that you have a solution for the SourceTypeCollisionException issue and also working on a NullPointerException. I would like to test your fix and also ask when it will be available officially.
Comment 6 Eclipse Genie CLA 2019-11-11 08:29:43 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 7 Benjamin Mueller CLA 2020-11-27 07:59:33 EST
Hi,
the issue still occurs with Eclipse 2020-09

org.eclipse.jdt.internal.compiler.lookup.SourceTypeCollisionException
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:170)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:475)
	at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:855)
	at org.eclipse.jdt.internal.compiler.Compiler.processAnnotationsInternal(Compiler.java:979)
	at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:932)
	at org.eclipse.jdt.internal.compiler.Compiler.processCompiledUnits(Compiler.java:630)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:475)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:469)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:386)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:214)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:345)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:79)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:275)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:187)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:832)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392)
	at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:515)
	at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:412)
	at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:291)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)


eclipse.buildId=4.17.0.I20200902-1800
java.version=14.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
Comment 8 Benjamin Mueller CLA 2021-03-04 04:33:08 EST
Hi,
one of our developers found the following workaround:
Adding -DmaxCompiledUnitsAtOnce to eclipse.ini solves our issue.
It doesn't matter if we use the value 0 or 100000, in both cases compiling works again.
Comment 9 Etienne Dube CLA 2021-04-07 14:59:34 EDT
Also encountered this bug with Eclipse 2021-03. It occurs in one usage of the Google AutoValue annotation processor (which is probably one of the most widespread uses of java annotation processors). The project compiles fine with javac. I'm unable to figure out why exactly the SourceTypeCollisionException occurs. Adding "-DmaxCompiledUnitsAtOnce=100000" to eclipse.ini as suggested by Benjamin Mueller solves the issue.


org.eclipse.jdt.internal.compiler.lookup.SourceTypeCollisionException
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:165)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:475)
	at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:855)
	at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:971)
	at org.eclipse.jdt.internal.compiler.Compiler.processCompiledUnits(Compiler.java:630)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:475)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:377)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:214)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:336)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:79)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:272)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:187)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:846)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:229)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:277)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:330)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:333)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:385)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:406)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

eclipse.buildId=4.19.0.I20210303-1800
java.version=15.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
Comment 10 Jay Arthanareeswaran CLA 2021-04-08 00:55:59 EDT
For the record, there's some discussion on removing limit for the compilation batch size on bug 571522.
Comment 11 Eclipse Genie CLA 2023-04-02 18:08:06 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.