Fix annotation mapper to map annotations on methods. Also fix lookup by constant classname. Theres more fields that i thought that aren't mapped, 4

This commit is contained in:
Adam
2016-03-27 18:43:41 -04:00
parent d93317f662
commit afcb4a1c36

View File

@@ -32,10 +32,13 @@ public class AnnotationMapper
for (ClassFile c : source.getClasses()) for (ClassFile c : source.getClasses())
{ {
ClassFile other = target.findClass(c.getName()); ClassFile other = (ClassFile) mapping.get(c);
if (other == null) if (other == null)
{
System.out.println("Unable to map class " + c); // XXX if this has any mappings it won't be reported below.
continue; continue;
}
count += run(c, other); count += run(c, other);
} }
@@ -57,13 +60,15 @@ public class AnnotationMapper
Field other = (Field) mapping.get(f); Field other = (Field) mapping.get(f);
if (other == null) if (other == null)
{ {
assert false; System.out.println("UNABLE TO MAP " + f);
continue;
//assert false;
} }
count += copyAnnotations(f.getAttributes(), other.getAttributes()); count += copyAnnotations(f.getAttributes(), other.getAttributes());
} }
for (Method m : to.getMethods().getMethods()) for (Method m : from.getMethods().getMethods())
{ {
if (!hasCopyableAnnotation(m.getAttributes())) if (!hasCopyableAnnotation(m.getAttributes()))
continue; continue;
@@ -71,7 +76,9 @@ public class AnnotationMapper
Method other = (Method) mapping.get(m); Method other = (Method) mapping.get(m);
if (other == null) if (other == null)
{ {
assert false; System.out.println("UNABLE TO MAP " + m);
continue;
//assert false;
} }
count += copyAnnotations(m.getAttributes(), other.getAttributes()); count += copyAnnotations(m.getAttributes(), other.getAttributes());