Bug 575208 - APT needs Eclipse restart to go active
Summary: APT needs Eclipse restart to go active
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.20   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2021-08-03 04:15 EDT by Frank Benoit CLA
Modified: 2023-07-28 14:20 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Benoit CLA 2021-08-03 04:15:24 EDT
I observed this behavior many times. When a project's configuration is changed (by git checkout) to make use of APT, e.g. the google AutoValue, this is not working immediately in Eclipse.

Trials without success:
- Clean project build
- modify APT preferences

The only thing that gets it started:
Restart Eclipse, then it starts to work.

Expected behavior: a project clean shall make the new APT get started.
Comment 1 Andrey Loskutov CLA 2021-08-03 15:08:15 EDT
(In reply to Frank Benoit from comment #0)
> I observed this behavior many times. When a project's configuration is
> changed (by git checkout) to make use of APT

Could you be more precise? What exactly is changed?

> The only thing that gets it started:
> Restart Eclipse, then it starts to work.

I guess close & reopen of the project would do the trick too.
Comment 2 Frank Benoit CLA 2021-08-04 02:31:03 EDT
Right, close/open on project did not help as well.

The changes:

.settings/org.eclipse.jdt.apt.core.prefs:
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=apt-gen
org.eclipse.jdt.apt.genTestSrcDir=apt-test-gen
org.eclipse.jdt.apt.processorOptions/com.google.auto.value.AutoBuilderIsUnstable=true
org.eclipse.jdt.apt.processorOptions/nullAnnotations=JDT
org.eclipse.jdt.apt.reconcileEnabled=true

.settings/org.eclipse.jdt.core.prefs: Added
org.eclipse.jdt.core.compiler.processAnnotations=enabled

.factorypath:
<factorypath>
    <factorypathentry kind="VARJAR" id="TARGET_PLATFORM_BUNDLE_POOL/plugins/com.google.auto.value.auto-value_1.8.1.jar" enabled="true" runInBatchMode="false"/>
</factorypath>

.classpath: Added
<classpathentry excluding=".gitignore" kind="src" path="apt-gen">
	<attributes>
		<attribute name="ignore_optional_problems" value="true"/>
	</attributes>
</classpathentry>


build.properties: added apt-gen to source directories

Also the dependencies in the manifest.
Comment 3 Frank Benoit CLA 2021-08-04 02:34:35 EDT
In the workspace, there are 100+ bundles. Some of them have the same configuration for AutoValue as well and they work.
However, if this is added to another bundle, this problem arises.
Comment 4 Frank Benoit CLA 2021-08-04 02:36:27 EDT
About close/reopen, you expected it to work. No, this did not help either.
Comment 5 Vikas Chandra CLA 2021-08-04 03:04:46 EDT
Can you attach a small java project with detailed steps?
Comment 6 Eclipse Genie CLA 2023-07-28 14:20:03 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.