UML, robust code, structure questions

The deeper you go into the woods, the more lumber you see, they say. I started with a problem of having to compare contents of 'n' files to a 'master file'. (key value pairs) I went through a bunch of iterations until i got to the point where program not only did what i wanted it to, but also did it fast enough and produced a nice enough html result.

Then comes days 2. Now the problem is that i need to build on the existing code to extend my program to compare contents of 'n' tables where data is to be looked at as a combination of key value pairs as well. So, i dive in and ... done

But then i find out that my idea of Key Value representation of data is different from that of my customer. Silly me, i thought this would work:

Java Code:

Col1 Col2
keyA ValueA
keyB ValueB

Their table looked like this instead

Java Code:

Col1(keyA) Col2(KeyB)
ValueA Value B

No biggie, a few code changes and we're in business again.

Throughout this process i reused the core method that does actual comparison and code that produces a report. Had to make a number of changes though ..

So ... are you wondering if there is a question anywhere here yet?

Question is this: I have over 1100 lines of code written by someone whose Java experience is about 1 month. I fear that with further improvements my code will make it unmanageable and difficult to maintain. What approach would you suggest in making said code more robust and structured? Is there a software that would consume my *.java and produce UML code? May be something else that would give me a high level code overview that will expose things i otherwise would miss?

There is stuff out there for producing UML class diagrams. There might be plugins for Netbeans or Eclipse these days. I suspect you'll still need to pay money for something that'll reverse engineer sequence diagrams, though.

Since you're only dealing with 1100 lines of code, now is probably the time to simply rework it properly.

Be sure that you have managed to :
Completely separate data representation in files and algorithm that you have written for comparing purposes.

It is good that client gave you unexpected format so now you can rethink what part of your code you HAVE to change
and ask yourself can u isolate and encapsulate that change so it never ever
ruins your code again

2. go trough some very bacis OOA&D principals and catch useful stuff like
never add to much responsibility to one class, program to interface not implementation, learn how to use interfaces so you can change behaviour in run-time, class should have only one reason to change principal...