Please try to compile the following three examples separately:
class Foo {
class Bar {
static final String baz = null;
}
}
class Foo {
class Bar {
static final String baz = "baz";
}
}
class Foo {
static class Bar {
static final String baz = null;
}
}
As you might notice, the first one will give an error message and the second and third are ok. You cannot declare a static variable in a non-static inner class. Unless the value is a compile time constant (and null isn't).
That said, I must say that I didn't expect this error message. And I'm not sure we're going to fix it. I recommend making either the inner class static, move the declaration to an outer class. Or not use @Getter :-(
Can you confirm that this is the problem?
Roel
> -----Oorspronkelijk bericht-----
> Van: bska...@gmail.com
> [mailto:project...@googlegroups.com] Namens Brian Skaarup
> Verzonden: 28 July 2010 11:24
> Aan: Project Lombok
> Onderwerp: [project lombok] Is @Getter not supposed to work
> on static fields?
> --
> You received this message because you are subscribed to the
> Google Groups group for http://projectlombok.org/
>
> To post to this group, send email to
> project...@googlegroups.com To unsubscribe from this
> group, send email to
> project-lombo...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/project-lombok?hl=en
>
>
> -----Oorspronkelijk bericht-----
> Van: bska...@gmail.com
> [mailto:project...@googlegroups.com] Namens Brian Skaarup
> Verzonden: 28 July 2010 11:24
> Aan: Project Lombok
> Onderwerp: [project lombok] Is @Getter not supposed to work
> on static fields?
>