You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Tomáš Procházka (Jira)" <ji...@apache.org> on 2019/11/19 21:34:00 UTC
[jira] [Commented] (NETBEANS-3414) Method not marked as unused
[ https://issues.apache.org/jira/browse/NETBEANS-3414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16977845#comment-16977845 ]
Tomáš Procházka commented on NETBEANS-3414:
-------------------------------------------
Problem seems to be around this line: [https://github.com/apache/netbeans/blob/aab31ed40d6e7a4da99608b5ef010b64fbb4d012/php/php.editor/src/org/netbeans/modules/php/editor/csl/SemanticAnalysis.java#L515]
Invoked method is compared only by its name, class where the method belongs is not considered (or current class is used).
> Method not marked as unused
> ---------------------------
>
> Key: NETBEANS-3414
> URL: https://issues.apache.org/jira/browse/NETBEANS-3414
> Project: NetBeans
> Issue Type: Bug
> Components: php - Code Analysis, php - Editor
> Affects Versions: 11.2
> Reporter: Tomáš Procházka
> Priority: Minor
>
> Private method in class is not marked as unused when method with same name is used in class.
> Example:
> {code:java}
> class Car {
> public function isEmpty(): bool {
> }
> }
> class Garage {
> /** @var Car */
> private $car;
> public function isCarEmpty(): bool {
> return $this->car->isEmpty(); // Comment this line and self::isEmpty() is marked as unused.
> }
> private function isEmpty(): bool {
> }
> }
> {code}
> Method Garage::isEmpty() is not used, but is not marked as unused.
> After commenting/deleting content of method Garage::isCarEmpty() is method Garage::isEmpty() marked as unused.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists