Hi All,
I use reflection in code as follow:
public static void setFormFieldsToRequest(Object vo,
HttpServletRequest request) throws Exception {
Field[] fields = vo.getClass().getDeclaredFields();
Field fie = null;
for (int i = 0; i < fields.length; i++) {
fie = fields[i];
if (fie.getName().equals("serialVersionUID"))
continue;
else {
Object fvalue = getFieldValue(fie, vo);
request.setAttribute(fie.getName(), fvalue);
}
}
}
It throwed the follow exception:
at Caused by: java.lang.Exception: can't process the type: class [Z
at com.test.web.ap.action.APActionUtil.getFieldValue(APActionUtil.java:301)
at
com.test.web.ap.action.APActionUtil.setFormFieldsToRequest(APActionUtil.java:240)
at
I viewed the section about reflection on FAQ page.
It may cause to get incorrect coverage if use reflection in code. But the
application fails to run now.
I know that it can exclude some packages by using the key word
'exclude='com.test.web.*'',
but if I have many those codes in different packages which may lead to
miscellaneous conf.
I want to exclude those codes that use reflection simply, any suggestion ?
Thanks.
--
You received this message because you are subscribed to the Google Groups
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/92643cf7-e760-48b5-8860-97b4da69007c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.