Static Inner Class and missing Symbol

1,882 views
Skip to first unread message

Michael Hradek

unread,
Apr 25, 2018, 5:15:01 PM4/25/18
to Project Lombok
Hey folks,

In the snip below I need to specify the full path to @Getter and @Setter for a static inner class which contains another static inner class. This example works as I have specified the path to @Getter and @Setter as @lombok.Getter and @lombok.Setter respectively. In Eclipse it'll appear fine but when compiling using javac 1.8.0_121 it'll not compile on those two lines if the path is missing. Any clues why? The other annotation, @JsoIgnoreProperties, doesn't require the path.

This code is used to export raw data streams from S3 hence the wonky data structures/definitions.

@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserStreamData {

   
private long approximateCreationDateTime;
   
private Keys keys;
   
private OldImage oldImage;
   
private String sequenceNumber;
   
private long sizeBytes;
   
private String streamViewType;

   
// A static class with an inner static class must declare the path of the lombok annotation.
    @lombok.Getter
   
@lombok.Setter

   
@JsonIgnoreProperties(ignoreUnknown = true)
   
static class Keys {
       
private Id id;

       
@Getter
       
@Setter
       
@JsonIgnoreProperties(ignoreUnknown = true)
       
static class Id {
           
private String s;
       
}
   
}

   
// ...
}


Reinier Zwitserloot

unread,
Apr 26, 2018, 11:01:45 AM4/26/18
to Project Lombok
What happens if you don't? No direct errors, but the Getter annotation appears to be doing nothing whatsoever (as in, no getters are generated)?

In that case I guess it might be that lombok's internal type inferencer is somehow messing this up but this isn't a tricky case at all so that'd be a bit confusing.

If the above is true, would you terribly mind filing a bug issue at the tracker: https://github.com/rzwitserloot/lombok/issues and pasting that snippet in there for us to confirm the issue?

Thanks!
Reply all
Reply to author
Forward
0 new messages