![]() |
|||||||||||||
| | | | | | | | | | | |
![]() Jacobe is a configurable code beautifier for the JavaTM programming language (edition 1.4). It is possible to let Jacobe print your Java code according to the widely used layout rules of Sun Microsystems or customize it to your own standards. The documentation of Jacobe is only on-line available, hence it is advised to bookmark this page. If there is something you cannot find in the documentation, please let us know: support@tiobe.com. Rules OverviewSee section Rules for a detailed explanation of the available rules. Contents
Availability AvailabilityJacobe accepts Java code conforming to the Java 2 (Edition 1.4) syntax. This is the Java version as defined by Sun Microsystems. Jacobe is available for the following operating systems: Windows 95/98/ME/NT/2K/XP as a command shell application and Linux kernel versions 2.1 and higher. Synopsisjacobe <option>... <input>... Here, <input> could be a file name, a directory name (meaning: beautify recursively), a wildcard or the symbol "-" (meaning: read from standard input). For instance, the call jacobe <file>.java pretty prints the Java file <file>.java according to the default configuration, i.e., the configuration described by the provided configuration file sun.cfg. The result is written to the file <file>.java.jacobe. An example of a more complex call is jacobe src/*.java src/com/. The possible values for <option> are listed in the table below. Note that spaces act as separators and should therefore not be used in options.
Glossary of TermsIn order to get an unambigious picture of the meaning of the rules defined in the next section, it is important to have a precize definition of the terms used. The table below gives an overview of these terms.
RulesThis section gives a detailed overview of all rules supported by the current version of Jacobe. OverviewRules are specified in the following way.
In the first two columns the rule number and rule identification is given. The symbol This particular example denotes rule 1 called "indent" which is a parametrized rule that is part of the Sun configuration. The default value of this horizontal rule is 4. The rules of Jacobe are described in full detail in the following subsections. The subsections follow the sections of the coding conventions document of Sun Microsystems. Indentation
Description: Use a fixed number of spaces for indentation. An indentation starts at the beginning of a nested statement and ends at the end of the nested statement, provided that the nested statement starts at a new line. For instance, --indent=4 transforms intopublic class Status { // calculate failure status boolean failure() { return !status; public class Status { // calculate failure status boolean failure() { return !status; Switching on both indent (rule 1) and indenttab (rule 33) at the same time will result in undefined behaviour.
Description: Use a fixed number of tabs for indentation. An indentation starts at the beginning of a nested statement and ends at the end of the nested statement, provided that the nested statement starts at a new line. For instance, assuming that your tab is set to 4 spaces, --indenttab=1 transforms intopublic class Status { // calculate failure status boolean failure() { return !status; public class Status { // calculate failure status boolean failure() { return !status; Switching on both indent (rule 1) and indenttab (rule 33) at the same time will result in undefined behaviour. Line Length
Description: There is a fixed maximum number of characters per line. In case a line exceeds the maximum line length a line terminator is inserted at a line break point closest to the maximum column position. Line break points are defined by switching on specific line wrapping rules such as wraplineterminfixop (rule 88). After a line terminator has been inserted, the next line is indented the number of indentation levels specified by rule indentcontinuation (rule 92). See specific line breaking rules (starting with wrap) for examples of line wrapping. IMPORTANT NOTE. This is the first Jacobe version that supports line wrapping. Its current implementation is limited. Only wrapping of expressions in conditions and statements is supported. For instance, wrapping of parameter lists is not yet available. Wrapping Lines
Description: Break a specific number of times after an operator in case a line exceeds the maximum line length. The maximum line length is specified by rule wrap (rule 86). For instance, --wrapinfixoplineterm=1 --wrap=60 --indent --indentcontinuation transforms intoint delta = height - fontMetrics.getAscent() - fontMetrics.getDescent(); int delta = height - fontMetrics.getAscent() - fontMetrics.getDescent(); This rule is especially powerful if used in combination with lineterminfixop (rule 100) and infixoplineterm (rule 101). For instance, --wrapinfixoplineterm=1 --wrap=60 --indent --indentcontinuation --lineterminfixop=0 --infixoplineterm=0 transforms intoif (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_DOWN) { if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_DOWN) { Note that switching on simultaneously both this rule and wraplineterminfixop (rule 88) will result in undefined behaviour.
Description: Break a specific number of times before an operator in case a line exceeds the maximum line length. The maximum line length is specified by rule wrap (rule 86). For instance, --wraplineterminfixop=1 --wrap=60 --indent --indentcontinuation transforms intoint delta = height - fontMetrics.getAscent() - fontMetrics.getDescent(); int delta = height - fontMetrics.getAscent() - fontMetrics.getDescent(); This rule is especially powerful if used in combination with lineterminfixop (rule 100) and infixoplineterm (rule 101). For instance, --wraplineterminfixop=1 --wrap=60 --indent --indentcontinuation --lineterminfixop=0 --infixoplineterm=0 transforms intoif (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_DOWN) { if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_DOWN) { Note that switching on simultaneously both this rule and wrapinfixoplineterm (rule 87) will result in undefined behaviour.
Description: Indent a specific number of indentation levels after a line of code has been wrapped. For instance, --indentcontinuation=2 --indent=4 --wrap=60 --wraplineterminfixop=1 transforms intoif ((currentIndex < length) && (rawdata.charAt(currentIndex) == '=')) { if ((currentIndex < length) && (rawdata.charAt(currentIndex) == '=')) {
Description: Break a specific number of times after a comma in the argument list of a method or constructor invocation in case a line exceeds the maximum line length. The maximum line length is specified by rule wrap (rule 86). For instance, --wrapcommalineterm=1 --indent=4 --wrap=80 --indentcontinuation=2 transforms intovaporWare.sell("Product off the shelf", orderQuantity, customerCode, productCode, orderNumber); vaporWare.sell("Product off the shelf", orderQuantity, customerCode, productCode, orderNumber);
Description: Break a specific number of times before a comma in the argument list of a method or constructor invocation in case a line exceeds the maximum line length. The maximum line length is specified by rule wrap (rule 86). For instance, --wraplinetermcomma=1 --indent=4 --wrap=80 --indentcontinuation=2 transforms intovaporWare.sell("Product off the shelf", orderQuantity, customerCode, productCode, orderNumber); vaporWare.sell("Product off the shelf", orderQuantity, customerCode , productCode, orderNumber); Comments
Description: There should be a specified number of spaces after an opening comment. This rule holds for all available kinds of Java comments. For instance, --opencommentspace=1 transforms into/* this should be fixed very soon */ int x; //x coordinate in pixels /* this should be fixed very soon */ int x; // x coordinate in pixels Declarations and Statements
Description: There should be a specified number of line terminators after a colon (':'). For instance, --colonlineterm=1 --indent transforms intoswitch ( x ) { case 1: return x + 1; switch ( x ) { case 1: return x + 1; The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of spaces before an opening brace ('{'). For instance, --spaceopenbrace=1 transforms intoclass Status{ class Status {
Description: There should be a specified number of line terminators after a close brace ('}'). For instance, --closebracelineterm=1 --indent transforms intowhile (x > 0) { x--; } y = x; while (x > 0) { x--; } y = x; The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of spaces between an empty pair of opening and close braces ('{' and '}'). For instance, --openbracespaceclosebrace=0 transforms intofor (int i = 0; i < 10; i++) { } for (int i = 0; i < 10; i++) {}
Description: There should be a specified number of line terminators between an empty opening brace ('{') and closing brace ('}'). For instance, --openbracelinetermclosebrace=0 transforms intocatch (Exception e) { } catch (Exception e) { } The best results are obtained if this rule is applied in combination with openbracespaceclosebrace (rule 43). The result of applying --openbracelinetermclosebrace=0 --openbracespaceclosebrace=0 to the previous example is catch (Exception e) {} Observe that this rule overrules the following rules that also deal with opening and closing braces: linetermblockclosebrace (rule 18), openbraceclasslineterm (rule 25), linetermclassclosebrace (rule 38), linetermarrayinitclosebrace (rule 40), openbraceblocklineterm (rule 45) and openbracearrayinitlineterm (rule 46).
Description: There should be a specified number of spaces between an empty opening parenthesis ('(') and closing parenthesis (')'). For instance, --openparenspacecloseparen=0 transforms intox = getStatus( ); x = getStatus(); Observe that this rule overrules the following rules that also deal with opening and closing parentheses: openparenspacestatspacecloseparen (rule 10), openparenspacegroupspacecloseparen (rule 29), openparenspacemethodspacecloseparen (rule 30) and openparenspacecastspacecloseparen (rule 31).
Description: There should be a specified number of line terminators before an opening bracket ('['). For instance, --linetermopenbracket=0 transforms intopublic LineMetrics getLineMetrics(char [] chars) { public LineMetrics getLineMetrics(char [] chars) {
Description: There should be a specified number of additional indentation levels before an opening brace ('{'), and the additional indentation holds for the duration of the block. For instance, --indentbraces=1 transforms intopublic LineMetrics getLineMetrics(char[] chars) { ... } public LineMetrics getLineMetrics(char[] chars) { ... } The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) and linetermblockopenbrace=1 (rule 16) at the same time.
Description: There should be a specified number of spaces after an opening bracket ('[') and before a closing bracket (']') of an array dimension. For instance, --openbracketspacedimspaceclosebracket=1 transforms intoString[] str = new String[10]; String[] str = new String[ 10 ];
Description: There should be a specified number of spaces after an opening bracket ('[') and before a closing bracket (']') of an array index. For instance, --openbracketspaceindexspaceclosebracket=1 transforms intoreturn str[i]; return str[ i ];
Description: There should be a specified number of spaces after an opening bracket ('[') and before a closing bracket (']') of an empty array dimension. For instance, --openbracketspaceclosebracket=1 transforms intoString[] str2 = new String[] {"foo", "bar",}; String[ ] str2 = new String[ ] {"foo", "bar",}; Declarations
Description: Each declaration should be followed by a specified number of line terminators. For instance, --decllineterm=1 transforms intoint x; int y; int x; int y; Note that this rule does not take into account multiple declarators on the same line (e.g., int x, y;). The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of line terminators after a list of modifiers ("public", "final", "synchronized", etc.). For instance, --modifierslineterm=0 transforms intopublic class ImageFormatException { public class ImageFormatException { This rule only applies to line terminators at the end of a list of modifiers, not to individual modifiers. If the value of this rule is unequal to zero, the best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of spaces after a list of modifiers ("public", "final", "synchronized", etc.). For instance, --modifiersspace=1 transforms intoprivate Color control = UIManager.getColor("control"); private Color control = UIManager.getColor("control"); This rule only applies to line spaces at the end of a list of modifiers, not to individual modifiers.
Description: There should be a specified number of spaces between a type and its name in a declaration. For instance, --typespacename=1 transforms intoint x; void method() {} int x; void method() {}
Description: There should be a specified number of spaces between the "class" keyword of a class declaration and its name. For instance, --classspacename=1 transforms intoclass Status {} class Status {}
Description: Use a specified number of line terminators before an open brace ('{') of a class or interface declaration. For instance, --linetermclassopenbrace=0 transforms intoclass Status { class Status { The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of line terminators after an open brace ('{') of a class or interface declarations. For instance,--openbraceclasslineterm=1 --indent transforms intopublic class Status { int val; } public class Status { int val; } The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of line terminators before a close brace ('}') of a class or interface declaration. For instance, --linetermclassclosebrace=1 transforms intoclass Status { int x; int y; } class Status { int x; int y; }
Description: There should be a specified number of spaces before an "extends" keyword of a class or interface declaration. For instance, --spaceextends=1 transforms intopublic class JFrame extends Frame { public class JFrame extends Frame {
Description: There should be a specified number of spaces after an "extends" keyword of a class or interface declaration. For instance, --extendsspace=1 transforms intopublic class JFrame extends Frame { public class JFrame extends Frame {
Description: There should be a specified number of line terminators before an "extends" keyword of a class or interface declaration. For instance, --linetermextends=0 transforms intoclass SpecialStatus extends Status { int z; } class SpecialStatus extends Status { int z; }
Description: There should be a specified number of line terminators before an "implements" keyword of a class declaration. For instance, --linetermimplements=1 --indent transforms intoclass Status implements Runnable { } class Status implements Runnable { }
Description: There should be a specified number of line terminators before a "throws" keyword of a constructor or method declaration. For instance, --linetermthrows=1 --indent transforms intopublic Remote lookup(String name) throws java.rmi.RemoteException; public Remote lookup(String name) throws java.rmi.RemoteException;
Description: There should be a specified number of line terminators before an open brace of a constructor or method declaration. For instance, --linetermmethodopenbrace=0 --indent transforms intopublic int getStatus() { return status; } public int getStatus() { return status; }
Description: There should be a specified number of line terminators after an open brace of a constructor or method declaration. For instance, --linetermmethodopenbrace=1 --indent transforms intopublic int getStatus() { return status; } public int getStatus() { return status; }
Description: There should be a specified number of line terminators before an open brace of a constructor or method declaration. For instance, --linetermmethodclosebrace=1 --indent transforms intopublic int getStatus() { return status; } public int getStatus() { return status; }
Description: The are should be a specified number of line terminators before the opening brace ('{') of an array initialization. For instance, --linetermarrayinitopenbrace=0 transforms intoint[] array = { 1, 2, 3 }; int[] array = { 1, 2, 3 }; The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of line terminators after an open brace ('{') of an array initialization. For instance,--openbracearrayinitlineterm=0 --indent transforms intoint[] array = { 1, 2, 3 }; int[] array = { 1, 2, 3 }; The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of line terminators before the closing brace ('}') of an array initialization. For instance, --linetermarrayinitclosebrace=0 transforms intoint[] array = { 1, 2, 3 }; int[] array = { 1, 2, 3 }; The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of line terminators after the closing brace ('}') of an array initialization. For instance, --arrayinitclosebracelineterm=0 transforms intoprocessArray(new Object[] {obj1, obj2, obj3} ); processArray(new Object[] {obj1, obj2, obj3});
Description: There should be a specified number of spaces after the opening brace ('{') and before the closing brace ('}') of an array initialization. For instance, --openbracespacearrayinitspaceclosebrace=0 transforms intoint[] array = { 1, 2, 3 }; int[] array = {1, 2, 3};
Description: There should be a specified number of line terminators after the return type of a method declaration. For instance, --returntypelineterm=0 transforms intopublic int getStatus() public int getStatus() Simple Statements
Description: Each statement should end with a specified number of line terminators. For instance, --statlineterm=1 --indent transforms intox = z; y = z; x = z; y = z; The statements of a for loop are not affected by this rule. The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of spaces between a method name and its following opening parenthesis in a method call. For instance, --methodcallspaceopenparen=0 transforms intox = length (y); x = length(y);
Description: There should be a specified number of line terminators at either side of a dot symbol ('.'). For instance, --linetermdotlineterm=0 transforms intox.value = y .value; x.value = y .value; The best results are obtained if this rule is applied in combination with spacedotspace (rule 7). The result of applying --linetermdotlineterm=0 --spacedotspace=0 to the previous example is x.value = y.value;
Description: There should be a specified number of line terminators before a comma (',') or semicolon (';'). For instance, --linetermsep=0 transforms intostatus = 0 ; status = 0 ; The best results are obtained if this rule is applied in combination with spacesep (rule 4). The result of applying --linetermsep=0 --spacesep=0 to the previous example is status = 0;
Description: There should be a specified number of line terminators before an infix operator. For instance, --lineterminfixop=0 transforms intoreturn square.length * square.width; return square.length * square.width;
Description: There should be a specified number of line terminators after an infix operator. For instance, --infixoplineterm=0 transforms intoreturn square.length * square.width; return square.length * square.width;
Description: There should be a specified number of line terminators after a prefix operator. For instance, --prefixoplineterm=0 transforms intoif (! (obj instanceof FilePermission)) { if (! (obj instanceof FilePermission)) {
Description: There should be a specified number of line terminators before a postfix operator. For instance, --linetermpostfixop=0 transforms intofor ( i = 0 ; i < currentSelection ; i ++ ) { for ( i = 0 ; i < currentSelection ; i ++ ) {
Description: There should be a specified number of line terminators before a comma in the argument list of a method or constructor invocation. For instance, --linetermcomma=0 transforms intovaporWare.sell("Product off the shelf", orderQuantity, customerCode , productCode, orderNumber); vaporWare.sell("Product off the shelf", orderQuantity, customerCode, productCode, orderNumber);
Description: There should be a specified number of line terminators after a comma in the argument list of a method or constructor invocation. For instance, --commalineterm=0 transforms intovaporWare.sell("Product off the shelf", orderQuantity, customerCode, productCode, orderNumber); vaporWare.sell("Product off the shelf", orderQuantity, customerCode, productCode, orderNumber);
Description: There should be a specified number of line terminators after the opening parenthesis of a method or constructor invocation. For instance, --openparenlineterm=0 transforms intovaporWare.sell( "Product off the shelf", orderQuantity, customerCode, productCode, orderNumber); vaporWare.sell("Product off the shelf", orderQuantity, customerCode, productCode, orderNumber);
Description: There should be a specified number of line terminators before the closing parenthesis of a method or constructor invocation. For instance, --linetermcloseparen=0 transforms intovaporWare.sell("Product off the shelf", orderQuantity, customerCode, productCode, orderNumber ); vaporWare.sell("Product off the shelf", orderQuantity, customerCode, productCode, orderNumber);
Description: There should be a specified number of line terminators after the assignment operator in an assignment statement. For instance, --assoplineterm=0 transforms intodelta = height - fontMetrics.getAscent() - fontMetrics.getDescent(); delta = height - fontMetrics.getAscent() - fontMetrics.getDescent(); Compound Statements
Description: Use a specified number of line terminators before an open brace ('{') of a block statement. For instance, --linetermblockopenbrace=0 transforms intoif (x == y) { if ( x == y ) { The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of line terminators after an open brace ('{') of a block statement. For instance,--openbraceblocklineterm=1 --indent transforms intowhile (x > 0) { x--; } while (x > 0) { x--; } The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a specified number of line terminators before a close brace ('}') of a block statement. For instance, --linetermblockclosebrace=1 transforms intowhile (x > 0) { x--; } while (x > 0) { x--; } The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: A control statement such as if, for, while should be followed by a block statement (a statement surrounded by braces ({ ... })). For instance, --insertbraces transforms intowhile (x > 0) x--; while (x > 0) { x--; } The best results are obtained by applying some of the following rules at the same time.
If Statements
Description: There should be a specified number of spaces before an else keyword. For instance, --spaceelse=1 transforms intoif (x > 0) { }else { } if (x > 0) { } else { }
Description: There should be a specified number of line terminators before an else keyword that is preceded by a block statement. For instance, --closebracelinetermelse=0 transforms intoif (x > 0) { } else { } if (x > 0) { } else { } Observe that this rule overrules rule closebracelineterm (rule 28).
Description: There should be a specified number of line terminators before an else keyword that is not preceded by a block statement. For instance, --semicolonlinetermelse=1 transforms intoif (x > 0) x = 0; else x = 1; if (x > 0) x = 0; else x = 1; Do-While Statements
Description: There should be a fixed number of line terminators after the closing brace of a do while loop. For instance, --closebracelinetermdowhile=0 transforms intodo { x++; } while (x < 10); do { x++; } while (x < 10); Switch Statements
Description: There should be a fixed number of blank lines before a case block in a switch statement (except for the first one). For instance, --blanklinescase=1 --indent transforms intoswitch ( x ) { case 1: return x + 1; case 2: return 5; } switch ( x ) { case 1: return x + 1; case 2: return 5; } No blank lines will be introduced before empty cases. Observe that this rule might interact with rule blanklinescomment (rule 21) in case comments are involved.The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: a case block is indented a fixed number of indentation levels. For instance, --indentcase=0 --indent transforms intoswitch ( x ) { case 1: return x + 1; case 2: return 5; switch ( x ) { case 1: return x + 1; case 2: return 5; Observe that this rule overrules indent (rule 1) and indenttab (rule 33). Try-Catch Statements
Description: There should be a specified number of spaces before a catch or finally keyword. For instance, --spacecatch=1 transforms intotry { input = readStream(reader); } catch (ReadException e) { } try { input = readStream(reader); } catch (ReadException e) { }
Description: There should be a specified number of line terminators before a catch or finally keyword. For instance, --linetermcatch=0 transforms intotry { input = readStream(reader); } catch (ReadException e) { } try { input = readStream(reader); } catch (ReadException e) { } Observe that this rule overrules rule closebracelineterm (rule 28). White Space
Description: Use a specific line terminator. This rule is parameterizable by the user: mode 1, replace each line terminator by carriage return (Macintosh style); mode 2, replace each line terminator by line feed (Unix style); mode 3, replace each line terminator by carriage return line feed (Windows style). The default mode, mode 0 is the mode for the platform you are using. Blank Lines
Description: There should be a fixed number of blank lines after a method declaration in a class (except for the last one). For instance, --methodblanklines=1 transforms intopublic void setValue(int i) { val = i; } public int getValue() { { return val; } public void setValue(int i) { val = i; } public int getValue() { return val; } Observe that this rule might interact with rule blanklinescomment (rule 21) in case comments are involved.
Description: There should be a fixed number of blank lines between declarations and statements. For instance, --declblanklinesstat=1 --indent transforms intopublic int factor(int i) { int j = length(i); return (j + 1) * (j - 1); } public int factor(int i) { int j = length(i); return (j + 1) * (j - 1); } Observe that this rule might interact with rule blanklinescomment (rule 21) in case comments are involved. The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a fixed number of blank lines before block comments (between '/*' and '*/') that start at the beginning of a line. For instance --blanklinescomment=1 --indent transforms intopublic int factor(int i) { /* introduce var j for sharing */ int j = length(i); public int factor(int i) { /* introduce var j for sharing */ int j = length(i); Observe that this rule might conflict with rules methodblanklines (rule 15), sectionblanklines (rule 23), classblanklines (rule 24) and blanklinescase (rule 27). The best results are obtained by applying rule indent (rule 1) or indenttab (rule 33) at the same time.
Description: There should be a fixed number of blank lines after package and import sections. For instance, --sectionblanklines=2 transforms intoimport java.util.Vector; public class Status { import java.util.Vector; public class Status { Observe that this rule might interact with rule blanklinescomment (rule 21) in case comments are involved.
Description: There should be a fixed number of blank lines after a class declaration (excluding the last one). For instance, --classblanklines=2 transforms intopublic class Status { } class SpecialStatus extends Status { } public class Status { } class SpecialStatus extends Status { } This rule also holds for inner classes. Observe that this rule might interact with rule blanklinescomment (rule 21) in case comments are involved. Spaces
Description: There should be a specified number of spaces between a Java keyword and a subsequent opening parenthesis '('. For instance, --keywordspaceopenparen=1 transforms intowhile(x > 0) while (x > 0)
Description: There should be a specified number of spaces between a method name and its formal parameter list in a method definition. For instance, --methodnamespace=0 transforms intopublic int length (int x, int y) public int length(int x, int y)
Description: There should be a specified number of spaces before a comma (',') or semicolon (';'). For instance, --spacesep=0 transforms intox = y ; x = y;
Description: There should be a specified number of spaces after a comma (',') or semicolon(';'). For instance, --sepspace=1 transforms intopublic int length(int x,int y) public int length(int x, int y)
Description: There should be a specified number of spaces at each side of a Java assignment operator. For instance, --spaceassignspace=1 transforms intox=y; x = y;
Description: There should be a specified number of spaces at either side of the dot operator ('.'). For instance, --spacedotspace=0 transforms intox . val = y . val; x.val = y.val;
Description: There should be a specified number of spaces after a Java prefix operator. For instance, --prefixopspace=0 transforms intox = - y; x = -y;
Description: There should be a specified number of spaces at each side of a Java infix operator. For instance, --spaceinfixopspace=1 transforms intox = y+z; x = y + z;
Description: There should be a specified number of spaces before a Java postfix operator. For instance, --spacepostfixop=0 transforms intox = y ++; x = y++;
Description: There should be a specified number of spaces after a cast. For instance, --castspace=1 transforms intox = (int)y; x = (int) y;
Description: There should be a specified number of spaces after an opening parenthesis ('(') and before a closing parenthesis (')') of a cast expression. For instance, --openparenspacecastspacecloseparen=0 transforms intox = ( int ) y; x = (int) y;
Description: There should be a specified number of spaces after an opening parenthesis ('(') and before a closing parenthesis (')') that occur in a statement context such as in conditions of an if or while statement. For instance, --openparenspacestatspacecloseparen=0 transforms intoif ( x == y ) if (x == y)
Description: There should be a specified number of spaces after an opening parenthesis ('(') and before a closing parenthesis (')') of a grouped expression. For instance, --openparenspacegroupspacecloseparen=0 transforms intox = ( y + z ) * ( x - z ); x = (y + z) * (x - z);
Description: There should be a specified number of spaces after an opening parenthesis ('(') and before a closing parenthesis (')') of a constuctor/method declarator/call. For instance, --openparenspacemethodspacecloseparen=0 transforms intopublic int length( int x, int y ) public int length(int x, int y)
Description: There shouldn't be horizontal spaces immediately in front of a line terminator. Note that horizontal spaces at the end of "end of line" comments are considered to be part of the comments. Hence, these will not be removed by this rule. Send mail to support@tiobe.com with questions or comments about this web site. Legal disclaimer: Sun, Sun Microsystems, the Sun Logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Sun Microsystems, Inc. in no way endorses or is affiliated with TIOBE Software. |