|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
[ checkstyle-Bugs-1519397 ] UnusedImport erroneously reporting static import as unusedBugs item #1519397, was opened at 2006-07-09 11:38
Message generated for change (Comment added) made by andrew64 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1519397&group_id=29721 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Framework Group: release 4.1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Paul Holser (pholser) Assigned to: Nobody/Anonymous (nobody) Summary: UnusedImport erroneously reporting static import as unused Initial Comment: The attached source file, when run through Checkstyle 4.1 with the attached config file, yields the following error: HashingContainer.java:9:15: Unused import - jaggregate.Pair.pair. even though the imported method is used on line 182. ---------------------------------------------------------------------- Comment By: Andrew S. (andrew64) Date: 2009-09-23 15:49 Message: I can't see how to attach a file to an issue, so here's the code in question (hope it's not munged or suppressed): import static java.lang.String.format; // correctly not flagged as unused import static java.lang.String.valueOf; // incorrectly flagged as unused /** * @author andrews * */ public class UnusedImportBug { /** * Declaring this *before* the static method call results in an unused import. */ int valueOf; { format(""); valueOf(1); } /** * ... but declaring *after* the static method call does not. */ int format; } ---------------------------------------------------------------------- Comment By: Andrew S. (andrew64) Date: 2009-09-23 15:45 Message: I'm attaching some much briefer and simpler code that demonstrates this bug (or one very like it). The bug occurs when a member variable with the same name as a statically imported method is declared before that method is invoked (but not if declared afterwards). @pholser: when providing sample code, it's more useful to the maintainer (and others trying to solve or replicate the bug) if: 1. you trim the code down to the minimum required to replicate the bug 2. there are no dependencies on any special libraries like Jaggregate ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1519397&group_id=29721 ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Checkstyle-devel mailing list Checkstyle-devel@... https://lists.sourceforge.net/lists/listinfo/checkstyle-devel |
| Free embeddable forum powered by Nabble | Forum Help |