185 |
185 |
186 if (bad_class_name != NULL) { |
186 if (bad_class_name != NULL) { |
187 *bad_class_name = false; |
187 *bad_class_name = false; |
188 } |
188 } |
189 |
189 |
190 const char* const last_slash = strrchr(class_name, '/'); |
190 const char* const last_slash = strrchr(class_name, JVM_SIGNATURE_SLASH); |
191 if (last_slash == NULL) { |
191 if (last_slash == NULL) { |
192 // No package name |
192 // No package name |
193 return NULL; |
193 return NULL; |
194 } |
194 } |
195 |
195 |
196 char* class_name_ptr = (char*) class_name; |
196 char* class_name_ptr = (char*) class_name; |
197 // Skip over '['s |
197 // Skip over '['s |
198 if (*class_name_ptr == '[') { |
198 if (*class_name_ptr == JVM_SIGNATURE_ARRAY) { |
199 do { |
199 do { |
200 class_name_ptr++; |
200 class_name_ptr++; |
201 } while (*class_name_ptr == '['); |
201 } while (*class_name_ptr == JVM_SIGNATURE_ARRAY); |
202 |
202 |
203 // Fully qualified class names should not contain a 'L'. |
203 // Fully qualified class names should not contain a 'L'. |
204 // Set bad_class_name to true to indicate that the package name |
204 // Set bad_class_name to true to indicate that the package name |
205 // could not be obtained due to an error condition. |
205 // could not be obtained due to an error condition. |
206 // In this situation, is_same_class_package returns false. |
206 // In this situation, is_same_class_package returns false. |
207 if (*class_name_ptr == 'L') { |
207 if (*class_name_ptr == JVM_SIGNATURE_CLASS) { |
208 if (bad_class_name != NULL) { |
208 if (bad_class_name != NULL) { |
209 *bad_class_name = true; |
209 *bad_class_name = true; |
210 } |
210 } |
211 return NULL; |
211 return NULL; |
212 } |
212 } |