Testing booleans readably in Java

This surely is not the first or last musing on how to write ifs with boolean variables in Java. I normally just write it as IDEA suggests with its “simplify” correction (inspection is called “Pointless boolean expression”). However I never criticized anyone yet for their style of comparing the boolean variable to the literal true or false. I do some code review that is a part of my role in the team and while I communicate most of my observations this I just quick fix with IDEA and go on. “Whatever your taste is, my word is the final word anyway.”

But this Friday one of the developers came back to me and said “hey, I do it so it is more readable”. And readable is the word I hear to pretty strong. I have no problem to read both these styles and I prefer the minimal one. While I’m clearly decided about comparing to true (utter waste and nicely exaggerated here), comparing to false is indeed a bit different. There you can argue that that exclamation is not always so visible.

It’s not always as easy as “short is better” – often on the contrary. Prominent example being the assignment in the middle of the expression – in a ternary expression for instance. I’d go for ifs and an assignment per line all the time. But while here we are mostly aligned when it comes to (checked == false) versus (!checked) we developers are not so unanimous.

The aforementioned link to stackoverflow inspired me to check how various cases are compiled. I made a class:

public class BooleanEqualityTest {
   boolean bb;

   private void a() {
       boolean b = bb;
   }
   private void b() {
       boolean b = bb == true;
   }
   private void c() {
       boolean b = (bb == true) == true;
   }
   private void x() {
       boolean b = !bb;
   }
   private void y() {
       boolean b = bb == false;
   }
   private void z() {
       boolean b = bb == false == false;
   }
}

After compile I went to the output directory and ran the command:

javap -private -c BooleanEqualityTest

And the result was:

Compiled from "BooleanEqualityTest.java"
public class BooleanEqualityTest extends java.lang.Object{
boolean bb;

public BooleanEqualityTest();
 Code:
  0:    aload_0
  1:    invokespecial    #1; //Method java/lang/Object."<init>":()V
  4:    return

private void a();
 Code:
  0:    aload_0
  1:    getfield    #2; //Field bb:Z
  4:    istore_1
  5:    return

private void b();
 Code:
  0:    aload_0
  1:    getfield    #2; //Field bb:Z
  4:    iconst_1
  5:    if_icmpne    12
  8:    iconst_1
  9:    goto    13
  12:    iconst_0
  13:    istore_1
  14:    return

private void c();
 Code:
  0:    aload_0
  1:    getfield    #2; //Field bb:Z
  4:    iconst_1
  5:    if_icmpne    12
  8:    iconst_1
  9:    goto    13
  12:    iconst_0
  13:    iconst_1
  14:    if_icmpne    21
  17:    iconst_1
  18:    goto    22
  21:    iconst_0
  22:    istore_1
  23:    return

private void x();
 Code:
  0:    aload_0
  1:    getfield    #2; //Field bb:Z
  4:    ifne    11
  7:    iconst_1
  8:    goto    12
  11:    iconst_0
  12:    istore_1
  13:    return

private void y();
 Code:
  0:    aload_0
  1:    getfield    #2; //Field bb:Z
  4:    ifne    11
  7:    iconst_1
  8:    goto    12
  11:    iconst_0
  12:    istore_1
  13:    return

private void z();
 Code:
  0:    aload_0
  1:    getfield    #2; //Field bb:Z
  4:    ifne    11
  7:    iconst_1
  8:    goto    12
  11:    iconst_0
  12:    ifne    19
  15:    iconst_1
  16:    goto    20
  19:    iconst_0
  20:    istore_1
  21:    return

}

What does it mean? Every == true is adding something to the code, but the first == false produces the same bytecode as the not operator itself (!). Every other == false is then adding to the code just like any other comparison. While HotSpot may do wonders with the code later I still consider it a waste and completely unnecessary – except for the single == false – and that was the case where I hesitated just a bit.

Now I will probably stop correcting this case, though I will keep writing !checked instead of checked == false. The only thing I don’t like about it all right now is that the inspection in IDEA cannot be set to ignore just this case. I can still set it to weak-warning, but that’s just not the same, you know. 🙂

What is your opinion on this matter? Do you have similar cases where you’re just not convinced which way is the cleaner one?

Update 31.10.2011: I decided after all. I’ll go for !(…) like this:

if (!(checked)) ...

This is quite clear, ! is nicely visible and redundant parentheses are not warning. After all, parentheses are traditionally used to make expressions readable. 🙂

From IntelliJ IDEA to Eclipse (5)

It has been some time since I wrote last installment of this series – and much happened in the meantime. IDEA 10.5 was released (with full support of JDK 7) – and the whole beast is again a bit faster and better – though not without bugs. I’ll probably write a dedicated monologue about things I don’t like in IDEA and why. Then, very recently, Eclipse Indigo was released as well (without Java SE 7 language level support, not that it is make/break feature). One thing I’m very interested in about it is Xtext 2.0, which now seems to be the most driven DSL solution if you want to write text based grammars, models, whatever. (Aside from Xtext, I’m even more interested in MPS by JetBrains, but MPS as of now is a bit rugged if you expect the same fluency as with IDEA.)

This gives me opportunity to recheck some features I collected in previous months and haven’t published yet, though I don’t expect some big improvements in Eclipse core features (not sure why, but when I think about it like this, big blue logo always appears somewhere in my mind – I’m not sure how much IBM is to be blamed, really).

One big thing I don’t like about Eclipse is SVN integration – and I honestly don’t know how can anyone compare and criticize SVN in IDEA. While I don’t know about Synchronization feature in IDEA, truth is I never needed it! IDEA’s workflow is more in line with SVN – especially when it comes to adding files to the repository (before you actually commit them).

Another and probably more important thing is merging. In IDEA I’ve never been afraid of version conflicts – at least not technically. Conflict should be about decision making, but with Eclipse it’s a real nightmare instead. Most Eclipse users don’t know what 3-way diff is, there is no way how I can see my version, after-merge version (the result) and incoming version on one screen. This way you can always compare your code with the resulting code, you can move changes from your code to the result, etc. In Eclipse you can only change your code directly – and hardly see the differences in the end. I often close Eclipse and start Idea on the same project just to resolve conflicts and do commits.

Also files that can be merged perfectly are reported as in-conflict, because two (or more) people were working on them – this is ridiculous! Eclipse is confusing reporting conflicts, it’s also confusing about files added locally to repository. You have little control over it as new file is again and again suggested as an outgoing change (so you are forced to use SVN ignore, information that is stored in repository, to solve Eclipse’s own problems) – instead of you being in control and deciding whether the file is in revision control or not. You can add it, but there is no difference.

Let’s compare some refactorings, completion and shortcuts again!

You can easily do basic refactorings on classes in IDEA – shortcuts are familiar from Norton/TotalCommander (F5 copy, Shift+F5 clone, F6 move, Shift+F6 rename). This works consistently whether you are in editor with cursor on the class name or in the project tree. In Eclipse you have to go to the project tree and do it there. Clone/copy is Ctrl+C and Ctrl+V, not sure if that is refactoring. 🙂 F2 in Eclipse works in project tree, on the class name in the editor you have to use Alt+Shift+R.

Ctrl+Space is the same, but in Eclipse many other features are bound to the same “completion” functionality while in IDEA you have the following: Ctrl+O (override), Ctrl+I (implements), Alt+Insert (toString, setters/getters – but if you want more than just one of them use Alt+S, R in Eclipse rather than Ctrl+Space – or bind it to your key somehow) – and of course also IDEA’s smart completion Ctrl+Shift+Space. Here – while it may seem stupid to have so many keys in IDEA for every different thing I never had problem with that (because you always know what to do). Also the lists are more focused for various functions while in Eclipse it’s all in one list. The rest is probably just the matter of taste. However, smart completion (Ctrl+Shift+Space) from Idea works much better for me than Eclipse’s all-embracing completion. Not to mention Eclipse doesn’t offer enum value completion in method parameters or equals as IDEA naturally does.

Class name completion in non-java files – IDEA is far superior compared to virtually no completion in (for instance) XML files in Eclipse (may vary in Java EE version).

God/Devil is in the details when it comes to how to accept the completion. In Idea you can press Tab or Enter. The difference is when you “overwrite” some existing code, identifier, value, whatever. Tab is natural for us, Idea crowd, and it replaces the previous stuff. I made the test, check this animated GIF – funny that Enter behavior differs with and without smart completion (Ctrl+Space vs. Ctrl+Shift+Space) – but as it’s mostly not what you want, it doesn’t really matter, right? Eclipse behavior is different when finishing enum and the class (animated GIF, in 3rd case it does what it should, ignore the syntax error) – to simplify things one can say that Ctrl+Enter is always what you want (probably). Many users may not know about the difference or haven’t thought about it, but it indeed is a difference. Here “know your IDE” is the most important thing – then you can get what you want quickly in both.

