IntelliJ open source
[Logo] JavaRanch » Big Moose Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Java in General
 
RSS feed
 
New topic
Author

Strange BlockComment Tag

Andy Schmid
Greenhorn

Joined: Jan 14, 2009
Messages: 2

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
Messages: 51

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
Messages: 2

Hi Carey,
everything clear now. Thanks for your fast Reply.
Campbell Ritchie
Bartender

Joined: Oct 13, 2005
Messages: 14987

Glad somebody could help; I didn't know what @(#) meant. And welcome to the Ranch
David Newton
Author
Bartender

Joined: Sep 29, 2008
Messages: 6916

What's the purpose? In case I forgot the name of the file I'm editing? Seems a little superfluous to me.

Consultant/Trainer | Polyglottal Developer | Struts Committer/PMC | Struts 2 Web Application Development
Carey Brown
Ranch Hand

Joined: Nov 19, 2001
Messages: 51

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

 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Java in General
 
RSS feed
 
New topic
MyEclipse Enterprise Workbench

.