sourceInfo.html revision 489a0ec7301a86af8497d24748336db09ca278da
1<html>
2<head>
3<title>FindBugs sourceInfo file</title>
4<link rel="stylesheet" type="text/css" href="findbugs.css">
5</head>
6<body>
7
8<table width="100%"><tr>
9
10
11<td bgcolor="#b9b9fe" valign="top" align="left" width="20%"> 
12<table width="100%" cellspacing="0" border="0"> 
13<tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr> 
14
15<tr><td>&nbsp;</td></tr>
16
17<tr><td><b>Docs and Info</b></td></tr> 
18<tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr> 
19<tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></font></td></tr> 
20<tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporters</a></font></td></tr> 
21<tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr> 
22<tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr> 
23<tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></font></td></tr> 
24<tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja/&#26085;&#26412;&#35486;)</a></font></td></tr> 
25<tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr> 
26<tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr> 
27<tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr> 
28<tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr> 
29<tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></td></tr> 
30
31<tr><td>&nbsp;</td></tr>
32
33<tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr> 
34
35<tr><td>&nbsp;</td></tr>
36
37<tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr>
38
39<tr><td>&nbsp;</td></tr>
40
41<tr><td><b>Development</b></td></tr> 
42<tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr> 
43<tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr> 
44<tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing</a></font></td></tr> 
45<tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font></td></tr> 
46<tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr> 
47<tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></font></td></tr> 
48<tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr> 
49<tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr> 
50<tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr> 
51</table> 
52</td>
53
54<td align="left" valign="top">
55
56<h1>FindBugs sourceInfo file</h1>
57
58<p>The FindBugs analysis engine can be invoked with an optional sourceInfo
59file. This file gives line number ranges for classes, files and methods. This
60information is an alternative to getting line number information 
61from the classfiles for methods. Since classfiles only contain line number 
62information 
63for methods, without a sourceInfo file we can't provide line numbers for fields,
64and for classes we just use the line numbers of the methods in the class.
65
66<p>The first line of the file should be
67<pre>
68sourceInfo version 1.0
69</pre>
70
71<p>Following that are a series of lines, each describing a class, field, or method.  For each, a starting and ending line number is provided. For example, the following sourceInfo file:
72<pre>
73sourceInfo version 1.0
74a.C,3,8
75a.C,x,4,4
76a.C,y,4,4
77a.C,<init>()V,8,8
78a.C,f(I)I,5,5
79a.C,g(Ljava/lang/Object;)I,6,7
80</pre>
81provides the following information about the class a.C:
82<ul>
83<li> fields x and y are both declared on line 4.
84<li> the method <code>int f(int)</code> is defined on line 5.
85<li> the method <code>int g(Object)</code> is defined on lines 6-7.
86<li> the void constructor for a.C is defined on line 8.
87</ul>
88The classnames should be the same format as used by Class.getName(): 
89packages are separated by ., inner class names are separated by $.
90Thus, if the class a.C had an inner class X and it was onb lines 10-15 of the file, the sourceInfo file might contain:
91
92<pre>
93a.C$X,10,15
94</pre>
95
96
97</table>
98
99
100<hr> <p> 
101<script language="JavaScript" type="text/javascript"> 
102<!---//hide script from old browsers 
103document.write( "Last updated "+ document.lastModified + "." ); 
104//end hiding contents ---> 
105</script> 
106<p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a> 
107<p> 
108<A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?group_id=96405&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A>
109
110</td>
111
112</tr></table>
113
114</body>
115</html>
116