Source code storing along with debug information
I thought of a nice idea. Today, the javac allows the developer to specify what debuging information is stored in the result ".class" files - line info, variables, etc. Why not add an option to store the source code itself?
This would result in the following benefits:
1. 3rd party libraries and projects can be distributed with their source code automatically (if they wish) without requiring the user to download the source code or checking it out of an SCM.
2. IDEs won't have to synchronize the source code while debugging, which would result in simpler tools support.
3. Often when debugging complex and large systems with custom build processes, one can mistakenly debug a compiled class but attach it (via his/her IDE) to the wrong source code root (old version, etc). I know this happened to me on more than one occasion. Having the source code built into the classes would immediately indicate that something is not right and I'm not debugging the correct version of the class.
4. A nice feature would be to enable this via an annotation (although I'm not sure that's wise, since this takes away the control from the build process).
1. Might considerably increase the size of resulting class files. Therefor distributions with debug source code might /should be distributed seperately, or with source code distributions.
2. Can't think of more cons - but I'm biased ;-)
What do you think?