Eclipse’s Ctrl+Space has one additional feature – when you press it repeatedly it cycles through a few filtered views (Template Proposals, SWT Template Proposals, JPA Proposals) – this can be further customized in Preferences/Java/Editor/Content Assist/Advanced.

Finally – here are two IDEA-positive resources – about IDEA knowing what you want (there are more articles in the same month) and one quite an active blog.

Don’t miss other posts on this topic:
Eclipse vs IntelliJ IDEA
From IntelliJ IDEA to Eclipse (2)
Why to synchronize with SVN in Eclipse?
From IntelliJ IDEA to Eclipse (3)
From IntelliJ IDEA to Eclipse (4)

Skimming the world of UML tools

This is just another “skimming” and it will not be objective nor in depth. I needed to draw a few UML pictures and I prefer having some model behind. I honestly believe that tools should be easy, intuitive and just working. I remember how I liked IntelliJ IDEA right from the start (not that it is flawless or without learning curve!).

What I want – some class diagram to model my entities (ER diagram will be done in Oracle SQL Developer Data Modeler, that is set in our team), some enums, state machines for enums (some of them are state values) and some sequence diagram here and there. Nothing big, nothing MDD.

In our company we use IBM Rational Software Modeler 7.5.4. I can’t say how it looks in newer versions, but this one is just killing me with it’s “hey! I’m built on Eclipse platform!” approach. I created model for instance, and I went for some design template that I felt is best for me. Alas, the template didn’t have state machine diagram. Can you add it somehow? I don’t know, there is no obvious way? Can you google how? I don’t know, it seems that IBM/Rational did the best job in anti-SEO. Their documentation is most difficult to find with search engines, and kinda… IBMish. I created new model without template and copied my old model into that one – what a fix. Even if there is way how to add diagram that is not in template (there always should be!) or how to convert model to another template – these functions are not easy to find. That’s like they are not there.

And the UI itself – it’s massive click-fest with minimum keyboard shortcuts (how I love IDEA, because it always tells you in pop-up menus what the shortcut is). Results are quite OK, if you know how to export them. Default export dialog is just another Eclipse-style hell, the same goes for import, you know one expects import where you just specify the file and it’s imported, but in Rational it’s always difficult – you have to know dozen of steps to do before the actual import. Eclipse based software traditionally has very poor consistency between contextual menus. You have File, Save As Image File… on right click in the diagram itself, but you don’t have it when you right click the diagram node in Project Explorer, nor you have it in main menu in any expected place. I honestly admire bravery of all those working with this tool.

I tried some other free: ArgoUML (limited UML 2 and undo support, plus I just didn’t like it), StarUML (not in development anymore… since 2005) and finally astah* community. Astah is probably my favourite choice from those freely available, though its community version has some serious limitations (enums are just ugly if you don’t use professional edition). But it’s much more intuitive than Rational, workflow is much better (well, there is hardly any “flow” in Rational, really) and I will probably use it in my future works.

Then there is one option for non-commercial usage (which means no option for me) – Visual Paradigm, or rather their VP for UML. Their suite (5.2) contains UML modeller (8.2) that is quite usable for drawing, but you’ll suffer quite aggressive watermark if you create more than one diagram per type. This actually means I’d not use it for non-commercial project either – unless I don’t need image outputs (which I mostly want to have). But the price for modeler edition is quite reasonable ($99) and in overall work with VP for UML was OK. By default their diagrams have rather simple visuals (no gradients so popular today), but they look clean on paper and – the most important – there are enough features that are easy to use (with keyboard shortcuts too :-)).

And finally, tool I like most of them – Enterprise Architect. Here I have to say that I worked with this tool. I never liked drawing diagrams (mostly because of the tools itself), but this one makes it quite easy. You have to get used to it’s dialog window workflow, but everything is accessible and resulting diagrams are just nice and clean. Desktop Edition starts at $135 and I think it’s well worth it.

One thing I particularly liked about EA is that it allowed me to bind associations to attributes, so you could see both lines (associations) and attributes in the class. I like attributes as a kind of checklist, without need to go around the box and search for associations – and I don’t care if it’s UMLish or not. EA allows this and I just love it.

One thing I couldn’t model as I’d wish to – I have enum and I want its literals to be states in state machine diagram. I don’t know how to do this in any of these tools. Right now I have to repeat myself and add states with the same names as literals in the enum.

After all this, my winners are astah* for being free and EA if one is willing to spend $135. I think for companies it’s definitely much better investment than Rational if you care for sanity of your staff.

I can’t tell how these tools work for more developers, how easy is to keep their project files in SVN, or how you like them after a year or two – or which one causes the most serious RSI. That’s why it’s called skimming after all. 🙂

From IntelliJ IDEA to Eclipse (4)

Today I’ll try to focus on key shortcuts more. And also the way you can customize them. In all cases when comparing shortcuts, the first one mentioned is Idea’s, the second is from Eclipse.

While Idea has static Default Keymap Reference in its Help menu, Eclipse has Key Assist (Ctrl+Shift+L) – which is more handy if you don’t know what you’re looking for (name of the features are not always the same between both products). Idea’s Search Action (Ctrl+Shift+A) can compensate for this. Talking about Help menu – you can check some JetBrains TV videos about IDEA to get better idea how to be productive or just for some tips.

There is Idea keymap for Eclipse (plugin), but I wasn’t satisfied with it’s completeness, plus I wasn’t happy with Idea shortcut acting the Eclipse way – and you can’t change that. 🙂 And I also want to be able use Eclipse on colleague’s computers too – so why not to learn it with its shortcuts? Well…

One recommendation actually – duplicate (called copy line in Eclipse) and delete line – you may want to change those. You can mostly live with rest (yes even with Enter vs Tab to confirm completion) but Ctrl+D will soon kill you, especially if you are forced to work in Eclipse more than you can in Idea. I changed it in the Default scheme, because when I wanted to create a new one, I found out it’s not possible in any simple way.

Shortcut Schemes cannot be copied inside of Eclipse. If you’re wondering how to create a new one, wonder no more – you have to do it this way (not that I understand that page too much). I’m also not sure how you can add more binds to one action (not a sequence, but two different combinations). Long way to catch Idea on this one.

OK, and now some “Idea-Eclipse remapping” right?

  • Alt+Enter is Ctrl+1 – called quick fix
  • Ctrl+H is F4 – view type hierarchy
  • Ctrl+B or F4 is F3 (Ctrl+left click works the same, though a bit lazily – you have to wait till Eclipse underlines the stuff – maybe even move the cursor a bit, sometimes I can’t force Eclipse to understand this) – you’ll probably mess F3 with F4 a bit
  • F3, Shift+F3 is Ctrl+K and Ctrl+Shift+K – next/previous search, in Eclipse you can just select stuff and press Ctrl+K, in Idea you have to Ctrl+F it or highlight it with Ctrl+Shift+F7, then F3
  • F2, Shift+F2 is Ctrl+. and Ctrl+, – next/previous error/warning, in both IDEs you can set to focus on errors first instead of mixing warnings in too – in Eclipse go to Preferences, General, Editors, Text Editors, Annotations and there you can include many things into this kind of search
  • Ctrl+Y is Ctrl+D – what a shock for delete a line 🙂
  • Ctrl+D is Ctrl+Alt+Down/Up (but only for whole lines) – now you see why I recommend to switch at least this, Eclipse’s option to copy up or down is quite nice, though minor feature
  • Ctrl+W/Ctrl+Shift+W is Alt+Shift+Up/Down – but the selection jumps differently than in Idea and you will probably not like it at all, in Idea it really starts with word – even inside of strings, but not in Eclipse; funny enough, while word selection is way too eager in Eclipse, Ctrl+Left/Right jumps to camel humps inside words (which in most cases is too slow for me, but YMMV of course, you can switch it in Preferences); you will also probably hate selection expansion on property names, where I want to start with one word again, not the whole property
  • Eclipse has Ctrl+J for incremental search – this is mostly similar to Ctrl+F in Idea, though Idea’s Enter/Escape workflow in the search bar could be better for smoother feel (but maybe nobody feels the same)
  • Ctrl+G is Ctrl+L – go to line
  • Ctrl+Alt+V (as variable) is Alt+Shift+L (as local)
  • Ctrl+Alt+C (constant) is only in menu – Alt-T (T as refactor :-)) and there press A (as … well, constant). This leads us to menu mnemonics. Maybe in Eclipse they are problematic because of some history (that is shorter than Idea, BTW), I don’t know. But however you look at it, refactor is not so important, so intuitive, you have to remember strange shortcuts or add your own (which means changes to the Default key scheme for most normal users)
  • Instead of File Structure View (Ctrl+F12) you have Outline (Ctrl+O) in Eclipse. While in outline you can lookup any member from nested classes (something I suggested for Idea a few days back) you can’t use camel humps lookup (gF for getFilter for instance)
  • Ctrl+N is Ctrl+Shift+T to find class quickly – camel humps work nicely in both
  • Ctrl+Shift+N is Ctrl+Shift+R to find any resource (file)

