History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-5899
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Bas Leijdekkers
Reporter: David Beutel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

"never queried" inspection ignoring implicit toString()

Created: 03 May 06 01:55   Updated: 09 May 06 17:47
Component/s: Code Analysis. Inspection
Fix Version/s: Demetra 5281

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: JDK 1.5.0_06 Win XP

Build: 4,192
Fixed in build: 5,267
Severity: Low


 Description  « Hide
The inspection "Contents of collection are updated, but never queried" matches incorrectly on:

private static String foo() {
List bar = new ArrayList();
bar.add("okay");
return "not " + bar;
}

This inspection works if the toString() is explicit, e.g., return "not " + bar.toString();



 All   Comments   Work Log   Change History      Sort Order:
Eugene Vigdorchik - 05 May 06 19:26
The inspection is wrong in the second case,. isn't it?

David Beutel - 05 May 06 22:15
I think it's correct in recognizing bar.toString() as a query on the contents of bar, but incorrect in not recognizing "" + bar as the same query.