The moose likes Java in General and the fly likes Strange BlockComment Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Strange BlockComment Tag" Watch "Strange BlockComment Tag" New topic
Author

Strange BlockComment Tag

Andy Schmid
Greenhorn

Joined: Jan 14, 2009
Posts: 6
Hi,

would be great if somebody can explain to me what this tag means:



I see this tag (preceding the filename) from time to time in some sourcecode files, but i have no clue what it is good for.
Its not mentioned in the sun code convention pages at http://java.sun.com/docs/codeconv/html/CodeConventions.doc4.html#216

kind regards
Andy
Carey Brown
Ranch Hand

Joined: Nov 19, 2001
Posts: 123

The '@(#)' prefix comes from the SCCS source code control system code that is used to check in/out source code from a repository. Other source code control systems may use the same prefix. The stuff immediately following the prefix, 'TestFile.java' in your case, is not actually stored in SCCS but is inserted on the fly when you get the file out of SCCS.
Andy Schmid
Greenhorn

Joined: Jan 14, 2009
Posts: 6
Hi Carey,
everything clear now. Thanks for your fast Reply.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 25057
Glad somebody could help; I didn't know what @(#) meant. And welcome to the Ranch
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12612
What's the purpose? In case I forgot the name of the file I'm editing? Seems a little superfluous to me.
Carey Brown
Ranch Hand

Joined: Nov 19, 2001
Posts: 123

First of all, the '@(#)' was specifically chosen for the C language. It was a pattern that did not appear in normal compiled code, therefore you could scan the binaries for this pattern. Second, the file name usage by itself, like you said, only provided limited usefulness, though it did end up in the binaries in a searchable form. More often the file name was accompanied by the revision number and the date the last modification was checked in.

P.S. The expanded SCCS tags would end up in the binaries by putting them inside string constants. It was pretty cool. You could scan an executable file for the pattern and extract the entire list of files and their versions that went into building it.

This message was edited 1 time. Last update was at by Carey Brown

 
 
subject: Strange BlockComment Tag
 
MyEclipse, The Clear Choice