equal
deleted
inserted
replaced
172 const CDesCArray& aNativeArray, TBool aConvertPIMNullArrayElements) |
172 const CDesCArray& aNativeArray, TBool aConvertPIMNullArrayElements) |
173 { |
173 { |
174 JELOG2(EPim); |
174 JELOG2(EPim); |
175 const TInt numElems = aNativeArray.Count(); |
175 const TInt numElems = aNativeArray.Count(); |
176 |
176 |
|
177 |
177 // Initializes the array with NULLs |
178 // Initializes the array with NULLs |
178 jobjectArray javaStringArray = aJniEnv->NewObjectArray(numElems, |
179 jobjectArray javaStringArray = aJniEnv->NewObjectArray(numElems, |
179 aJniEnv->FindClass("java/lang/String"), NULL); |
180 aJniEnv->FindClass("java/lang/String"), NULL); |
180 |
181 |
|
182 |
181 if (!javaStringArray) |
183 if (!javaStringArray) |
182 { |
184 { |
183 return NULL; |
185 return NULL; |
184 } |
186 } |
185 |
187 |
206 aJniEnv->SetObjectArrayElement(javaStringArray, i, javaElem); |
208 aJniEnv->SetObjectArrayElement(javaStringArray, i, javaElem); |
207 |
209 |
208 // Avoid running out of local references |
210 // Avoid running out of local references |
209 aJniEnv->DeleteLocalRef(javaElem); |
211 aJniEnv->DeleteLocalRef(javaElem); |
210 } |
212 } |
211 |
|
212 return javaStringArray; |
213 return javaStringArray; |
213 } |
214 } |
214 |
215 |
215 // End of File |
216 // End of File |