Reputation: 30136
Why does the Java byte-code interpreter change a 'class' file when I change only symbol names (classes, interfaces, functions or variables) in the corresponding 'java' file?
I am maintaining both types under source control (GIT), and I keep seeing "twice the amount of changed files" even for cosmetic changes such as the one mentioned above.
BTW, the question is not on source-control issues, but just FYI, the reason I keep these files on GIT is in order to be able to do "clean up" (delete all unversioned files), and then run the program from a command-line without recompiling it.
If you have any idea how to achieve this functionality (run without build) otherwise, then I would be happy to hear it...
Thanks
Upvotes: 0
Views: 154
Reputation: 79848
The JVM needs access to the symbol names, for a number of reasons, including the following.
So the symbol names need to be stored in the class path.
Upvotes: 2
Reputation: 58888
Because the class files contain the symbol names.
Generally, people do not keep their class files in source control. If someone wants an old version of a class file, they get the old source file and compile it.
Upvotes: 7