< prev index next >

src/hotspot/share/classfile/classLoader.cpp

Print this page

 187     return NULL;
 188   }
 189 
 190   int utf_len = name->utf8_length();
 191   const jbyte* base = (const jbyte*)name->base();
 192   const jbyte* start = base;
 193   const jbyte* end = UTF8::strrchr(start, utf_len, JVM_SIGNATURE_SLASH);
 194   if (end == NULL) {
 195     return NULL;
 196   }
 197   // Skip over '['s
 198   if (*start == JVM_SIGNATURE_ARRAY) {
 199     do {
 200       start++;
 201     } while (start < end && *start == JVM_SIGNATURE_ARRAY);
 202 
 203     // Fully qualified class names should not contain a 'L'.
 204     // Set bad_class_name to true to indicate that the package name
 205     // could not be obtained due to an error condition.
 206     // In this situation, is_same_class_package returns false.
 207     if (*start == JVM_SIGNATURE_CLASS) {
 208       if (bad_class_name != NULL) {
 209         *bad_class_name = true;
 210       }
 211       return NULL;
 212     }
 213   }
 214   // A class name could have just the slash character in the name,
 215   // in which case start > end
 216   if (start >= end) {
 217     // No package name
 218     if (bad_class_name != NULL) {
 219       *bad_class_name = true;
 220     }
 221     return NULL;
 222   }
 223   return SymbolTable::new_symbol(name, start - base, end - base);
 224 }
 225 
 226 // Given a fully qualified package name, find its defining package in the class loader's
 227 // package entry table.

 187     return NULL;
 188   }
 189 
 190   int utf_len = name->utf8_length();
 191   const jbyte* base = (const jbyte*)name->base();
 192   const jbyte* start = base;
 193   const jbyte* end = UTF8::strrchr(start, utf_len, JVM_SIGNATURE_SLASH);
 194   if (end == NULL) {
 195     return NULL;
 196   }
 197   // Skip over '['s
 198   if (*start == JVM_SIGNATURE_ARRAY) {
 199     do {
 200       start++;
 201     } while (start < end && *start == JVM_SIGNATURE_ARRAY);
 202 
 203     // Fully qualified class names should not contain a 'L'.
 204     // Set bad_class_name to true to indicate that the package name
 205     // could not be obtained due to an error condition.
 206     // In this situation, is_same_class_package returns false.
 207     if (*start == JVM_SIGNATURE_CLASS || *start == JVM_SIGNATURE_PRIMITIVE_OBJECT) {
 208       if (bad_class_name != NULL) {
 209         *bad_class_name = true;
 210       }
 211       return NULL;
 212     }
 213   }
 214   // A class name could have just the slash character in the name,
 215   // in which case start > end
 216   if (start >= end) {
 217     // No package name
 218     if (bad_class_name != NULL) {
 219       *bad_class_name = true;
 220     }
 221     return NULL;
 222   }
 223   return SymbolTable::new_symbol(name, start - base, end - base);
 224 }
 225 
 226 // Given a fully qualified package name, find its defining package in the class loader's
 227 // package entry table.
< prev index next >