|
7 | 7 | {
|
8 | 8 | present: "assert",
|
9 | 9 | text: "The whole point of this exercise is to NOT use `assert` as a way to validate input from untrusted users.",
|
| 10 | + text_ja: "この演習の全体的なポイントは、信頼できないユーザーからの入力検証の手段として `assert` を使用しないことです。", |
10 | 11 | examples: [
|
11 | 12 | [ "assert !bindingResult.hasErrors();\n" ]
|
12 | 13 | ],
|
13 | 14 | },
|
14 | 15 | {
|
15 | 16 | absent: String.raw`^\s* if `,
|
16 | 17 | text: "Begin with `if` so you can return a result if there are errors.",
|
| 18 | + text_ja: "エラーがある場合に結果を返せるように `if` で始めてください。", |
17 | 19 | examples: [
|
18 | 20 | [ "return \"form\";" ]
|
19 | 21 | ],
|
20 | 22 | },
|
21 | 23 | {
|
22 | 24 | present: "(bindingresult|BindingResult)",
|
23 | 25 | text: "Java is case-sensitive. Use `bindingResult`, not `bindingresult` nor `BindingResult`.",
|
| 26 | + text_ja: "Java では大文字と小文字が区別されます。`bindingresult` や `BindingResult` ではなく `bindingResult` としてください。", |
24 | 27 | },
|
25 | 28 | {
|
26 | 29 | present: "(haserrors|HasErrors)",
|
27 | 30 | text: "Java is case-sensitive. Use `hasErrors`, not `haserrors` nor `HasErrors`.",
|
| 31 | + text_ja: "Java では大文字と小文字が区別されます。`haserrors` や `HasErrors` ではなく`hasErrors` としてください。", |
28 | 32 | },
|
29 | 33 | {
|
30 | 34 | present: String.raw`^\s*if\s*[^\(\s]`,
|
31 | 35 | text: "In Java, after the keyword `if` you must have an open left parenthesis. Conventionally there is one space between the `if` keyword and the open left parenthesis.",
|
| 36 | + text_ja: "Java では キーワード `if` のあとには左側カッコを置く必要があります。通常、`if` と左側カッコの間にはスペースを入れます。", |
32 | 37 | examples: [
|
33 | 38 | [ "if bindingResult.hasErrors" ]
|
34 | 39 | ],
|
35 | 40 | },
|
36 | 41 | {
|
37 | 42 | present: String.raw`^\s*if\s*\(\s*\!binding`,
|
38 | 43 | text: "You have an extraneous `!` (not operator). Use the expression if (bindingResult.hasErrors()) ...",
|
| 44 | + text_ja: "余計な `!`(NOT 演算子)があります。if (bindingResult.hasErrors()) ... という表記を使用してください。", |
39 | 45 | examples: [
|
40 | 46 | [ "if (!bindingResult.hasErrors())" ]
|
41 | 47 | ],
|
42 | 48 | },
|
43 | 49 | {
|
44 | 50 | absent: String.raw`^ if \( bindingResult \. hasErrors \( \) \) `,
|
45 | 51 | text: "Begin the answer with the text `if (bindingResult.hasErrors())` so that a statement will be executed if that condition is true.",
|
| 52 | + text_ja: "`if (bindingResult.hasErrors())` で始めてください。これで条件が真の場合にステートメントが実行されます。", |
46 | 53 | },
|
47 | 54 | {
|
48 | 55 | present: String.raw`if \( bindingResult \. hasErrors \( \) \) [^\{\s] `,
|
49 | 56 | text: "Follow the conditional with an open brace, e.g., `if (bindingResult.hasErrors()) {...`.",
|
| 57 | + text_ja: "左側中カッコを条件の後に続けてください。e.g., `if (bindingResult.hasErrors()) {...`.", |
50 | 58 | },
|
51 | 59 | {
|
52 | 60 | absent: String.raw`return "form"
|
53 | 61 | `,
|
54 | 62 | text: "You need to use `return \"form\";` somewhere.",
|
| 63 | + text_ja: "`return \"form\";` がどこかに必要です。", |
55 | 64 | },
|
56 | 65 | {
|
57 | 66 | present: String.raw`return "form"`,
|
58 | 67 | absent: String.raw`return "form" ;`,
|
59 | 68 | text: "You need to use `;` (semicolon) after `return \"form\"` because in Java statements must be followed by a semicolon.",
|
| 69 | + text_ja: "`return \"form\"` の後に `;`(セミコロン)が必要です。Java ではステートメントの後ろにセミコロンを置きます。", |
60 | 70 | },
|
61 | 71 | {
|
62 | 72 | absent: String.raw`\} $`,
|
63 | 73 | text: "The answer needs to end with `}` (closing brace).",
|
| 74 | + text_ja: "回答は `}`(右側中カッコ)で終わる必要があります。", |
64 | 75 | },
|
65 | 76 | ],
|
66 | 77 | expected: [
|
|
0 commit comments