Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 431676

Summary: APT uses Eclipse classloader
Product: [Eclipse Project] JDT Reporter: Harry Terkelsen <het>
Component: APTAssignee: Generic inbox for the JDT-APT component <jdt-apt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.sprigogin, eclipse, jarthana, tparker
Version: 4.3   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Harry Terkelsen CLA 2014-03-31 18:36:43 EDT
In JDT-APT, the classloader for annotation processing is parented by the Eclipse classloader. This causes errors when running annotation processors that need to make use of Eclipse classes (eg. an annotation processor that calls the Eclipse formatter). These annotation processors will throw errors when the classloader tries to load Eclipse classes since they've already been loaded by the parent classloader.
Comment 1 Harry Terkelsen CLA 2014-03-31 19:33:26 EDT
Allow me to elaborate on my hastily written bug summary. The problem occurs because the annotation processor uses a different version of an Eclipse class than the one that has already been loaded by the Eclipse classloader.
Comment 2 Walter Harley CLA 2014-04-01 01:03:02 EDT
What happens if you try to load javac internal classes from an annotation processor running within javac?
Comment 3 Eclipse Genie CLA 2020-02-01 16:10:23 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.