Search code examples
javaeclipsesvnsubclipsesubversive

Subversive makes Eclipse go out of sync?


I switched my Eclipse SVN Plugin from Subclipse to Subversive this week. Subversive seems to be a bit slower than Subclipse, but I like the history, commit dialogs, and label decorations much better in Subversive.

Unfortunately, it looks like I'm going to have to switch back to Subclipse, because Subversive seems to have broken Eclipse. My projects will now sometimes go out "out of sync", most often when I create a new class or execute a Refactor->Rename command. By "out of sync", I mean:

  • Syntax coloring and styling is wrong. In the picture below, "public" isn't entirely red, attributes aren't entirely blue, italics are in the wrong places, etc.
  • Selecting an element/attribute doesn't work properly, as Eclipse thinks you've clicked on something different. In the picture below, I've clicked on the second function, but something very strange is highlighted.
  • Bad: Automatic builds and syntax checks don't work.
  • Very Bad: All IDE functions that add/change/remove code are broken:
    • Trying to refactor a name will either throw an exception or will change the name of a different element.
    • Adding an automatic import will add the import statement in the middle of the class body, erasing whatever chunks of code were unlucky enough to be in the way.
    • God help you if the "Organize imports on save" preference is activated...

A picture is worth a thousand words -Why Eclipse, Why

Interestingly, this problem can be temporarily fixed by adding a change to the messed-up file and saving it. When you do this, however, you have to save twice - after the first save the file is "corrected" but still marked as dirty. This fix is short term, however, as the next changes you make to the file will probably desync it again.

I have no clue what's going on here. Some googling brought me to this link: Eclipse: "Refactor - Rename" completely messed up, replacing arbitrary characters in file. The user in the linked question had a similar issue which was apparently also caused by Subversive. Unfortunately, his solution doesn't work in my workspace.

I've also asked around at work and several coworkers reported encountering this problem on their machines. All of them use Subversive, not Subclipse.

I don't know if StackOverflow is the right place for this or if I should just submit this directly to Eclipse/Subversive as a bug. But maybe someone out there has seen this or something similar and knows a fix or a workaround? Any tips would be greatly appreciated!


Solution

  • After more testing, we were able to determine the following:

    • Any command that involves moving/renaming/deleting files will cause this problem.
    • In a workspace with few projects (<50), this problem doesn't appear.
    • Disabling SVN Caching fixes this problem, but leads to unacceptable performance problems.
    • Uninstalling Subversive and installing Subclipse (into the same workspace, without reinstalling Eclipse) fixes the problem.

    Apparently Subversive is either poorly optimized or has a bug that causes it to break down in large workspaces. I've reported this to the Subversive team as a bug, but until it gets fixed, our new official stance is to recommend all developers to use Subclipse instead of Subversive.

    I'll happily trade down to a slightly worse GUI in exchange for an SVN Plugin that actually works.