eclipse-xtext / eclipse-xtext/xtext

Maven build: Annotations with RetentionPolicy = SOURCE are omitted by JvmAnnotationTarget.getAnnotations()

Open
#2,353 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
831
Forks
330
Avg merge
3d 7h
Merged PRs (30d)
12

Description

From a Xbase DSL I reference a Java type which is annotated with an annotation which's RetentionPolicy is SOURCE. The Java type is located in the same maven module as the dsl file which references it.

Within Eclipse the getAnnotations() method of the referenced java types also returns the annotations with RetentionPolicy = SOURCE.

I would expect this behaviour if the referenced Java type is located in another Maven module as the Source-Annotations are discarded by the compiler. But in my case the DSL file and the reference Java class are located in the same module and therefore the source file is available.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Maven build for a Xbase DSL and inspect JvmAnnotationTarget.getAnnotations() for a referenced Java type with a SOURCE-retained annotation in the same module. Compare the result with Eclipse behavior; done means same-module source annotations are returned consistently while annotations from other modules remain subject to compilation output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.