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

Key: IDEA-17128
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Assignee: Unassigned
Reporter: Stephen Friedrich
Votes: 0
Watchers: 0
Operations

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

"Introduce variable" must be introduced in front of any "//noinspection" comment

Created: 12 Feb 08 22:43   Updated: Tuesday 21:43
Component/s: Project View, Refactoring

Build: 7,693


 Description  « Hide
Before refactoring code is green:
//noinspection unchecked
        List<Category> categories = (List<Category>) entityManager.createQuery("SELECT c FROM Category c ORDER BY c.name DESC")
                .getResultList();

After introducing a variable code is yellow:

//noinspection unchecked
        String queryText = "SELECT c FROM Category c ORDER BY c.name DESC";
        List<Category> categories = (List<Category>) entityManager.createQuery(queryText)
                .getResultList();

Expected result:

String queryText = "SELECT c FROM Category c ORDER BY c.name DESC";
        //noinspection unchecked
        List<Category> categories = (List<Category>) entityManager.createQuery(queryText)
                .getResultList();


 All   Comments   Work Log   Change History      Sort Order:
Dmitry Jemerov - 13 May 08 21:43
It's impossible to guess in the general case whether the suppression applies to the extracted or to the remaining code. For example, if the suppression was for the hard-coded string literal inspection, you would need to keep it before the introduced variable in order to keep the code green.