Remove unused/incorrect logic from JsInteropRestrictionsChecker.
@@ -2022,10 +2022,8 @@ public class JsInteropRestrictionsChecker {
if (member.isMethod()) {
Method method = (Method) member;
- MethodDescriptor methodDescriptor = method.getDescriptor();
- warnIfUnusableByJs(methodDescriptor, "Method", member);
- TypeDescriptor returnTypeDescriptor = methodDescriptor.getReturnTypeDescriptor();
+ TypeDescriptor returnTypeDescriptor = method.getDescriptor().getReturnTypeDescriptor();
warnIfUnusableByJs(returnTypeDescriptor, "Return type of", member);
Variable varargsParameter = method.getJsVarargsParameter();
@@ -2069,14 +2067,6 @@ public class JsInteropRestrictionsChecker {
warnUnusableByJs(prefix, member);
}
- private void warnIfUnusableByJs(MemberDescriptor memberDescriptor, String prefix, Member member) {
- if (memberDescriptor.canBeReferencedExternally()) {
- return;
- }
-
- warnUnusableByJs(prefix, member);
- }
-
private void warnUnusableByJs(String prefix, Member member) {
// TODO(b/36362935): consider [unusable-by-js] (suppressible) errors instead of warnings.
problems.warning(
