mirror of
https://github.com/github/codeql.git
synced 2026-04-24 08:15:14 +02:00
Update for feedback
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @name Local variable is initialized but not used
|
||||
* @description Assigning a value to a local variable that is not used may indicate an error in the code.
|
||||
* @description A local variable that is initialized but not subsequently used may indicate an error in the code.
|
||||
* @kind problem
|
||||
* @problem.severity recommendation
|
||||
* @precision low
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @name Unused local variable
|
||||
* @description Assigning a value to a local variable that is not used may indicate incomplete code.
|
||||
* @description A local variable that is not initialized, assigned, or read may indicate incomplete code.
|
||||
* @kind problem
|
||||
* @problem.severity recommendation
|
||||
* @precision low
|
||||
|
||||
@@ -7,7 +7,7 @@ class InexactVarArg
|
||||
public static void main(String[] args) {
|
||||
String[] words = { "apple", "banana", "cherry" };
|
||||
String[][] lists = { words, words };
|
||||
length(words); // wrong: Argument does not clarify
|
||||
length(words); // avoid: Argument does not clarify
|
||||
length(lists); // which parameter type is used.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ versions of Eclipse, the output may be:</p>
|
||||
|
||||
<sample src="InexactVarArg.java" />
|
||||
|
||||
<p>To remove this dependency on the compiler, <code>length(words)</code> should be replaced by either of the following:</p>
|
||||
<p>To avoid this compiler-dependent behavior, <code>length(words)</code> should be replaced by either of the following:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>length((Object) words)</code></li>
|
||||
|
||||
Reference in New Issue
Block a user