Turkish locale breaks uppercase
Review this Java request router that dispatches on an uppercased command keyword.
The service runs in pods whose locale is inherited from the host. QA in the US passes; a customer in Turkey reports that valid `insert`/`index` commands are rejected.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.
0:00 of about 18 min
Mark a line and say what kind of problem it is.0 findings
1void dispatch(Request req) {
2 String cmd = req.header("X-Command");
3 if (cmd == null) {
4 reject(req);
5 return;
6 }
7 switch (cmd.toUpperCase()) {
8 case "INSERT": doInsert(req); break;
9 case "INDEX": doIndex(req); break;
10 case "DELETE": doDelete(req); break;
11 default: reject(req);
12 }
13}
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.