This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cni converting String args[]


* Andrew Haley (aph@redhat.com) ha scritto:
>  >       arguments[i] = (char *) elements(argsElements[i]->getBytes());
> 
> If you want chars, you'll need an encoding -- elements returns a
> jchar*.  Try JvGetStringUTFRegion.

 ok, I'll let you know
 
>  > 
>  >  What am I missing?
> 
> I'm not exactly sure, but I wonder if something is being GCd under
> your feet.  Is everything here called from Java code, or do you have a
> pointer to a Java type stashed in native code somewhere?

 This method is called by a class constructor:

    public A(String[] args) {
        this.id = create();
        init(args);
    }

 where the args are given to this constructor directly by the static main
application method.
 
> Andrew.

 thanks,
 lj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]