} else {
field = JavaIntrospectionHelper.findClosestMatchingField(refName, refClass, fields);
if (field == null) {
// hack for TUSCANY-300
for (Field current : fields) {
Reference annot = current.getAnnotation(Reference.class);
if (annot != null) {
if (refName.equals(annot.name())) {
field = current;
break;
}
}
}
if (field == null) {
method = JavaIntrospectionHelper.findClosestMatchingMethod(refName, new Class[]{refClass}, methods);
if(method == null){
// Fix for Tuscany-325
method = JavaIntrospectionHelper.findClosestMatchingMethod("set"+refName.substring(0,1).toUpperCase()+ refName.substring(1), new Class[]{refClass}, methods);
}
if (method == null) {
// hack for TUSCANY-300
for (Method current : methods) {
Reference annot = current.getAnnotation(Reference.class);
if (annot != null) {
if (refName.equals(annot.name())) {
method = current;
break;
}
}
}