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>
   1 .\" ident       "%Z%%M% %I%     %E% SMI"
   2 .\" Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
   3 .\" Use is subject to license terms.
   4 .\"
   5 .\" CDDL HEADER START
   6 .\"
   7 .\" The contents of this file are subject to the terms of the
   8 .\" Common Development and Distribution License (the "License").
   9 .\" You may not use this file except in compliance with the License.
  10 .\"
  11 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  12 .\" or http://www.opensolaris.org/os/licensing.
  13 .\" See the License for the specific language governing permissions
  14 .\" and limitations under the License.
  15 .\"
  16 .\" When distributing Covered Code, include this CDDL HEADER in each
  17 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  18 .\" If applicable, add the following below this CDDL HEADER, with the
  19 .\" fields enclosed by brackets "[]" replaced with your own identifying
  20 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  21 .\"
  22 .\" CDDL HEADER END
  23 .\"
  24 .TH jstyle 1 "22 November 2005"
  25 .SH NAME
  26 .I jstyle
  27 \- check for some common stylistic errors in Java source files
  28 .SH SYNOPSIS
  29 \fBjstyle [-chptvC] [file...]\fP
  30 .LP
  31 .SH DESCRIPTION
  32 .IX "OS-Net build tools" "jstyle" "" "\fBjstyle\fP"
  33 .LP
  34 .B jstyle
  35 inspects Java source files (*.java) for common stylistic errors.  It
  36 is similar to
  37 .BR cstyle (1)
  38 in that it attempts to check for the style
  39 documented in \fI/shared/ON/general_docs/cstyle.ms.pdf\fP, although by
  40 necessity is modified to work with Java-specific constructs.  Note that
  41 there is much in that document that
  42 .I cannot
  43 be checked for; just because your code is
  44 .BR jstyle (1)
  45 clean does not
  46 mean that you've followed Sun's Java style.  \fICaveat emptor\fP.
  47 .LP
  48 .SH OPTIONS
  49 .LP
  50 The following options are supported:
  51 .TP 4
  52 .B \-c
  53 Check continuation line indentation inside of functions.  Sun's C style
  54 states that all statements must be indented to an appropriate tab stop,
  55 and any continuation lines after them must be indented \fIexactly\fP four
  56 spaces from the start line.  This option enables a series of checks
  57 designed to find contination line problems within functions only.
  58 .LP
  59 .TP 4
  60 .B \-h
  61 Performs heuristic checks that are sometimes wrong.  Not generally used.
  62 .LP
  63 .TP 4
  64 .B \-p


  88 .LP
  89 .SH NOTES
  90 .LP
  91 The jstyle rule for the OS/Net consolidation is that all new files must
  92 be
  93 .B -p
  94 clean.  For existing files, the following invocations are
  95 run against both the old and new files:
  96 .LP
  97 .TP 4
  98 .B "jstyle file"
  99 .LP
 100 .TP 4
 101 .B "jstyle -p file"
 102 .LP
 103 If the old file gave no errors for one of the invocations, the new file
 104 must also give no errors.  This way, files cannot become unclean.
 105 .LP
 106 .SH BUGS
 107 .LP
 108 .BR jstyle (1)
 109 cannot disambiguate Java generic type parameters or
 110 arguments that span multiple lines from relational operators.  For example:
 111 .RS 4
 112 .HP 4
 113 private class Foo<A extends Bar,
 114 .br
 115 B extends Bar> { ...
 116 .RE
 117 .LP
 118 is flagged as two lines with missing spaces around relational operators.

   1 .\" Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
   2 .\" Use is subject to license terms.
   3 .\"
   4 .\" CDDL HEADER START
   5 .\"
   6 .\" The contents of this file are subject to the terms of the
   7 .\" Common Development and Distribution License (the "License").
   8 .\" You may not use this file except in compliance with the License.
   9 .\"
  10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  11 .\" or http://www.opensolaris.org/os/licensing.
  12 .\" See the License for the specific language governing permissions
  13 .\" and limitations under the License.
  14 .\"
  15 .\" When distributing Covered Code, include this CDDL HEADER in each
  16 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  17 .\" If applicable, add the following below this CDDL HEADER, with the
  18 .\" fields enclosed by brackets "[]" replaced with your own identifying
  19 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  20 .\"
  21 .\" CDDL HEADER END
  22 .\"
  23 .TH jstyle 1ONBLD "22 November 2005"
  24 .SH NAME
  25 .I jstyle
  26 \- check for some common stylistic errors in Java source files
  27 .SH SYNOPSIS
  28 \fBjstyle [-chptvC] [file...]\fP
  29 .LP
  30 .SH DESCRIPTION
  31 .IX "OS-Net build tools" "jstyle" "" "\fBjstyle\fP"
  32 .LP
  33 .B jstyle
  34 inspects Java source files (*.java) for common stylistic errors.  It
  35 is similar to
  36 .BR cstyle (1ONBLD)
  37 in that it attempts to check for the style
  38 documented in \fI/shared/ON/general_docs/cstyle.ms.pdf\fP, although by
  39 necessity is modified to work with Java-specific constructs.  Note that
  40 there is much in that document that
  41 .I cannot
  42 be checked for; just because your code is
  43 .BR jstyle (1ONBLD)
  44 clean does not
  45 mean that you've followed Sun's Java style.  \fICaveat emptor\fP.
  46 .LP
  47 .SH OPTIONS
  48 .LP
  49 The following options are supported:
  50 .TP 4
  51 .B \-c
  52 Check continuation line indentation inside of functions.  Sun's C style
  53 states that all statements must be indented to an appropriate tab stop,
  54 and any continuation lines after them must be indented \fIexactly\fP four
  55 spaces from the start line.  This option enables a series of checks
  56 designed to find contination line problems within functions only.
  57 .LP
  58 .TP 4
  59 .B \-h
  60 Performs heuristic checks that are sometimes wrong.  Not generally used.
  61 .LP
  62 .TP 4
  63 .B \-p


  87 .LP
  88 .SH NOTES
  89 .LP
  90 The jstyle rule for the OS/Net consolidation is that all new files must
  91 be
  92 .B -p
  93 clean.  For existing files, the following invocations are
  94 run against both the old and new files:
  95 .LP
  96 .TP 4
  97 .B "jstyle file"
  98 .LP
  99 .TP 4
 100 .B "jstyle -p file"
 101 .LP
 102 If the old file gave no errors for one of the invocations, the new file
 103 must also give no errors.  This way, files cannot become unclean.
 104 .LP
 105 .SH BUGS
 106 .LP
 107 .BR jstyle (1ONBLD)
 108 cannot disambiguate Java generic type parameters or
 109 arguments that span multiple lines from relational operators.  For example:
 110 .RS 4
 111 .HP 4
 112 private class Foo<A extends Bar,
 113 .br
 114 B extends Bar> { ...
 115 .RE
 116 .LP
 117 is flagged as two lines with missing spaces around relational operators.