79 if (_signature != NULL) { 80 _signature->decrement_refcount(); 81 } 82 } 83 84 void MethodMatcher::init(Symbol* class_name, Mode class_mode, 85 Symbol* method_name, Mode method_mode, 86 Symbol* signature) { 87 _class_mode = class_mode; 88 _method_mode = method_mode; 89 _class_name = class_name; 90 _method_name = method_name; 91 _signature = signature; 92 } 93 94 bool MethodMatcher::canonicalize(char * line, const char *& error_msg) { 95 char* colon = strstr(line, "::"); 96 bool have_colon = (colon != NULL); 97 if (have_colon) { 98 // Don't allow multiple '::' 99 if (colon + 2 != '\0') { 100 if (strstr(colon+2, "::")) { 101 error_msg = "Method pattern only allows one '::' allowed"; 102 return false; 103 } 104 } 105 106 bool in_signature = false; 107 char* pos = line; 108 if (pos != NULL) { 109 for (char* lp = pos + 1; *lp != '\0'; lp++) { 110 if (*lp == '(') { 111 break; 112 } 113 114 if (*lp == '/') { 115 error_msg = "Method pattern uses '/' together with '::'"; 116 return false; 117 } 118 } 119 } 120 } else { | 79 if (_signature != NULL) { 80 _signature->decrement_refcount(); 81 } 82 } 83 84 void MethodMatcher::init(Symbol* class_name, Mode class_mode, 85 Symbol* method_name, Mode method_mode, 86 Symbol* signature) { 87 _class_mode = class_mode; 88 _method_mode = method_mode; 89 _class_name = class_name; 90 _method_name = method_name; 91 _signature = signature; 92 } 93 94 bool MethodMatcher::canonicalize(char * line, const char *& error_msg) { 95 char* colon = strstr(line, "::"); 96 bool have_colon = (colon != NULL); 97 if (have_colon) { 98 // Don't allow multiple '::' 99 if (colon[2] != '\0') { 100 if (strstr(&colon[2], "::")) { 101 error_msg = "Method pattern only allows one '::' allowed"; 102 return false; 103 } 104 } 105 106 bool in_signature = false; 107 char* pos = line; 108 if (pos != NULL) { 109 for (char* lp = pos + 1; *lp != '\0'; lp++) { 110 if (*lp == '(') { 111 break; 112 } 113 114 if (*lp == '/') { 115 error_msg = "Method pattern uses '/' together with '::'"; 116 return false; 117 } 118 } 119 } 120 } else { |