Changeset 9874 for trunk/indexers/mg/jni/MGWrapperImpl.c
- Timestamp:
- 2005-05-16T11:02:50+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/indexers/mg/jni/MGWrapperImpl.c
r8920 r9874 315 315 316 316 /* Check that the index was loaded successfully */ 317 assert(qd != NULL); 317 if (qd==NULL) { 318 return NULL; 319 } 320 /*assert(qd != NULL);*/ 318 321 319 322 /* Get the document position and length in the text file */ … … 372 375 jthrowable exc; 373 376 374 /* Make sure an index has been specified */ 375 index_path = data->queryInfo->index; 376 assert(index_path != NULL); 377 378 /* Obtain C versions of the two string parameters */ 379 base_dir = (*j_env)->GetStringUTFChars(j_env, j_base_dir, NULL); 380 if (base_dir == NULL) { 381 return; 382 } 383 text_path = (*j_env)->GetStringUTFChars(j_env, j_text_path, NULL); 384 if (text_path == NULL) { 385 (*j_env)->ReleaseStringUTFChars(j_env, j_base_dir, base_dir); 386 return; 387 } 388 389 /* Load the appropriate index for satisfying this request */ 390 qd = loadIndexData((char*) base_dir, (char*) index_path, (char*) text_path); 391 392 /* The C text strings are no longer needed */ 393 (*j_env)->ReleaseStringUTFChars(j_env, j_base_dir, base_dir); 394 (*j_env)->ReleaseStringUTFChars(j_env, j_text_path, text_path); 395 396 /* Check that the index was loaded successfully */ 397 assert(qd != NULL); 398 399 /* Remove anything hanging around from last time */ 400 FreeQueryDocs(qd); 401 377 /* First of all, clear the previous result */ 402 378 /* The result to write to */ 403 379 result_ptr = (*j_env)->GetObjectField(j_env, j_obj, FID_query_result); … … 411 387 return; 412 388 } 389 390 /* Make sure an index has been specified */ 391 index_path = data->queryInfo->index; 392 assert(index_path != NULL); 393 394 /* Obtain C versions of the two string parameters */ 395 base_dir = (*j_env)->GetStringUTFChars(j_env, j_base_dir, NULL); 396 if (base_dir == NULL) { 397 return; 398 } 399 text_path = (*j_env)->GetStringUTFChars(j_env, j_text_path, NULL); 400 if (text_path == NULL) { 401 (*j_env)->ReleaseStringUTFChars(j_env, j_base_dir, base_dir); 402 return; 403 } 404 405 /* Load the appropriate index for satisfying this request */ 406 qd = loadIndexData((char*) base_dir, (char*) index_path, (char*) text_path); 407 408 /* The C text strings are no longer needed */ 409 (*j_env)->ReleaseStringUTFChars(j_env, j_base_dir, base_dir); 410 (*j_env)->ReleaseStringUTFChars(j_env, j_text_path, text_path); 411 412 /* Check that the index was loaded successfully */ 413 if (qd == NULL) { 414 return; 415 } 416 /*assert(qd != NULL);*/ 417 418 /* Remove anything hanging around from last time */ 419 FreeQueryDocs(qd); 413 420 414 421 /* Obtain a C version of the query string */
Note:
See TracChangeset
for help on using the changeset viewer.