Skip to content

Annotations not parsing properly #9

@bsinclair2-atlassian

Description

@bsinclair2-atlassian
package com.example.entity;

import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.codehaus.jackson.annotate.JsonProperty;

@Setter
@Getter
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SomeDto {
    @Nullable
    @JsonProperty("foo")
    @com.fasterxml.jackson.annotation.JsonProperty("foo")
    @jakarta.annotation.Nullable
    private List<String> foo;
}
rascal> M3 m3 = createM3FromFile(srcfile, classPath = cp);
rascal> m3.annotations
rel[loc from,loc to]: {
  <|java+field:///com/example/entity/SomeDto/foo|,|java+class:///com/fasterxml|>,
  <|java+field:///com/example/entity/SomeDto/foo|,|java+class:///jakarta|>,
  <|java+field:///com/example/entity/SomeDto/foo|,|java+class:///JsonProperty|>,
  <|java+field:///com/example/entity/SomeDto/foo|,|java+class:///Nullable|>,
  <|java+class:///com/example/entity/SomeDto|,|java+class:///JsonInclude|>,
  <|java+class:///com/example/entity/SomeDto|,|java+class:///Getter|>,
  <|java+class:///com/example/entity/SomeDto|,|java+class:///NoArgsConstructor|>,
  <|java+class:///com/example/entity/SomeDto|,|java+class:///Setter|>
}

I would expect the annotations field to look more like:

{
  <|java+field:///com/example/entity/SomeDto/foo|,|java+class:///com/fasterxml/jackson/annotation/JsonProperty|>,
  <|java+field:///com/example/entity/SomeDto/foo|,|java+class:///jakarta/annotation/Nullable|>,
  <|java+field:///com/example/entity/SomeDto/foo|,|java+class:///org/codehaus/jackson/annotate/JsonProperty|>,
  <|java+field:///com/example/entity/SomeDto/foo|,|java+class:///javax/annotation/Nullable|>,
  <|java+class:///com/example/entity/SomeDto|,|java+class:///com/fasterxml/jackson/annotation/JsonInclude|>,
  <|java+class:///com/example/entity/SomeDto|,|java+class:///lombok/Getter|>,
  <|java+class:///com/example/entity/SomeDto|,|java+class:///lombok/NoArgsConstructor|>,
  <|java+class:///com/example/entity/SomeDto|,|java+class:///lombok/Setter|>
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions