This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The argument to split() is a regular expression, not just a plain old string. "|" is a special character in Java regular expressions; it represents "or", as in "this or that". Just an "|" alone ought to be an error, I'd think, but apparently it isn't; it seems to mean "nothing or nothing" in this context, so you're getting your string split at every character.
So, how to do this right? Escape the | with a backslash. You also have to protect the backslash with another backlash so that the Java compiler leaves it alone. So altogether, you want to use split("\\|") . This will work as you expect.