Find in path (Idea’s Ctrl+Shift+F) is quite a pain really. There is no item for this in context menu on the project tree, you have to select the directory, go to menu Search and select File… I don’t feel like searching for file, I take it more like searching for occurrences, but whatever. After this you have to switch radio button to “Selected resources” (I honestly wouldn’t understand that without help, though directory is kinda resource too, right?) and there you go finally. Many Eclipse users don’t know what that radio button means and they rather go with working sets or just change pattern for files if possible. Very, very non-intuitive.

Find usages (Alt+F7) is here (Ctrl+H) but funny enough my Eclipse mates wondered why I ask if I can see the actual lines with occurrence in the search results. Maybe just to know how the same method was used without going to the source! 🙂 I’m sure we (Idea users) miss some funny features from Eclipse too and we don’t know about them yet. Sometimes I’m in doubt if we all code in Java really – so many mindset differences. Also be aware that Eclipse might open all your search results in a single tab – you can change this in Preferences. Also the behavior of this find is very annoying. In non-java files it mostly offers File Search (text search) tab as default, but in Java it offers Java Search with File Search tab missing altogether. That’s the famous “context-awareness” of Eclipse in its worst moments, if you ask me.

Comment the line (Ctrl+/ in both IDEs) works in Java but not in XML/HTML/CSS [EDIT: reportedly it does for JavaEE version]. (CSS doesn’t work in Idea Community Edition either, but then – CSS syntax is officially not supported there.)

Alt+Shift+Insert for column selection mode is Alt+Shift+A. No problem with selection behavior either.

Open recently closed editors with Ctrl+E? Depends… there is no list of files recently closed (quite a shame if you ask me), but you can quickly reopen the last one using Ctrl+Q (last edit location) or hope that your recently closed tab was one of those recently open and then you can use Alt+F and some number (default last 4 can be changed to 9, I strongly recommend that if you need it in your workflow). This is feature I really miss in Eclipse – and from what I asked, many Eclipse users too.

Finally two more links:

I have a bunch of other things prepared, completion comparison mostly with some animated gifs, so stay tuned!

Don’t miss other posts on this topic:
Eclipse vs IntelliJ IDEA
From IntelliJ IDEA to Eclipse (2)
Why to synchronize with SVN in Eclipse?
From IntelliJ IDEA to Eclipse (3)
From IntelliJ IDEA to Eclipse (5)

From IntelliJ IDEA to Eclipse (2)

This is hardly a guide, but it may still be useful – or just please random Idea users – whatever. 🙂 This is sort of continuation of my previous rant and I expect more to come when I find out how to do some stuff in Eclipse. All my pros about Eclipse still applies (EMF, plugins, all these corporation doing their own plugins for easier development – there are reasons for this), let’s now see what I really miss or what is different.

If you want to try IntelliJ IDEA (just out of curiosity, if you’re Eclipse users) you can read migration article here. IBM offers their thorough guide for migration to Eclipse here. The biggest terminology mismatch is about workspace, projects and modules – it’s explained in both guides. I didn’t open our Java Simon project in Eclipse yet – maybe then I’d understand it better. Right now I have one workspace with more projects in the “project” sense of the word. In Idea I open one project in one window – as always. So for me project is project. But then I didn’t try to force Eclipse to compile part of the project with one JDK and other with different – maybe then I’d need to break modules to Eclipse projects. However, while it is terminology mess obviously, it’s not the most important thing.

