I don't know why, but the JLS is very clear.
I don't know why, but the JLS is very clear: Discussion Note that null is not a legal element value for any element type. And the definition of a default element is: DefaultValue: default ElementValue Unfortunately I keep finding that the new language features (Enums and now Annotations) have very unhelpful compiler error messages when you don't meet the language spec. EDIT: A little googleing found the following in the JSR-308, where they argue for allowing nulls in this situation: We note some possible objections to the proposal.
The proposal doesn't make anything possible that was not possible before. The programmer-defined special value provides better documentation than null, which might mean “none� , “uninitialized�
, null itself, etc. The proposal is more error-prone.It's much easier to forget checking against null than to forget checking for an explicit value. The proposal may make the standard idiom more verbose. Currently only the users of an annotation need to check for its special values.
With the proposal, many tools that process annotations will have to check whether a field's value is null lest they throw a null pointer exception. I think only the last two points are relevant to "why not do it in the first place. " The last point certainly brings up a good point - an annotation processor never has to be concerned that they will get a null on an annotation value.
I tend to see that as more the job of annotation processors and other such framework code to have to do that kind of check to make the developers code clearer rather than the other way around, but it would certainly make it hard to justify changing it.
It would seem this is illegal, although the JLS is very fuzzy on this. I wracked my memory to try and think of an existing annotation out there that had a Class attribute to an annotation, and remembered this one from the JAXB API: @Retention(RUNTIME) @Target({PACKAGE,FIELD,METHOD,TYPE,PARAMETER}) public @interface XmlJavaTypeAdapter { Class type() default DEFAULT. Class; static final class DEFAULT {} } You can see how they've had to define a dummy static class to hold the equivalent of a null.Unpleasant.
Yes, we do something similar (we just use Foo. Class as the default). Sucks.
– ripper234 Jul 24 '09 at 14:52.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.