Skip to content

Commit

Permalink
Bridge methods are methods introduced by compilers in relation to met…
Browse files Browse the repository at this point in the history
…hods that use generics. Various renderer related method trigger test methods for just bridge methods, but are never really implemented.

For example, the below interface code causes the coverage test before
this patch to expect the bridge generate(IChemObject object, RendererModel model)
method to be tested:

public interface IGenerator<T extends IChemObject>  {
  public IRenderingElement generate(T object, RendererModel model);
}

This fix now skips these bridge methods from coverage testing.

(Thanx to Arvid Berg for pointing me to the Method.isBridge() method!)
  • Loading branch information
egonw committed Mar 22, 2012
1 parent b56e08b commit 32d58d6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ private int checkClass(String className) {
// we're going to skip private.
Method[] sourceMethods = coreClass.getDeclaredMethods();
for (Method method : sourceMethods) {
int modifiers = method.getModifiers();
if (method.isBridge()) continue;

int modifiers = method.getModifiers();
if (Modifier.isPrivate(modifiers)) continue;

TestMethod testMethodAnnotation = method.getAnnotation(TestMethod.class);
Expand Down

0 comments on commit 32d58d6

Please sign in to comment.