You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by Dean Hiller <de...@xsoftware.biz> on 2005/01/16 23:09:25 UTC

what does [Ljava.lang.String; mean in 5.0jdk

I checked out source from bcel head, and compiled it.  When I tried my stuff out on jdk5.0, the following code starts failing(when processing the ConstantPool)

case Constants.CONSTANT_Class:
      int ind   = ((ConstantClass)c).getNameIndex();
      c   = pool.getConstant(ind, Constants.CONSTANT_Utf8);
      String className = Utility.compactClassName(((ConstantUtf8)c).getBytes(), false);
      log("      className="+className, Project.MSG_VERBOSE);
      design.checkClass(className);

Notice the className is  [Ljava.lang.String; in my logs which is unusual as this works fine in 1.4 where the classNames are java.lang.String etc.  How do I make it so I get the real className? instead of [Ljava.lang.String;

thanks,
dean


Re: what does [Ljava.lang.String; mean in 5.0jdk

Posted by Dave Brosius <db...@qis.net>.
There is no straightforward representation of a class that is an array. (for 
instance java doesn't use java.lang.String[] in the class file) So when an 
array needs to be referenced, it represented by the 'signature' version of 
the class name. The [ bracket means it's an array, the LXXX; means it's an 
object reference of type XXX.


----- Original Message ----- 
From: "Dean Hiller" <de...@xsoftware.biz>
To: "BCEL Users List" <bc...@jakarta.apache.org>
Sent: Sunday, January 16, 2005 5:09 PM
Subject: what does [Ljava.lang.String; mean in 5.0jdk


I checked out source from bcel head, and compiled it.  When I tried my stuff 
out on jdk5.0, the following code starts failing(when processing the 
ConstantPool)

case Constants.CONSTANT_Class:
      int ind   = ((ConstantClass)c).getNameIndex();
      c   = pool.getConstant(ind, Constants.CONSTANT_Utf8);
      String className = 
Utility.compactClassName(((ConstantUtf8)c).getBytes(), false);
      log("      className="+className, Project.MSG_VERBOSE);
      design.checkClass(className);

Notice the className is  [Ljava.lang.String; in my logs which is unusual as 
this works fine in 1.4 where the classNames are java.lang.String etc.  How 
do I make it so I get the real className? instead of [Ljava.lang.String;

thanks,
dean




---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org