mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Fix various Error Prone errors that were found by the FOSS build
Most common: - Unnecessary parentheses and operator precedence clarify (self-explanatory) - Reference equality--there were a few instances of using == or != improperly - Qualification of Builder (and similar) imports so that it's clear which type of Builder we're referring to - Marking some immutable classes with @Immutable since EP desires that all enums be deeply immutable - String.split() having "surprising behavior" ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=230971531
This commit is contained in:
parent
9cd37189c2
commit
3cf26ff9b6
52 changed files with 155 additions and 133 deletions
|
@ -30,6 +30,7 @@ import com.google.appengine.tools.pipeline.impl.servlets.PipelineServlet;
|
|||
import com.google.appengine.tools.pipeline.impl.servlets.TaskHandler;
|
||||
import com.google.apphosting.api.ApiProxy;
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.mapreduce.MapreduceRunner;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
|
@ -224,11 +225,11 @@ public abstract class MapreduceTestCase<T> extends ShardableTestCase {
|
|||
throws UnsupportedEncodingException {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
|
||||
String[] params = requestBody.split("&");
|
||||
Iterable<String> params = Splitter.on('&').split(requestBody);
|
||||
for (String param : params) {
|
||||
String[] pair = param.split("=");
|
||||
String name = pair[0];
|
||||
String value = URLDecoder.decode(pair[1], "UTF-8");
|
||||
List<String> pair = Splitter.on('=').splitToList(param);
|
||||
String name = pair.get(0);
|
||||
String value = URLDecoder.decode(pair.get(1), "UTF-8");
|
||||
if (result.containsKey(name)) {
|
||||
throw new IllegalArgumentException("Duplicate parameter: " + requestBody);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue