cvs commit: jakarta-bcel/src/java/org/apache/bcel/util Class2HTML.java

[email protected]
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
mdahm       2003/09/03 00:27:31

  Modified:    src/java/org/apache/bcel/util Class2HTML.java
  Log:
  fixed byte[]
  
  Revision  Changes    Path
  1.3       +18 -8     jakarta-bcel/src/java/org/apache/bcel/util/Class2HTML.java
  
  Index: Class2HTML.java
  ===================================================================
  RCS file: /home/cvs/jakarta-bcel/src/java/org/apache/bcel/util/Class2HTML.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Class2HTML.java	23 May 2003 07:55:32 -0000	1.2
  +++ Class2HTML.java	3 Sep 2003 07:27:31 -0000	1.3
  @@ -206,16 +206,26 @@
       short_type = Utility.compactClassName(short_type, class_package + ".", true);
   
       int index = type.indexOf('['); // Type is an array?
  -    if(index > -1)
  -      type = type.substring(0, index); // Tack of the `['  		
  +    String base_type = type;
  +
  +    if (index > -1) {
  +      base_type = type.substring(0, index); // Tack of the `['  		
  +    }
   
       // test for basic type
  -    if(type.equals("int")  || type.equals("short") || type.equals("boolean") || type.equals("void")   ||
  -       type.equals("char") || type.equals("byte")  || type.equals("long")    || type.equals("double") ||
  -       type.equals("float"))
  +    if (base_type.equals("int")
  +      || base_type.equals("short")
  +      || base_type.equals("boolean")
  +      || base_type.equals("void")
  +      || base_type.equals("char")
  +      || base_type.equals("byte")
  +      || base_type.equals("long")
  +      || base_type.equals("double")
  +      || base_type.equals("float")) {
         return "<FONT COLOR=\"#00FF00\">" + type + "</FONT>";
  -    else
  -      return "<A HREF=\"" + type + ".html\" TARGET=_top>" + short_type + "</A>";
  +    } else {
  +      return "<A HREF=\"" + base_type + ".html\" TARGET=_top>" + short_type + "</A>";
  +    }
     }
   
     static String toHTML(String str) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.