1 9 package org.infozone.tools.janalyzer; 10 11 import koala.dynamicjava.parser.wrapper.*; 12 import koala.dynamicjava.tree.*; 13 import java.util.List ; 14 import java.util.ListIterator ; 15 import java.io.File ; 16 import java.io.FileReader ; 17 import java.io.FileWriter ; 18 import java.io.BufferedReader ; 19 import java.io.BufferedWriter ; 20 21 22 59 public final class JavaCodeAnalyzer extends java.lang.Object { 60 61 65 66 68 private String outLine = ""; 69 70 private JavaCodeOutput jco; 71 72 private ExpressionHelper eh; 73 74 private int currentBinaryExpressionLevel = 0; 75 76 77 private boolean isInterface = false; 78 79 80 public JavaCodeAnalyzer( String filenameIn, String filenameOut, String lineLength ) { 81 83 try { 85 File tmp = File.createTempFile( "JavaCodeAnalyzer", "tmp" ); 88 BufferedReader br = new BufferedReader ( new FileReader ( filenameIn ) ); 89 BufferedWriter out = new BufferedWriter ( new FileWriter ( tmp ) ); 90 while (br.ready()) { 91 out.write( br.read() ); 92 } 93 br.close(); 94 out.close(); 95 96 jco = new JavaCodeOutput( tmp, filenameOut, lineLength ); 97 SourceCodeParser p = new JavaCCParserFactory().createParser( new FileReader ( tmp ), null ); 98 List statements = p.parseCompilationUnit(); 100 ListIterator it = statements.listIterator(); 101 eh = new ExpressionHelper( this, jco ); 102 Node n; 103 printLog( "Parsed file " + filenameIn + "\n" ); 104 while (it.hasNext()) { 105 n = (Node)it.next(); 106 parseObject( n ); 107 } 108 tmp.delete(); 109 } catch (Exception e) { 110 System.err.println( getClass() + ": " + e ); 111 } 112 } 113 114 115 124 protected void parseObject( Node aNode ) { 125 ListIterator it; 127 jco.setCommentEnd( aNode.getBeginLine() ); 129 printLog( aNode, "parseObject" + aNode ); 130 131 if (aNode instanceof PackageDeclaration) { 133 jco.printPackageComment( aNode ); 134 jco.setCommentStart( aNode.getBeginLine() ); 135 136 setToOut( "package " + jco.getHighSplitLevel() + ((PackageDeclaration)aNode).getName() + ";" ); 137 printOut(); 138 return; 139 } 140 if (aNode instanceof ImportDeclaration) { 142 jco.printImportComment( aNode ); 143 jco.setCommentStart( aNode.getBeginLine() ); 144 145 setToOut( "import " + jco.getHighSplitLevel() + ((ImportDeclaration)aNode).getName() ); 146 if (((ImportDeclaration)aNode).isPackage()) { 147 addToOut( ".*" ); 148 printLog( aNode, "import statement with *" ); 149 } 150 printOut( ";" ); 151 return; 152 } 153 if (aNode instanceof ClassDeclaration) { 155 ClassDeclaration classNode = (ClassDeclaration)aNode; 156 jco.printClassComment( classNode ); 157 jco.setCommentStart( aNode.getBeginLine() ); 158 159 160 isInterface = false; 162 setToOut( ConstantsManager.getModifierString( classNode.getAccessFlags() ) ); 164 addToOut( jco.getLowSplitLevel() + "class " + classNode.getName() + " " + jco.getHighSplitLevel() 166 + "extends " + classNode.getSuperclass() ); 167 List interfaces = classNode.getInterfaces(); 169 if (interfaces != null && !interfaces.isEmpty()) { 170 it = interfaces.listIterator(); 171 addToOut( " " + jco.getHighSplitLevel() + "implements " ); 172 while (it.hasNext()) { 173 addToOut( it.next() + "," + jco.getMiddleSplitLevel() + " " ); 174 } 175 if (getOut().endsWith( "," + jco.getMiddleSplitLevel() + " " )) { 176 setToOut( getOut().substring( 0, 177 getOut().length() - ("," + jco.getMiddleSplitLevel() + " ").length() ) ); 178 } 179 } 180 printOut( " {" ); 181 it = classNode.getMembers().listIterator(); 183 jco.increaseIndent(); 184 while (it.hasNext()) { 185 parseObject( (Node)it.next() ); 186 } 187 jco.setCommentEnd( aNode.getEndLine() ); 188 jco.printComment(); 189 jco.setCommentStart( aNode.getEndLine() ); 190 191 jco.decreaseIndent(); 192 printOut( "}" ); 193 return; 194 } 195 if (aNode instanceof InterfaceDeclaration) { 197 InterfaceDeclaration interfaceNode = (InterfaceDeclaration)aNode; 198 jco.printInterfaceComment( interfaceNode ); 199 jco.setCommentStart( aNode.getBeginLine() ); 200 201 202 isInterface = true; 204 setToOut( ConstantsManager.getModifierString( interfaceNode.getAccessFlags() ) ); 206 addToOut( jco.getLowSplitLevel() + "interface " + interfaceNode.getName() + " " ); 208 List interfaces = interfaceNode.getInterfaces(); 210 if (interfaces != null && !interfaces.isEmpty()) { 211 it = interfaces.listIterator(); 212 addToOut( jco.getHighSplitLevel() + "extends " ); 213 while (it.hasNext()) { 214 addToOut( it.next() + "," + jco.getMiddleSplitLevel() + " " ); 215 } 216 if (getOut().endsWith( "," + jco.getMiddleSplitLevel() + " " )) { 217 setToOut( getOut().substring( 0, 218 getOut().length() - ("," + jco.getMiddleSplitLevel() + " ").length() ) ); 219 } 220 } 221 printOut( " {" ); 222 it = interfaceNode.getMembers().listIterator(); 224 jco.increaseIndent(); 225 while (it.hasNext()) { 226 parseObject( (Node)it.next() ); 227 } 228 jco.setCommentEnd( aNode.getEndLine() ); 229 jco.printComment(); 230 jco.setCommentStart( aNode.getEndLine() ); 231 232 jco.decreaseIndent(); 233 printOut( "}" ); 234 return; 235 } 236 if (aNode instanceof FieldDeclaration) { 238 FieldDeclaration fieldNode = (FieldDeclaration)aNode; 239 jco.printFieldComment( fieldNode ); 240 jco.setCommentStart( aNode.getBeginLine() ); 241 242 setToOut( ConstantsManager.getModifierString( fieldNode.getAccessFlags() ) ); 244 addToOut( eh.getTypeString( fieldNode.getType() ) + " " ); 246 addToOut( fieldNode.getName() ); 248 if (fieldNode.getInitializer() != null) { 250 addToOut( " = " + jco.getHighSplitLevel() ); 251 eh.addSuperConditionString( fieldNode.getInitializer() ); 252 } 253 addToOut( ";" ); 254 printOut(); 255 return; 256 } 257 if (aNode instanceof VariableDeclaration) { 259 VariableDeclaration varNode = (VariableDeclaration)aNode; 261 jco.printVariableComment( varNode ); 262 jco.setCommentStart( aNode.getBeginLine() ); 263 264 setToOut( "" ); 265 if (varNode.isFinal()) { 266 addToOut( "final " ); 267 } 268 addToOut( eh.getTypeString( varNode.getType() ) + " " ); 270 addToOut( varNode.getName() ); 272 if (varNode.getInitializer() != null) { 274 addToOut( " = " + jco.getHighSplitLevel() ); 275 eh.addSuperConditionString( varNode.getInitializer() ); 276 } 277 addToOut( ";" ); 278 printOut(); 279 return; 280 } 281 282 if (aNode instanceof MethodDeclaration) { 283 MethodDeclaration methodNode = (MethodDeclaration)aNode; 284 jco.printMethodComment( methodNode ); 285 jco.setCommentStart( aNode.getBeginLine() ); 286 287 setToOut( ConstantsManager.getModifierString( methodNode.getAccessFlags() ) ); 289 addToOut( eh.getTypeString( methodNode.getReturnType() ) + " " ); 291 addToOut( methodNode.getName() + "(" + getParametersString( methodNode.getParameters() ) + ")" ); 293 it = methodNode.getExceptions().listIterator(); 295 if (it.hasNext()) { 296 addToOut( " " + jco.getHighSplitLevel() + "throws" ); 297 } 298 while (it.hasNext()) { 299 addToOut( " " + (String )it.next() + "," + jco.getMiddleSplitLevel() ); 300 } 301 if (getOut().endsWith( "," + jco.getMiddleSplitLevel() )) { 302 setToOut( getOut().substring( 0, getOut().length() - ("," + jco.getMiddleSplitLevel()).length() ) ); 303 } 304 305 if (ConstantsManager.getModifierString( methodNode.getAccessFlags() ).indexOf( "abstract" ) == -1 307 && !isInterface) { 308 parseObject( methodNode.getBody() ); 314 jco.setCommentEnd( aNode.getEndLine() ); 316 jco.printComment(); 317 jco.setCommentStart( aNode.getEndLine() ); 318 319 printOut(); 322 } else { 323 addToOut( ";" ); 325 printOut(); 327 } 328 return; 329 } 330 if (aNode instanceof ConstructorDeclaration) { 332 ConstructorDeclaration constructorNode = (ConstructorDeclaration)aNode; 333 jco.printConstructorComment( constructorNode ); 334 jco.setCommentStart( aNode.getBeginLine() ); 335 336 setToOut( ConstantsManager.getModifierString( constructorNode.getAccessFlags() ) ); 338 addToOut( constructorNode.getName() + "(" + getParametersString( constructorNode.getParameters() ) + ") " ); 340 it = constructorNode.getExceptions().listIterator(); 342 if (it.hasNext()) { 343 addToOut( jco.getHighSplitLevel() + "throws " ); 344 } 345 while (it.hasNext()) { 346 addToOut( (String )it.next() + "," + jco.getMiddleSplitLevel() + " " ); 347 } 348 if (getOut().endsWith( "," + jco.getMiddleSplitLevel() + " " )) { 349 setToOut( getOut().substring( 0, 350 getOut().length() - ("," + jco.getMiddleSplitLevel() + " ").length() ) ); 351 } 352 addToOut( "{" ); 353 printOut(); 354 jco.increaseIndent(); 356 if (constructorNode.getConstructorInvocation() != null) { 358 parseObject( constructorNode.getConstructorInvocation() ); 359 } 360 it = constructorNode.getStatements().listIterator(); 363 while (it.hasNext()) { 364 parseObject( (Node)it.next() ); 365 } 366 jco.setCommentEnd( aNode.getEndLine() ); 367 jco.printComment(); 368 jco.setCommentStart( aNode.getEndLine() ); 369 370 jco.decreaseIndent(); 371 printOut( "}" ); 372 return; 373 } 374 if (aNode instanceof ConstructorInvocation) { 376 ConstructorInvocation ci = (ConstructorInvocation)aNode; 377 378 if (ci.isSuper()) { 379 setToOut( "super(" ); 380 } else { 381 setToOut( "this(" ); 382 } 383 eh.addConditionListString( ci.getArguments() ); 384 printOut( ");" ); 385 return; 386 } 387 388 if (aNode instanceof ClassInitializer) { 390 ClassInitializer ci = (ClassInitializer)aNode; 391 jco.printComment(); 392 jco.setCommentStart( aNode.getBeginLine() ); 393 394 setToOut( "static" ); 395 if (ci.getBlock() != null) { 400 parseObject( ci.getBlock() ); 401 } 402 jco.setCommentEnd( aNode.getEndLine() ); 404 jco.printComment(); 405 jco.setCommentStart( aNode.getEndLine() ); 406 printOut(); 408 return; 409 } 410 411 415 if (aNode instanceof BlockStatement) { 418 printOut( " {" ); 419 jco.increaseIndent(); 420 it = ((BlockStatement)aNode).getStatements().listIterator(); 421 while (it.hasNext()) { 422 parseObject( (Node)it.next() ); 423 } 424 jco.decreaseIndent(); 426 setToOut( "} " ); 427 jco.setCommentEnd( aNode.getEndLine() ); 429 jco.printComment(); 430 jco.setCommentStart( aNode.getEndLine() ); 431 432 return; 433 } 434 435 jco.printComment(); 437 jco.setCommentStart( aNode.getBeginLine() ); 438 439 440 if (aNode instanceof EmptyStatement) { 443 printLog( aNode, "empty statement." ); 444 printOut( ";" ); 445 return; 446 } 447 if (aNode instanceof ReturnStatement) { 449 setToOut( "return" ); 450 if (((ReturnStatement)aNode).getExpression() != null) { 451 addToOut( " " + jco.getMiddleSplitLevel() ); 452 eh.addSuperConditionString( ((ReturnStatement)aNode).getExpression() ); 453 } 454 addToOut( ";" ); 455 printOut(); 456 return; 457 } 458 459 if (aNode instanceof IfThenElseStatement) { 460 setToOut( "if (" ); 463 eh.addSuperConditionString( ((IfThenElseStatement)aNode).getCondition() ); 464 addToOut( ")" ); 465 insertBlockStatement( ((IfThenElseStatement)aNode).getThenStatement() ); 466 467 printNestedIfThenElse( ((IfThenElseStatement)aNode).getElseStatement() ); 469 printOut(); 470 return; 471 } 472 if (aNode instanceof IfThenStatement) { 473 setToOut( "if (" ); 476 eh.addSuperConditionString( ((IfThenStatement)aNode).getCondition() ); 477 addToOut( ")" ); 478 insertBlockStatement( ((IfThenStatement)aNode).getThenStatement() ); 480 481 printOut(); 482 return; 483 } 484 if (aNode instanceof SynchronizedStatement) { 486 setToOut( "synchronized (" ); 489 eh.addSuperConditionString( ((SynchronizedStatement)aNode).getLock() ); 490 addToOut( ")" ); 491 parseObject( ((SynchronizedStatement)aNode).getBody() ); 494 printOut(); 496 return; 497 } 498 if (aNode instanceof WhileStatement) { 501 WhileStatement ws = (WhileStatement)aNode; 502 setToOut( "while (" ); 503 eh.addSuperConditionString( ws.getCondition() ); 504 addToOut( ")" ); 505 if (ws.getBody() instanceof EmptyStatement || ws.getBody() instanceof BlockStatement 507 && ((BlockStatement)ws.getBody()).getStatements().size() < 1) { 508 printOut( ";" ); 509 } else { 510 insertBlockStatement( ws.getBody() ); 511 printOut(); 512 } 513 return; 514 } 515 if (aNode instanceof DoStatement) { 517 setToOut( "do" ); 518 parseObject( ((DoStatement)aNode).getBody() ); 520 addToOut( "while (" ); 522 eh.addSuperConditionString( ((DoStatement)aNode).getCondition() ); 523 addToOut( ");" ); 524 printOut(); 525 return; 526 } 527 if (aNode instanceof ForStatement) { 529 ForStatement fs = (ForStatement)aNode; 530 setToOut( "for (" ); 531 532 addVariableDeclarationListString( fs.getInitialization() ); 534 addToOut( ";" ); 535 if (fs.getCondition() != null) { 536 addToOut( " " ); 537 } 538 eh.addSuperConditionString( fs.getCondition() ); 540 addToOut( ";" ); 541 eh.addConditionListString( fs.getUpdate(), false ); 543 addToOut( ")" ); 544 if (fs.getBody() instanceof EmptyStatement || fs.getBody() instanceof BlockStatement 546 && ((BlockStatement)fs.getBody()).getStatements().size() < 1) { 547 printOut( ";" ); 548 } else { 549 insertBlockStatement( fs.getBody() ); 550 printOut(); 552 } 558 return; 559 } 560 if (aNode instanceof SwitchStatement) { 562 SwitchStatement ss = (SwitchStatement)aNode; 563 setToOut( "switch (" ); 564 eh.addSuperConditionString( ss.getSelector() ); 565 addToOut( ") {" ); 566 printOut(); 567 it = ss.getBindings().listIterator(); 569 while (it.hasNext()) { 571 parseObject( (Node)it.next() ); 572 } 573 jco.setCommentEnd( aNode.getEndLine() ); 574 jco.printComment(); 575 jco.setCommentStart( aNode.getEndLine() ); 576 printOut( "}" ); 577 return; 578 } 579 if (aNode instanceof SwitchBlock) { 581 SwitchBlock sb = (SwitchBlock)aNode; 582 if (sb.getExpression() != null) { 583 setToOut( "case " ); 584 eh.addSuperConditionString( sb.getExpression() ); 585 addToOut( ":" ); 586 } else { 587 setToOut( "default:" ); 588 } 589 if (sb.getStatements() != null) { 591 592 it = sb.getStatements().listIterator(); 594 if (it.hasNext()) { 596 Node node = (Node)it.next(); 597 if (node instanceof BlockStatement) { 598 parseObject( node ); 600 jco.increaseIndent(); 601 printOut(); 602 jco.decreaseIndent(); 603 } else { 604 printOut(); 605 jco.increaseIndent(); 606 parseObject( node ); 607 jco.decreaseIndent(); 608 } 609 } 610 while (it.hasNext()) { 612 Node node = (Node)it.next(); 613 jco.increaseIndent(); 614 parseObject( node ); 615 jco.decreaseIndent(); 616 if (node instanceof BlockStatement) { 617 jco.increaseIndent(); 619 printOut(); 620 jco.decreaseIndent(); 621 } 622 } 623 jco.setCommentEnd( aNode.getEndLine() ); 625 jco.printComment(); 626 jco.setCommentStart( aNode.getEndLine() ); 627 628 } else { 630 printOut(); 632 } 633 return; 634 } 635 636 if (aNode instanceof TryStatement) { 638 TryStatement tryS = (TryStatement)aNode; 639 setToOut( "try" ); 641 parseObject( tryS.getTryBlock() ); 643 it = tryS.getCatchStatements().listIterator(); 647 while (it.hasNext()) { 648 parseObject( (Node)it.next() ); 649 } 650 651 if (tryS.getFinallyBlock() != null) { 653 addToOut( "finally" ); 654 parseObject( ((TryStatement)aNode).getFinallyBlock() ); 656 657 printOut(); 659 660 } else { 661 printOut(); 662 } 663 return; 664 } 665 if (aNode instanceof CatchStatement) { 666 addToOut( "catch (" ); 669 FormalParameter fp = ((CatchStatement)aNode).getException(); 671 addToOut( eh.getTypeString( fp.getType() ) + " " + fp.getName() + ")" ); 672 674 parseObject( ((CatchStatement)aNode).getBlock() ); 676 return; 679 } 680 if (aNode instanceof ThrowStatement) { 682 setToOut( "throw " ); 683 eh.addSuperConditionString( ((ThrowStatement)aNode).getExpression() ); 684 printOut( ";" ); 685 return; 686 } 687 688 if (aNode instanceof ContinueStatement) { 691 printOut( "continue;" ); 692 return; 693 } 694 if (aNode instanceof BreakStatement) { 696 printOut( "break;" ); 697 return; 698 } 699 701 702 if (aNode instanceof Expression) { 704 setToOut( "" ); 705 eh.addSuperConditionString( (Expression)aNode ); 706 addToOut( ";" ); 707 printOut(); 708 return; 709 } 710 printErr( aNode, "parseObject Node " + aNode + " not found on line " + aNode.getBeginLine() ); 712 return; 713 } 714 715 716 719 private void insertBlockStatement( Node node ) { 720 if (node instanceof BlockStatement) { 722 parseObject( node ); 724 } else { 725 printOut( " {" ); 726 jco.increaseIndent(); 727 parseObject( node ); 728 jco.decreaseIndent(); 729 setToOut( "} " ); 730 } 731 } 732 733 734 737 private void printNestedIfThenElse( Node aNode ) { 738 if (aNode instanceof IfThenElseStatement) { 740 addToOut( "else if (" ); 741 eh.addSuperConditionString( ((IfThenElseStatement)aNode).getCondition() ); 742 addToOut( ")" ); 743 insertBlockStatement( ((IfThenElseStatement)aNode).getThenStatement() ); 745 if (((IfThenElseStatement)aNode).getElseStatement() instanceof IfThenElseStatement) { 747 printNestedIfThenElse( ((IfThenElseStatement)aNode).getElseStatement() ); 748 } else { 749 addToOut( "else" ); 751 insertBlockStatement( ((IfThenElseStatement)aNode).getElseStatement() ); 753 } 755 } else { 756 addToOut( "else" ); 758 insertBlockStatement( aNode ); 760 } 762 } 763 764 765 772 private String getParametersString( List someParameters ) { 773 boolean findSome = false; 774 String ret = ""; 775 if (someParameters != null) { 776 ret += jco.getLowSplitLevel(); 778 ListIterator it = someParameters.listIterator(); 780 while (it.hasNext()) { 781 findSome = true; 782 ret += " "; 783 FormalParameter param = (FormalParameter)it.next(); 784 if (param.isFinal()) { 785 ret += "final "; 786 } 787 ret += eh.getTypeString( param.getType() ) + " " + param.getName() + "," + jco.getMiddleSplitLevel(); 788 } 789 if (ret.endsWith( "," + jco.getMiddleSplitLevel() )) { 790 ret = ret.substring( 0, ret.length() - ("," + jco.getMiddleSplitLevel()).length() ); 791 } 792 } 793 if (findSome) { 794 ret += " "; 795 } 796 return ret; 797 } 798 799 800 807 private void addVariableDeclarationListString( List someParameters ) { 808 Node node; 809 if (someParameters != null) { 810 addToOut( jco.getLowSplitLevel() ); 812 ListIterator it = someParameters.listIterator(); 814 if (it.hasNext()) { 815 node = (Node)it.next(); 817 if (node instanceof VariableDeclaration) { 818 VariableDeclaration vd = (VariableDeclaration)node; 819 if (vd.isFinal()) { 820 addToOut( "final " ); 821 } 822 addToOut( eh.getTypeString( vd.getType() ) + " " ); 824 addToOut( vd.getName() ); 826 if (vd.getInitializer() != null) { 828 addToOut( " = " + jco.getHighSplitLevel() ); 829 eh.addSuperConditionString( vd.getInitializer() ); 830 } 831 } else { 832 eh.addSuperConditionString( (Expression)node ); 833 } 834 addToOut( "," + jco.getMiddleSplitLevel() + " " ); 835 } 836 while (it.hasNext()) { 837 node = (Node)it.next(); 839 if (node instanceof VariableDeclaration) { 840 VariableDeclaration vd = (VariableDeclaration)node; 841 addToOut( vd.getName() ); 843 if (vd.getInitializer() != null) { 845 addToOut( " = " + jco.getHighSplitLevel() ); 846 eh.addSuperConditionString( vd.getInitializer() ); 847 } 848 } else { 849 eh.addSuperConditionString( (Expression)node ); 850 } 851 addToOut( "," + jco.getMiddleSplitLevel() + " " ); 852 } 853 if (getOut().endsWith( "," + jco.getMiddleSplitLevel() + " " )) { 854 setToOut( getOut().substring( 0, 855 getOut().length() - ("," + jco.getMiddleSplitLevel() + " ").length() ) ); 856 } 857 } 858 } 859 860 861 865 866 870 public void addToOut( String add ) { 871 outLine += add; 872 } 873 874 875 public void setToOut( String string ) { 876 outLine = string; 877 } 878 879 880 public void printOut() { 881 jco.println( outLine ); 882 setToOut( "" ); 883 } 884 885 886 892 public void printOut( String add ) { 893 addToOut( add ); 894 printOut(); 895 } 896 897 898 public String getOut() { 899 return outLine; 900 } 901 902 903 908 private void printLog( Node aNode, String aLine ) { 909 ; 911 } 912 913 914 private void printLog( String aLine ) { 915 ; 917 } 918 919 920 925 private void printErr( Node aNode, String aLine ) { 926 System.err.println( getClass() + " ERROR: " + aLine ); 927 } 928 929 930 931 public static void printHelp() { 932 System.out.println( "usage: jAnalyzer [-o=<outputfile>|-] [-linelength=<number>] [-h|-?|-help] inputfile" ); 933 } 934 935 936 940 public static void main( String [] argv ) { 941 String fileIn = null; 942 String fileOut = null; 943 String lineLength = null; 944 945 int i = 0; 946 if (argv.length > 0) { 947 for (i = 0; i < argv.length; i++) { 948 if (argv[i].startsWith( "-o=" )) { 949 fileOut = argv[i].substring( "-o=".length() ); 950 continue; 951 } 952 if (argv[i].startsWith( "-linelength=" )) { 953 lineLength = argv[i].substring( "-linelength=".length() ); 954 continue; 955 } 956 if (argv[i].equals( "-h" ) || argv[i].equals( "-?" ) || argv[i].equals( "-help" )) { 957 printHelp(); 958 System.exit( 0 ); 959 } 960 fileIn = argv[i]; 962 break; 963 } 964 } 965 if (fileIn == null) { 966 printHelp(); 967 System.exit( 0 ); 968 } 969 if (fileOut != null && fileOut.equals( "-" )) { 970 new JavaCodeAnalyzer( fileIn, fileIn, lineLength ); 971 } else { 972 new JavaCodeAnalyzer( fileIn, fileOut, lineLength ); 973 } 974 975 976 if (fileOut != null && fileOut.equals( "-" )) { 978 while (i < argv.length) { 979 new JavaCodeAnalyzer( argv[i], argv[i], lineLength ); 980 i++; 981 } 982 } else { 983 while (i < argv.length) { 984 new JavaCodeAnalyzer( argv[i], fileOut, lineLength ); 985 i++; 986 } 987 } 988 } 989 } 990 | Popular Tags |