From 20b398cdef84acd33f817d2f529139073f2771b3 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 3 Jan 2019 09:16:15 +0000 Subject: [PATCH] JAL-1889 ignore 'synthetic' fields added for jacoco --- test/jalview/viewmodel/styles/ViewStyleTest.java | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/test/jalview/viewmodel/styles/ViewStyleTest.java b/test/jalview/viewmodel/styles/ViewStyleTest.java index bc74d8a..7deb2b0 100644 --- a/test/jalview/viewmodel/styles/ViewStyleTest.java +++ b/test/jalview/viewmodel/styles/ViewStyleTest.java @@ -100,24 +100,23 @@ public class ViewStyleTest private boolean copyConstructorIgnores(Field field) { /* - * just instrumentation added by test coverage while testing + * ignore instrumentation added by jacoco for test coverage */ - String type = field.getClass().toString(); - if (type.toString().contains("com_atlassian_clover")) + if (field.isSynthetic()) { - // instrumentation added for test coverage - ignore return true; } + return false; } - + /** - * Change the value of one field in a ViewStyle object - * - * @param vs - * @param field - * @throws IllegalAccessException - */ + * Change the value of one field in a ViewStyle object + * + * @param vs + * @param field + * @throws IllegalAccessException + */ protected void changeValue(ViewStyle vs, Field field) throws IllegalAccessException { -- 1.7.10.2