Code review - parse a query to arrays
The code as it is, is fine. The biggest point is that you should perform the .split("=") only once:

String[] parts = terms[i].split("=");
keys[i] = parts[0];
values[i] = parts[1];


However there is a more general point: Why are you using arrays? 

It's very unusual to use arrays at all in Java, especially in this case where you say yourself the input my be not well formed, possibly leaving you with gaps in the array, which you'll need to work around later. You should at least use Lists. Or even more fitting would be a Map (if the "keys" are unique):

String[] terms = query.split(",");
Map&lt;String, String&gt; map = new HashMap&lt;String, String&gt;(terms.length);

for (String term in terms)
{
    if(term.contains("="))
    {
        String[] parts = term.split("=");
        map.add(parts[0], parts[1]);
    }
}