|
5 | 5 | public class VendorParsingException extends Exception {
|
6 | 6 | public VendorParsingException(String file, VendorParsingError error) {
|
7 | 7 | switch (error) {
|
8 |
| - case NoMavenUrl: |
| 8 | + case NoMavenUrl -> { |
9 | 9 | System.err.println("The vendordep " + file + " is missing the required maven url.");
|
10 |
| - break; |
11 |
| - |
12 |
| - case MissingCppDeps: |
| 10 | + } |
| 11 | + case MissingCppDeps -> { |
13 | 12 | System.err.println("The vendordep " + file + " is missing the required C++ dependencies key.");
|
14 | 13 | System.err.println("If you would not like to declare any Cpp deps use an empty list.");
|
15 |
| - break; |
16 |
| - |
17 |
| - case MissingJniDeps: |
| 14 | + } |
| 15 | + case MissingJniDeps -> { |
18 | 16 | System.err.println("The vendordep " + file + " is missing the required Jni dependencies key.");
|
19 | 17 | System.err.println("If you would not like to declare any Jni deps use an empty list.");
|
20 |
| - break; |
21 |
| - |
22 |
| - case MissingJavaDeps: |
| 18 | + } |
| 19 | + case MissingJavaDeps -> { |
23 | 20 | System.err.println("The vendordep " + file + " is missing the required Java dependencies key.");
|
24 | 21 | System.err.println("If you would not like to declare any Java deps use an empty list.");
|
25 |
| - break; |
26 |
| - |
27 |
| - default: |
28 |
| - throw new BuildException( |
29 |
| - "Unhandled case in VendorParsingException. This is a bug and should be reported", |
30 |
| - new Exception()); |
| 22 | + } |
| 23 | + default -> throw new BuildException( |
| 24 | + "Unhandled case in VendorParsingException. This is a bug and should be reported", |
| 25 | + new Exception()); |
31 | 26 | }
|
32 | 27 | }
|
33 | 28 |
|
34 | 29 | // should only be called if we don't have access to a name yet
|
35 | 30 | public VendorParsingException(VendorParsingError error) {
|
36 | 31 | switch (error) {
|
37 |
| - case MissingName: |
| 32 | + case MissingName -> { |
38 | 33 | System.err.println("One of the vendordep files does not have a name");
|
39 |
| - break; |
40 |
| - |
41 |
| - default: |
42 |
| - throw new BuildException( |
43 |
| - "Unhandled case in VendorParsingException. This is a bug and should be reported", |
44 |
| - new Exception()); |
| 34 | + } |
| 35 | + default -> throw new BuildException( |
| 36 | + "Unhandled case in VendorParsingException. This is a bug and should be reported", |
| 37 | + new Exception()); |
45 | 38 | }
|
46 | 39 | }
|
47 | 40 | }
|
0 commit comments