Print this page
6205 onbld manuals should be declared as 1onbld
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Josef Sipek <jeffpc@josefsipek.net>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/scripts/jstyle.1
+++ new/usr/src/tools/scripts/jstyle.1onbld
1 -.\" ident "%Z%%M% %I% %E% SMI"
2 1 .\" Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 2 .\" Use is subject to license terms.
4 3 .\"
5 4 .\" CDDL HEADER START
6 5 .\"
7 6 .\" The contents of this file are subject to the terms of the
8 7 .\" Common Development and Distribution License (the "License").
9 8 .\" You may not use this file except in compliance with the License.
10 9 .\"
11 10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
12 11 .\" or http://www.opensolaris.org/os/licensing.
13 12 .\" See the License for the specific language governing permissions
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
14 13 .\" and limitations under the License.
15 14 .\"
16 15 .\" When distributing Covered Code, include this CDDL HEADER in each
17 16 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
18 17 .\" If applicable, add the following below this CDDL HEADER, with the
19 18 .\" fields enclosed by brackets "[]" replaced with your own identifying
20 19 .\" information: Portions Copyright [yyyy] [name of copyright owner]
21 20 .\"
22 21 .\" CDDL HEADER END
23 22 .\"
24 -.TH jstyle 1 "22 November 2005"
23 +.TH jstyle 1ONBLD "22 November 2005"
25 24 .SH NAME
26 25 .I jstyle
27 26 \- check for some common stylistic errors in Java source files
28 27 .SH SYNOPSIS
29 28 \fBjstyle [-chptvC] [file...]\fP
30 29 .LP
31 30 .SH DESCRIPTION
32 31 .IX "OS-Net build tools" "jstyle" "" "\fBjstyle\fP"
33 32 .LP
34 33 .B jstyle
35 34 inspects Java source files (*.java) for common stylistic errors. It
36 35 is similar to
37 -.BR cstyle (1)
36 +.BR cstyle (1ONBLD)
38 37 in that it attempts to check for the style
39 38 documented in \fI/shared/ON/general_docs/cstyle.ms.pdf\fP, although by
40 39 necessity is modified to work with Java-specific constructs. Note that
41 40 there is much in that document that
42 41 .I cannot
43 42 be checked for; just because your code is
44 -.BR jstyle (1)
43 +.BR jstyle (1ONBLD)
45 44 clean does not
46 45 mean that you've followed Sun's Java style. \fICaveat emptor\fP.
47 46 .LP
48 47 .SH OPTIONS
49 48 .LP
50 49 The following options are supported:
51 50 .TP 4
52 51 .B \-c
53 52 Check continuation line indentation inside of functions. Sun's C style
54 53 states that all statements must be indented to an appropriate tab stop,
55 54 and any continuation lines after them must be indented \fIexactly\fP four
56 55 spaces from the start line. This option enables a series of checks
57 56 designed to find contination line problems within functions only.
58 57 .LP
59 58 .TP 4
60 59 .B \-h
61 60 Performs heuristic checks that are sometimes wrong. Not generally used.
62 61 .LP
63 62 .TP 4
64 63 .B \-p
65 64 Performs some of the more picky checks. You should generally use this.
66 65 .LP
67 66 .LP
68 67 .TP 4
69 68 .B \-t
70 69 Insists on indentation with tabs. Because of the depth of nested blocks
71 70 that Java requires, and the commonality of long identifiers, tab
72 71 indentation in Java code is not always useful, assuming that tabs are fixed
73 72 at eight columns and that maximum line length is fixed at eighty columns,
74 73 so this option is not on by default. If you choose to consider tabs to be
75 74 four columns wide (not acceptable for ON), or are writing simple enough
76 75 code that the nesting is not very deep, this option might be useful.
77 76 Otherwise, avoid it.
78 77 .LP
79 78 .TP 4
80 79 .B \-v
81 80 Verbose output; includes the text of the line of error.
82 81 .LP
83 82 .TP 4
84 83 .B \-C
85 84 Ignore errors in header comments (i.e., block comments starting in the
86 85 first column). Not generally used.
87 86 .LP
88 87 .LP
89 88 .SH NOTES
90 89 .LP
91 90 The jstyle rule for the OS/Net consolidation is that all new files must
92 91 be
93 92 .B -p
94 93 clean. For existing files, the following invocations are
95 94 run against both the old and new files:
96 95 .LP
97 96 .TP 4
↓ open down ↓ |
43 lines elided |
↑ open up ↑ |
98 97 .B "jstyle file"
99 98 .LP
100 99 .TP 4
101 100 .B "jstyle -p file"
102 101 .LP
103 102 If the old file gave no errors for one of the invocations, the new file
104 103 must also give no errors. This way, files cannot become unclean.
105 104 .LP
106 105 .SH BUGS
107 106 .LP
108 -.BR jstyle (1)
107 +.BR jstyle (1ONBLD)
109 108 cannot disambiguate Java generic type parameters or
110 109 arguments that span multiple lines from relational operators. For example:
111 110 .RS 4
112 111 .HP 4
113 112 private class Foo<A extends Bar,
114 113 .br
115 114 B extends Bar> { ...
116 115 .RE
117 116 .LP
118 117 is flagged as two lines with missing spaces around relational operators.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX