GoogleCloudPlatform / GoogleCloudPlatform/cloud-opensource-java

Potential false negatives on protected methods referenced from child class

Ouverte
#2,184 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
p3
Langage dominant
Java
Étoiles
163
Forks
80
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

https://github.com/GoogleCloudPlatform/cloud-opensource-java/pull/2183#discussion_r688009905 found an interesting case where Linkage Checker cannot report linkage errors for protected methods that are referenced from a child class. For example, the code below shows red for compilation error but Linkage Checker would not detect it if the relationship is in a class files.

Screen Shot 2021-08-12 at 16 18 25

This implies that when
- a method in a library is changing its accessor from public to protected, and
- the caller and callee has child-parent class relationship

Linkage Checker would fail to report the linkage errors. It considers that a protected method is ok to be accessed by child classes.

I'm not sure how to fix it but I think it's worth document here.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.