| 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 | @HTML_SIDEBAR@ |
| 11 | |
| 12 | <td align="left" valign="top"> |
| 13 | |
| 14 | <h1>FindBugs sourceInfo file</h1> |
| 15 | |
| 16 | <p>The FindBugs analysis engine can be invoked with an optional sourceInfo |
| 17 | file. This file gives line number ranges for classes, files and methods. This |
| 18 | information is an alternative to getting line number information |
| 19 | from the classfiles for methods. Since classfiles only contain line number |
| 20 | information |
| 21 | for methods, without a sourceInfo file we can't provide line numbers for fields, |
| 22 | and for classes we just use the line numbers of the methods in the class. |
| 23 | |
| 24 | <p>The first line of the file should be |
| 25 | <pre> |
| 26 | sourceInfo version 1.0 |
| 27 | </pre> |
| 28 | |
| 29 | <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: |
| 30 | <pre> |
| 31 | sourceInfo version 1.0 |
| 32 | a.C,3,8 |
| 33 | a.C,x,4,4 |
| 34 | a.C,y,4,4 |
| 35 | a.C,<init>()V,8,8 |
| 36 | a.C,f(I)I,5,5 |
| 37 | a.C,g(Ljava/lang/Object;)I,6,7 |
| 38 | </pre> |
| 39 | provides the following information about the class a.C: |
| 40 | <ul> |
| 41 | <li> fields x and y are both declared on line 4. |
| 42 | <li> the method <code>int f(int)</code> is defined on line 5. |
| 43 | <li> the method <code>int g(Object)</code> is defined on lines 6-7. |
| 44 | <li> the void constructor for a.C is defined on line 8. |
| 45 | </ul> |
| 46 | The classnames should be the same format as used by Class.getName(): |
| 47 | packages are separated by ., inner class names are separated by $. |
| 48 | 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: |
| 49 | |
| 50 | <pre> |
| 51 | a.C$X,10,15 |
| 52 | </pre> |
| 53 | |
| 54 | |
| 55 | </table> |
| 56 | |
| 57 | @HTML_FOOTER@ |
| 58 | |
| 59 | </td> |
| 60 | |
| 61 | </tr></table> |
| 62 | |
| 63 | </body> |
| 64 | </html> |