find application

Searches the classfiles in the trek for the specified names and outputs the statements where they are used.

The command line of the find application is: base-classes searchlist [find and common switches]. A searchlist is one or more search terms separated by semi-colons. This argument is used to identify what to find. The switches defined by the find application are:

-bydef
If this switch is specified, find searches for declarations that match terms in the searchlist. Then for each matching declaration, the statements in which its name is used are displayed. If this switch is omitted, statements for any matching name are displayed as they are scanned in each classfile.

-cs
The terms in searchlist are matched with names in the program using a case-sensitive comparison. If this switch is omitted, the matching is case-insensitive.

-win size
If size is 0, only the declarations of matched names are displayed. Otherwise size defines the size of the window to show around each statement where a match is found. For example, -win 3 would display the statement before, the statement of usage, and the statement after each match. If this switch is omitted, -win 1 is assumed.

An individual search term may be of the form field-ref, method-ref() , or method-ref ().wild-string. The last form is used to identify local variables within the specified method.

  • Field-ref’s and method-ref’s are of the form wild-string or class-name.wild-string.
  • A wild-string may be *, string, *string, string*, or *string*. These respectively match any name, names that are the same as string, names that end with string, names that start with string, and names that contain string.
  • A class-name may omit the leftmost terms of its package’s name. For example, String.equal*() would match methods starting with equal in packages other than java.lang, whereas java.lang.String.equal*() would match only java.lang.String.equals(). Similarly profileLog.end*().*ream would match only stream in profileLog.endTrek().

(Note: some JVMs expand a searchlist of xxx* to the files in the current directory that match this pattern. To workaround this, add a semi-colon to it or quote it).