Skip to content

Commit

Permalink
[GR-30306] generate catalog should fail fast on unexpected parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdedic committed Mar 26, 2021
1 parent 51689ee commit 539a922
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ public RuntimeException err(String messageKey, Object... args) {
Path listFrom = Paths.get(env.optValue("l"));
Files.walk(listFrom).filter((p) -> p.toString().endsWith(".jar")).forEach(
(p) -> locations.add(p.toString()));
} else {
while (env.hasParameter()) {
locations.add(env.nextParameter());
}
}
// process the rest of non-options parameters as locations.
while (env.hasParameter()) {
locations.add(env.nextParameter());
}

for (String spec : locations) {
Expand All @@ -271,6 +271,10 @@ public RuntimeException err(String messageKey, Object... args) {
if (!f.exists()) {
f = null;
u = spec;
// create an URI, just to fail fast, if URI is wrong:
URL check = new URL(spec);
// ... and use it somehow, so ECJ does not fail the gate.
assert check.toString() != null;
}
}
addComponentSpec(f, u);
Expand Down

0 comments on commit 539a922

Please sign in to comment.