summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-12-26 20:01:26 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-12-26 20:01:26 +0000
commit0d3c1f9f58f52355a38c363554f0c05430078bef (patch)
tree8262f821d9bfd7aae34f16a474d677c668eabcc1 /src/main/java
parentdaf5eadcdba26f37a958ed943e6fde06ce645972 (diff)
Display all messages when using test method.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/amazon/carbonado/info/StorableIntrospector.java44
1 files changed, 27 insertions, 17 deletions
diff --git a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
index 5bcce2f..ce3a24e 100644
--- a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
+++ b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
@@ -93,13 +93,20 @@ public class StorableIntrospector {
* exception is thrown.
*
* @param args names of classes to examine
- * @throws MalformedTypeException if Storable type is invalid
*/
public static void main(String[] args) throws Exception {
for (String arg : args) {
Class clazz = Class.forName(arg);
- System.out.println("Examining " + clazz.getName());
- examine(clazz);
+ System.out.println("Examining: " + clazz.getName());
+ try {
+ examine(clazz);
+ System.out.println("Passed");
+ } catch (MalformedTypeException e) {
+ System.out.println("Malformed type: " + e.getMalformedType().getName());
+ for (String message : e.getMessages()) {
+ System.out.println(message);
+ }
+ }
}
}
@@ -694,21 +701,24 @@ public class StorableIntrospector {
// Only include errors on unimplementable methods if there are no other
// errors. This prevents producing errors caused by other errors.
- Iterator<Method> iter = methods.values().iterator();
- while (iter.hasNext()) {
- Method m = iter.next();
- int methodModifiers = m.getModifiers();
- if (Modifier.isAbstract(methodModifiers )) {
- if (!Modifier.isPublic(methodModifiers) && !Modifier.isProtected(methodModifiers))
- {
- errorMessages.add("Abstract method cannot be defined (neither public or " +
- "protected): " + m);
- } else {
- errorMessages.add
- ("Abstract method cannot be defined (not a bean property): " + m);
+ if (errorMessages.size() == 0) {
+ Iterator<Method> iter = methods.values().iterator();
+ while (iter.hasNext()) {
+ Method m = iter.next();
+ int methodModifiers = m.getModifiers();
+ if (Modifier.isAbstract(methodModifiers )) {
+ if (!Modifier.isPublic(methodModifiers) &&
+ !Modifier.isProtected(methodModifiers))
+ {
+ errorMessages.add("Abstract method cannot be defined (neither public or " +
+ "protected): " + m);
+ } else {
+ errorMessages.add
+ ("Abstract method cannot be defined (not a bean property): " + m);
+ }
+ // We've reported the error, nothing more to say about it
+ iter.remove();
}
- // We've reported the error, nothing more to say about it
- iter.remove();
}
}