Skip to content

Commit

Permalink
In @component use void.class to mark default
Browse files Browse the repository at this point in the history
The Component class itself was used to mark the default value (as null
is not allowed). "void.class" seems to be a little bit more correct, as
it means that it does, the default is nothing.
  • Loading branch information
a-peyrard committed Feb 11, 2015
1 parent affa904 commit b55740d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions restx-factory/src/main/java/restx/factory/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/**
* @return the class to use for the name of this component,
* if not defined the annotated class will be used
* if not defined, the annotated class will be used
*/
Class<?> asClass() default Component.class; // trick to mark default value, as null is not permitted
Class<?> asClass() default void.class; // trick to mark default value, as null is not permitted
}
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ private void processComponents(RoundEnvironment roundEnv) throws IOException {
} catch (MirroredTypeException mte) {
asClass = asTypeElement(mte.getTypeMirror());
}
if (asClass.getQualifiedName().toString().equals(Component.class.getName())) {
if (asClass == null) {
// no class as been forced, so use the annotated class
asClass = component;
}
Expand Down

0 comments on commit b55740d

Please sign in to comment.