我的功能看起来像。
public static double isOverturn(final String reference, final String hypothesis, FieldType fieldType) {
double overturnScore = 1.0;
if (StringUtils.isEmpty(reference) || StringUtils.isEmpty(hypothesis))
return overturnScore;
Method comparisonMethod = null;
try {
comparisonMethod = comparison(fieldType.getName());
overturnScore = (double) comparisonMethod.invoke(null, reference, hypothesis);
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return overturnScore;
}
我想用log. info代替e. printStackTrace. 但它却给我带来了错误。如何在静态方法中使用log.info?