Ignore:
Timestamp:
May 31, 2011, 3:30:49 AM (13 years ago)
Author:
djay
Message:

Merge trunk r111:r216 into branch-1.2

Location:
branches/branch-1.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1.2

  • branches/branch-1.2/zoo-kernel/service_internal_java.c

    r68 r217  
    22 * Author : Gérald FENOY
    33 *
    4  * Copyright (c) 2009-2010 GeoLabs SARL
     4 * Copyright (c) 2009-2011 GeoLabs SARL
    55 *
    66 * Permission is hereby granted, free of charge, to any person obtaining a copy
     
    118118
    119119      pValue=(*env)->CallStaticIntMethod(env,cls,pmid,arg1,arg2,arg3);
    120       if (pValue != NULL){
     120      if (pValue != (jint)NULL){
    121121        res=pValue;
    122122        m=mapsFromHashMap(env,arg1,scHashMapClass);
     
    233233  jobject scObject,scObject1;
    234234  if(scHashMapClass==NULL){
     235#ifdef DEBUG
    235236    fprintf(stderr,"Unable to load java.util.HashMap\n");
     237#endif
    236238    return NULL;
    237239  }
     
    239241  containsKey_mid = (*env)->GetMethodID(env, scHashMapClass, "containsKey", "(Ljava/lang/Object;)Z");
    240242  get_mid = (*env)->GetMethodID(env, scHashMapClass, "get", "(Ljava/lang/Object;)Ljava/lang/Object;");
     243
    241244  if(containsKey_mid==0){
     245#ifdef DEBUG
    242246    fprintf(stderr,"unable to load containsKey from HashMap object (%d) \n",entrySet_mid);
     247#endif
     248    return NULL;
    243249  }
    244250  if(get_mid==0){
     251#ifdef DEBUG
    245252    fprintf(stderr,"unable to load get from HashMap object (%d) \n",entrySet_mid);
     253#endif
     254    return NULL;
    246255  }
    247256  if(entrySet_mid==0){
     257#ifdef DEBUG
    248258    fprintf(stderr,"unable to load entrySet from HashMap object (%d) \n",entrySet_mid);
     259#endif
    249260    return NULL;
    250261  }
     
    296307    if((*env)->CallBooleanMethod(env,imap,containsKey_mid,(*env)->NewStringUTF(env,"size"))){
    297308      jobject sizeV=(*env)->CallObjectMethod(env, imap, get_mid,(*env)->NewStringUTF(env,"size"));
    298       jstring sizeVS=(*env)->GetStringUTFChars(env, sizeV, NULL);
     309      const char* sizeVS=(*env)->GetStringUTFChars(env, sizeV, NULL);
    299310      size=atoi(sizeVS);
    300311      fprintf(stderr,"SIZE : %s\n",sizeVS);
     312      (*env)->ReleaseStringUTFChars(env, sizeV, sizeVS);
    301313    }
    302314   
     
    306318      jobject jv=(*env)->CallObjectMethod(env,tmp1,getValue_mid);
    307319
    308       jstring jkd=(*env)->GetStringUTFChars(env, jk, NULL);
     320      const char* jkd=(*env)->GetStringUTFChars(env, jk, NULL);
    309321      if(size>=0 && strcmp(jkd,"value")==0){
    310         fprintf(stderr,"%s\n",jkd);
    311322        jobject value=(*env)->GetByteArrayElements(env, jv, NULL);
    312323        if(res==NULL){
     
    315326          addToMap(res,jkd,"");
    316327        }
    317         fprintf(stderr,"/%s\n",jkd);
    318328        map* tmpR=getMap(res,"value");
    319329        free(tmpR->value);
     
    321331        memmove(tmpR->value,value,size*sizeof(char));
    322332        tmpR->value[size]=0;
    323         fprintf(stderr,"/%s\n",jkd);
     333        char tmp[128];
     334        sprintf(tmp,"%d",size);
     335        addToMap(res,"size",tmp);
    324336      }
    325337      else{
    326         jstring jvd=(*env)->GetStringUTFChars(env, jv, NULL);
     338        const char* jvd=(*env)->GetStringUTFChars(env, jv, NULL);
    327339        if(res==NULL){
    328340          res=createMap(jkd,jvd);
     
    330342          addToMap(res,jkd,jvd);
    331343        }
    332         (*env)->ReleaseStringChars(env, jv, jvd);
     344        (*env)->ReleaseStringUTFChars(env, jv, jvd);
    333345      }
    334346
    335 #ifdef DEBUG
    336       fprintf(stderr,"%s %s\n",jkd,jvd);
    337 #endif
    338 
    339       (*env)->ReleaseStringChars(env, jk, jkd);
     347      (*env)->ReleaseStringUTFChars(env, jk, jkd);
    340348
    341349    }
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png