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

Key: IDEADEV-11526
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Maxim Mossienko
Reporter: Niels Ull Harremoës
Votes: 0
Watchers: 0
Operations

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

Allow search for constants in structural search

Created: 12 Oct 05 21:19   Updated: 06 Nov 08 13:03
Component/s: Structural Search and Replace
Fix Version/s: Diana 8.0.1

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 3,461
Fixed in build: 9,010
Severity: Low


 Description  « Hide
We'd like to search for compile time constants and constant expressions - Strings and primitive values. As far as I can tell, this is not possible?

The motivation is that we have found several occurences of Integer.parseInt("0"), String.valueOf(SOMECONSTANT)
and
stringBuffer.append("select ");
stringBuffer.append(USER_COLUMNNAME);
stringBuffer.append(" from ");
stringBuffer.append(TABLENAME);

We'd like to find all of them.

A long term solution would be to have inspections, but in the short term, we would just like to be able to search and replace for ourselves. But we can only search for Integer.parseInt("$str$") and will not find e.g. Integer.parseInt(MYCONSTANT+"0").
Or we can search/replace for
$stringBuffer$.append("$str1"); $stringBuffer$.append($CONSTANT$)
with
$stringBuffer$.append("$str1"+$CONSTANT$)

  • but that depends on naming conventions, and it will not be able to recurse to turn the larger sample into
    stringBuffer.append("select "USER_COLUMNNAME" from "+TABLENAME);


 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.