This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 04953b79da6 (chores) init: prevent suppressing the propagation of
unhandled Throwables
04953b79da6 is described below
commit 04953b79da666123de3b70eece5844ed706c5ed3
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Mon Jan 9 10:45:40 2023 +0100
(chores) init: prevent suppressing the propagation of unhandled Throwables
---
.../apache/felix/bundleplugin/ManifestPlugin.java | 29 ++++++----------------
1 file changed, 8 insertions(+), 21 deletions(-)
diff --git
a/init/camel-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
b/init/camel-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
index 32308ce7370..366ae994c9b 100644
---
a/init/camel-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
+++
b/init/camel-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
@@ -106,9 +106,14 @@ public class ManifestPlugin extends BundlePlugin {
PatchedLog plog = new PatchedLog(getLog());
setLog(plog);
- Analyzer analyzer;
- try {
- analyzer = getAnalyzer(project, instructions, classpath);
+ try (Analyzer analyzer= getAnalyzer(project, instructions, classpath))
{
+ File outputFile = new File(manifestLocation, "MANIFEST.MF");
+
+ writeManifest(analyzer, outputFile, niceManifest, exportScr,
scrLocation, buildContext, getLog());
+
+ if (supportIncrementalBuild) {
+ writeIncrementalInfo(project);
+ }
} catch (FileNotFoundException e) {
throw new MojoExecutionException(
"Cannot find " + e.getMessage() + " (manifest goal must be
run after compile phase)", e);
@@ -121,24 +126,6 @@ public class ManifestPlugin extends BundlePlugin {
getLog().error("An internal error occurred", e);
throw new MojoExecutionException("Internal error in
maven-bundle-plugin", e);
}
-
- File outputFile = new File(manifestLocation, "MANIFEST.MF");
-
- try {
- writeManifest(analyzer, outputFile, niceManifest, exportScr,
scrLocation, buildContext, getLog());
-
- if (supportIncrementalBuild) {
- writeIncrementalInfo(project);
- }
- } catch (Exception e) {
- throw new MojoExecutionException("Error trying to write Manifest
to file " + outputFile, e);
- } finally {
- try {
- analyzer.close();
- } catch (IOException e) {
- throw new MojoExecutionException("Error trying to write
Manifest to file " + outputFile, e);
- }
- }
}
/**