| <html> |
| <head> |
| <title>FindBugs sourceInfo file</title> |
| <link rel="stylesheet" type="text/css" href="findbugs.css"> |
| </head> |
| <body> |
| |
| <table width="100%"><tr> |
| |
| |
| <td bgcolor="#b9b9fe" valign="top" align="left" width="20%"> |
| <table width="100%" cellspacing="0" border="0"> |
| <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="FindBugs"></a></td></tr> |
| |
| <tr><td> </td></tr> |
| |
| <tr><td><b>Docs and Info</b></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="findbugs2.html">FindBugs 2.0</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="demo.html">Demo and data</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="users.html">Users and supporters</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="http://findbugs.blogspot.com/">FindBugs blog</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="factSheet.html">Fact sheet</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="manual/index.html">Manual</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="ja/manual/index.html">Manual(ja/日本語)</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="FAQ.html">FAQ</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="bugDescriptions.html">Bug descriptions</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="bugDescriptions_ja.html">Bug descriptions(ja/日本語)</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="bugDescriptions_fr.html">Bug descriptions(fr)</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="mailingLists.html">Mailing lists</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="publications.html">Documents and Publications</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="links.html">Links</a></font></td></tr> |
| |
| <tr><td> </td></tr> |
| |
| <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr> |
| |
| <tr><td> </td></tr> |
| |
| <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs Swag</b></a></td></tr> |
| |
| <tr><td> </td></tr> |
| |
| <tr><td><b>Development</b></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="http://sourceforge.net/tracker/?group_id=96405">Open bugs</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="reportingBugs.html">Reporting bugs</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="contributing.html">Contributing</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="team.html">Dev team</a></font></td></tr> |
| <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> |
| <tr><td><font size="-1"> <a class="sidebar" href="Changes.html">Change log</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="http://sourceforge.net/projects/findbugs">SF project page</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="http://code.google.com/p/findbugs/source/browse/">Browse source</a></font></td></tr> |
| <tr><td><font size="-1"> <a class="sidebar" href="http://code.google.com/p/findbugs/source/list">Latest code changes</a></font></td></tr> |
| </table> |
| </td> |
| |
| <td align="left" valign="top"> |
| |
| <h1>FindBugs sourceInfo file</h1> |
| |
| <p>The FindBugs analysis engine can be invoked with an optional sourceInfo |
| file. This file gives line number ranges for classes, files and methods. This |
| information is an alternative to getting line number information |
| from the classfiles for methods. Since classfiles only contain line number |
| information |
| for methods, without a sourceInfo file we can't provide line numbers for fields, |
| and for classes we just use the line numbers of the methods in the class. |
| |
| <p>The first line of the file should be |
| <pre> |
| sourceInfo version 1.0 |
| </pre> |
| |
| <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: |
| <pre> |
| sourceInfo version 1.0 |
| a.C,3,8 |
| a.C,x,4,4 |
| a.C,y,4,4 |
| a.C,<init>()V,8,8 |
| a.C,f(I)I,5,5 |
| a.C,g(Ljava/lang/Object;)I,6,7 |
| </pre> |
| provides the following information about the class a.C: |
| <ul> |
| <li> fields x and y are both declared on line 4. |
| <li> the method <code>int f(int)</code> is defined on line 5. |
| <li> the method <code>int g(Object)</code> is defined on lines 6-7. |
| <li> the void constructor for a.C is defined on line 8. |
| </ul> |
| The classnames should be the same format as used by Class.getName(): |
| packages are separated by ., inner class names are separated by $. |
| Thus, 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: |
| |
| <pre> |
| a.C$X,10,15 |
| </pre> |
| |
| |
| </table> |
| |
| |
| <hr> <p> |
| <script language="JavaScript" type="text/javascript"> |
| <!---//hide script from old browsers |
| document.write( "Last updated "+ document.lastModified + "." ); |
| //end hiding contents ---> |
| </script> |
| <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbugs@cs.umd.edu</a> |
| <p> |
| <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> |
| |
| </td> |
| |
| </tr></table> |
| |
| </body> |
| </html> |