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

Key: IDEABKL-4414
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Unassigned
Reporter: Alex Tkachman
Votes: 1
Watchers: 3
Available Workflow Actions

Mark as Stalled
Operations

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

@Const annotation

Created: 29 Nov 05 13:04   Updated: 09 Nov 06 20:30
Component/s: Code Analysis. Dependencies
Affects Version/s: None
Fix Version/s: None

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

Build: 3,542
Severity: Medium


 Description  « Hide
It would be great to have annotation @Const for methods and parameters which has semantic "no side effect".

 All   Comments   Work Log   Change History      Sort Order:
Keith Lea - 29 Nov 05 19:01
We would probably then want @ExternallyMutable for classes and @Mutating for methods as well, so the dataflow engine in IDEA can have an idea of the state of an object. We could then add inspections like:
  • const method called within loop
  • const method called more than once in a method

Also, refactorings like "introduce variable" could automatically check the "replace all occurrences" box if the variable is a method call to a const method.


Eugene Vigdorchik - 30 Nov 05 13:22
I used to be enthusiastic about this as well. Until I tried to formalize the idea of "no side effect"

Dirk Dittert - 19 Dec 05 18:23
How about a less sophisticated code analysis: IDEA-6193?