Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

better validation, #38.

  • Loading branch information...
commit fe1f8d8619ef753355289716d8b6fcd5f5970922 1 parent 15d267c
@junkdog authored
View
1  .gitignore
@@ -10,4 +10,5 @@ target/
.classpath
.project
.settings/
+.factorypath
View
11 artemis-validator/src/main/java/com/artemis/ComponentValidatorProcessor.java
@@ -9,7 +9,6 @@
import static javax.lang.model.util.ElementFilter.fieldsIn;
import static javax.lang.model.util.ElementFilter.typesIn;
import static javax.tools.Diagnostic.Kind.ERROR;
-import static javax.tools.Diagnostic.Kind.MANDATORY_WARNING;
import java.util.HashSet;
import java.util.Set;
@@ -69,7 +68,7 @@ private void ensureAllFieldsAreOfSameType(TypeElement type) {
if (types.size() > 1) {
Messager messager = processingEnv.getMessager();
- messager.printMessage(ERROR, "All fields must be of same type, found: " + types);
+ messager.printMessage(ERROR, "All fields must be of same type, found: " + types, type);
}
}
@@ -110,7 +109,6 @@ private void ensureAllInstanceFieldsArePrivate(TypeElement component) {
private void pooledComponentCheck(TypeElement component) {
ensureZeroArgConstructor(component);
ensureNoFinalInstanceFields(component);
- checkIfPooledCanBePacked(component);
}
@Override
@@ -118,13 +116,6 @@ public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latestSupported();
}
- private void checkIfPooledCanBePacked(TypeElement component) {
- if (fieldsIn(component.getEnclosedElements()).isEmpty()) {
- Messager messager = processingEnv.getMessager();
- messager.printMessage(MANDATORY_WARNING, "Component can safely be converted to PackedComponent.", component);
- }
- }
-
private void ensureZeroArgConstructor(TypeElement component) {
for (ExecutableElement constructor : constructorsIn(component.getEnclosedElements())) {
if (constructor.getParameters().isEmpty())
Please sign in to comment.
Something went wrong with that request. Please try again.