This post originated from an RSS feed registered with Java Buzz
by Vlad Roubtsov.
Original Post: re: SourceDir should be a standard class attribute
Feed Title: Java Curiosity Shop
Feed URL: http://www.blog-city.com/bc/
Feed Description: Java esoterics: things from "don't try this at home" category
In response to this comment by euxx:
>It would be a bad idea to stick your sources to directory on someone else's computer.
I don't think my suggestion was to "stick" anything to directories on other computers. When you compile, the sources are already on your computer somewhere. A number of tools could benefit from looking up SourceDir shortly after a compile and getting access to the source without the user having to specify this location in a manual/non-standard way. If the source file is found at that location (and its timestamp makes sense), use it. If no file is found, don't do anything.
This is analogous to LineNumberTable attribute and a few others: in many cases you can only use the information in that attribute if you have access to the original source (and of the version that was used during the compile). If you don't have the source, the attribute is of limited use. Same with SourceDir. It should be thought of as an optional debug information like LineNumberTable, LocalVariableTable, etc.