}
private void checkMethodRef(ReferenceBinding clazz, JsniRef jsniRef,
Set<String> errors, Map<String, Set<String>> warnings) {
assert jsniRef.isMethod();
MethodBinding target = getMethod(clazz, jsniRef);
if (target == null) {
return;
}
if (containsLong(target.returnType)) {
errors.add("Referencing method '" + jsniRef.className() + "."
+ jsniRef.memberName() + "': return type '"
+ typeString(target.returnType)
+ "' is not safe to access in JSNI code");
}
if (target.parameters != null) {
int i = 0;
for (TypeBinding paramType : target.parameters) {
++i;
if (containsLong(paramType)) {
// It would be nice to print the parameter name, but how to find it?
errors.add("Parameter " + i + " of method '" + jsniRef.className()
+ "." + jsniRef.memberName() + "': type '"
+ typeString(paramType)
+ "' may not be passed out of JSNI code");
}
}
}
if (target.isDeprecated()) {
add(warnings, "deprecation", "Referencing deprecated method '"
+ jsniRef.className() + "." + jsniRef.memberName() + "'");
}
}