I'm using the following function to take a large array of strings (user names) and check them for single quotes, then push them into my new array and return that.
Recently, the number of users in this list increased dramatically (7418 currently) and now this function is getting an error:
Caused by: java.lang.ClassFormatError: Invalid method Code length 105684 in class file org/mozilla/javascript/gen/c135516
The version of javascript is embedded in the application so upgrading that is not an option at this time.
Is there a better way to do this? or a different way to try to avoid this error?
function listExcludedUsers(rInactive) {
var result = new Array('user1', 'user2', 'user3', 'user4');
for (var i = 0; i < rInactive.length; i++) {
//replace single quote with two single quotes for DQL
if (rInactive[i].indexOf("'") > 0) {
rInactive[i] = rInactive[i].replace(/'/g, "''");
}
result.push(rInactive[i]);
}
return result;
}