After spending some time with Eclipse you might wanna change editor colours and syntax highlighting. Shame is that there is no obvious way how to save the colour scheme but you should be OK with changing just a few things so it’s less blue/grey only. Quick Diff colours are the first candidates, then maybe comments and Java syntax. Then you may feel more like home and also I just simply see better. Exploration of the Preferences is one of those recommended things to learn about what you can tweak. IF you find it in the first place though – I google a lot regarding how to set this and that in Eclipse. This surely applies for the migration to Idea too.

Formatter in Eclipse may be better configurable (I don’t know, but it seems so from the flood of options) but the overall results are often worse (because of all those options). Ultimately you’ll get what you want though – but settings for XML doesn’t seem to be part of the formatter after all (correct me if I’m wrong). In Idea you have Code Style, you can use global settings or settings for a project and all file types are under Code Style (no formatter bits scattered in the settings tree). While there seems to be no export from GUI in Idea (like in Eclipse) it’s easy to locate code style profile XML files on disk (Idea’s config/codestyles directory somewhere in your homedir) and share them.

There are many concept differences between both IDEs but I don’t care about them that much – as I can hardly do something about them. I can compare editors though. There are some conceptual differences between editors itself too, but in the end it’s about what this one completes and that one doesn’t, etc. As I work more and more with Eclipse, I’m surprised it doesn’t have some (basic?) things. Of course you can always tell him “do this and this”, but Idea often just knows. Now this is not the same as “my Ctrl+Space does it all while you have tons of shortcuts for it”. Yes, sometimes you have to tell Idea “do this” with proper shortcut. But I don’t have to suggest enum type name to complete for instance!

Eclipse doesn’t skip over closing braces/parenthesis if you move the cursor there, but skips nicely right after they are autoinserted. This might be better than Idea’s way actually. I like that Idea gets me out of parentheses, but in many cases I could figure this myself – and often I have real problem to insert new end parenthesis before you open it (so what! I do it from back to start sometimes! :-)). Little note to parentheses highlighting – Idea shows the pair when you’re out, Eclipse when you’re in. Whatever. Idea is better visible – as nearly always.

Recently I discovered Idea’s “Complete Statement” feature (Ctrl+Shift+Enter) – see video here. Not only I found it’s something I missed for years (but just don’t check every missing feature, right?) but it’s also the best way how to emulate “o” command from vi editor (add next line and go to insert mode). These features are missing in Eclipse – at least out of the box.

I mentioned automatic symbol highlighting (or none at all) in my first post – if Eclipse has highlighing on demand it’s not easy to find because none of my colleagues doesn’t know about it. I checked some introduction video for IDEA Community Edition (must see – because every time I learn something new – or forgotten) and I was shocked by automatic highlighting there. I had to open Idea and check how they screwed it, broke it or whatever. Feature is described here. But Idea didn’t let me down. Even with automatic highlighting on you can still stick it with Ctrl+Shift+F7. So you can have best of both worlds – of course on Idea. (At least when we’re talking about highlighting.)

I’ll focus more on keyboard shortcuts in the next episode – how they relate in Idea and Eclipse, what you can and can not expect, etc. Today it’s time to slowly wrap up the article – but we can’t not to mention perspectives, right? 😉

First go about debugging (more to come later!). When you have a warning on a line (light bulb in the gutter), try toggle the breakpoint on that line. Can you see it? I can’t. Luckily I have good colleagues. “You have to go to Debug perspective…” “Ah, different perspective! Of course…” “…and then switch that tab there to Breakpoints and… see? Now you don’t have it on that line. And now you have it there. Easy.” (But yeah, even they were chuckling a bit.)

Eclipse isn’t bad at all of course, I still recall my colleague’s (kinda ironic): “What do you want? It’s for free!” But then, even “smaller” Idea is – and while it lacks a lot of Java EE support, it’s still “Develop with pleasure”. As a final note – when you find yourself stuck with maximized code window (Ctrl+M in Eclipse – and I use it a lot) fighting the Project Explorer that is not docked properly and you don’t know why… just switch from Team Synchronizing to Java perspective. Maybe you’ll get used to it sooner than me.

You can actually say: If something is wrong, it’s probably your (Eclipse) perspective. 🙂

Don’t miss other posts on this topic:
Eclipse vs IntelliJ IDEA
Why to synchronize with SVN in Eclipse?
From IntelliJ IDEA to Eclipse (3)
From IntelliJ IDEA to Eclipse (4)
From IntelliJ IDEA to Eclipse (5)