Control stable interfaces

It wouldn't surprise me if there's already something in IntelliJ for this: if so, I'd like to know about it; if not, I'd like to suggest it as an idea for a future release.

Some of the interfaces in my code (perhaps literally interfaces, perhaps just method signatures) are supposed to be stable from one release of my product to the next. It would be nice to be able to mark them as such, and get a big ticking-off from the IDE if I attempt to change them inadvertently.

At present IntelliJ does the opposite. If I do a "change signature" refactoring, it helpfully changes all my JUnit test cases for the interface so that they continue to work, and then when I release the code to users it's a big surprise that my own tests worked but the users' code doesn't.

5 comments
Comment actions Permalink

That's an interesting thought. Maybe it would be possible to write a plugin for that, unless there already is one. Something like a lock icon next to the interface/method, which would prevent changing it unless the lock is first unlocked.

0
Comment actions Permalink

I have requested a similar feature a long time ago regarding generated code
projects, because code which is autogenerated somehow also should be treated
read-only.

Tom

0
Comment actions Permalink

You could make the source files of the relevant interfaces read-only. (In IntelliJ IDEA you can toggle the read-only attribute by double clicking in the status bar between the two vertical lines to the right of the cursor position information.) Whenever you try to change a read-only file a dialog will pop up.

Bas

0
Comment actions Permalink

Now that's an awfully well hidden feature. There is no indication that clicking there would do something - learnability is zero. There should be some sort of a toggle button or other graphical hint that you can lock the document there.

Now that I do some clicking on the status bar, there seems to be many other things also which have zero visibility (changing file encoding, opening Incoming Changes tab, opening JetConnect, Go To Line). Also the other things need to be visualized to look more clickable (highlighting level, errors profile). The visualization of the status bar should be redesigned to make these more visible.

The background tasks visualization when some tasks are running is ok. GC button is also quite ok.

0
Comment actions Permalink

Michael,


It wouldn't surprise me if there's already something in IntelliJ for this: if so, I'd like to know about it; ...


I was just going one-by-one through the Plug-ins in the Available list in IDEA 8.0 and found this, which made me think of your request:

- CodeLock (version 1.1)
-- "Allows locking of classes, methods and regions of code to protect improtant parts of the code from accidental change"

I don't know if it's compatible with IDEA 8 (or anyting else about it). The sentence above (including the typo) is the only thing in the display for this plug-in.


Randall Schulz

0

Please sign in to leave a comment.