Monday, July 21, 2008

Decompiling and Comparing

I have a should-not-happen situation at work. There is a coworker who left the company leaving behind multiple "workspaces" (IBM Websphere project files) for a project that haven not been touched for a year.

We were supposed to use a source control system to hold source code, and create builds off some automatic process. That way, all sources are collected and not relied on the developers' machine.

But no, the guy who left didn't.

Heck I am not even on that guy's team, but now had to look at his stuff: to determine which of the workspaces create the files in production.

Fortunately, Java .class files may be de-compiled. I used the DJ Java Decompiler. This slick tool re-create source code from the .class files so I can compare. Still a painful process but not impossible.

Is there a way to decompile a Windows EXE? Decompiling a Windows EXE will probably be some unthinkable assembly files.

This is one of the beauty of bytecodes of Java. But decompiling will not recover your comments because they are not inside the .class files.

I use ExamDiff to compare text files. It is better than the good old "fc" DOS command.

But it should not happen! SMART company should require code to be in source control. Heck that guy gave a 2 week notice, did you not require him to check in that source code?

If I lose my C:drive nobody else gets hurt, all my code is in source control.

My outrageous request is: find the right source code and put it in version control. Why am *I* suppose to do this. Then, add new functionality to this code. Heck I don't even know what is it supposed to do.

No comments: