gnodet-bot commented on code in PR #26864:
URL: https://github.com/apache/camel/pull/26864#discussion_r4105255409
##########
dsl/camel-jbang/camel-jbang-it/src/test/java/org/apache/camel/dsl/jbang/it/support/JBangTestSupport.java:
##########
@@ -107,9 +107,28 @@ protected void afterEach(TestInfo testInfo) {
// The JBang installation baseline is entirely hidden (.jbang/,
.bashrc, .camel-jbang/).
try {
execInContainer("find /home/jbang -maxdepth 1 -mindepth 1 -not
-name '.*' -exec rm -rf {} +");
- } catch (Exception e) {
+ } catch (Exception | AssertionError e) {
logger.debug("failed to clean up test files from /home/jbang:
{}", e.getMessage());
}
+ for (String key : new String[]{"runtime", "gav", "directory"}) {
+ try {
+ execute("config unset " + key);
+ } catch (Exception | AssertionError e) {
+ logger.debug("failed to unset config key {}: {}", key,
e.getMessage());
+ }
+ }
+ try {
+ String forceRunVersion =
System.getProperty(CliProperties.FORCE_RUN_VERSION, "");
+ if (!forceRunVersion.isEmpty()) {
+ execute("version set " + forceRunVersion);
+ } else {
+ execute("config unset camel-version");
+ }
+ } catch (Exception | AssertionError e) {
+ logger.debug("failed to reset camel-version: {}",
e.getMessage());
+ }
+ logger.debug("failed to reset config: {}", e.getMessage());
+ }
Review Comment:
🔴 **Compilation error — orphaned lines from the suggestion merge.**
These two lines are remnants of the old single `catch (Exception e)` block
that was replaced by the per-key loop above. After applying the suggestion, the
old catch body (`logger.debug("failed to reset config: ...")`) and its closing
brace were left behind.
- `e` is not in scope (the nearest `catch` already closed at line 129)
- The `}` on line 131 has no matching opening brace
This code will not compile. Delete both lines:
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]