How to use spaces in IBM RAD or Eclipse Instead of Tabs

Having tab characters in the source code is not a very good coding practice. Static file analyzers like checkstyle can be configured to catch the tab characters as either warnings or errors but that configuration is beyond the scope of this article.

I will however talk why tab characters are bad:

  1. Tab characters need to be configured with the tab width and different users might choose to have different tab width (some may choose 3 characters, some 5), and thus the code violates the standard coding practice, especially when the code is shared and edited by multiple users.
  2. The other problem as mentioned in the Apache Jakarta coding standards is that in a ]distributed development environment, when the commit messages get sent to a mailing list, they are almost impossible to read if you use tabs.

By default, when you use your IDEs like IBM Rational Application Developer or Eclipse, the text editors are configured to insert tabs by default. So how do you tell the IDEs to use spaces instead of tabs? Follow the following steps.

Configure your default Text Editors:

Window->Preferences->Editors->Text Editors->Insert spaces for tabs

If you are using Eclipse 3.6

Window->Preferences->General->Editors->Text Editors->Insert spaces for tabs

You might also want to configure your Java Code Style Formatter

Window->Preferences->Java->Code Style->Formatter->Edit->Indentation = "Spaces Only"

How to delete saved SVN password from Eclipse IDE?

Ever wanted to delete the stored subversion (svn) password from Eclipse IDE? SVN stores the authentication in physical files. The easiest way is to delete those files physically from the explorer.

On my windows XP, these files are located in the following two folders:

C:Program FilesIBMSDPconfigurationorg.eclipse.core.runtime.keyring
C:Documents and SettingssanjaaluserApplication DataSubversionauthsvn.simple

You need to delete the “.keyring” file from the first folder, while you need to delete all the files form the second folder (“svn.simple“).

When you restart your Eclipse, your saved password will now be gone and will prompt you to enter new one.