Skip to content

Commit

Permalink
Log exceptions
Browse files Browse the repository at this point in the history
Signed-off-by: Arjan Tijms <arjan.tijms@gmail.com>
  • Loading branch information
arjantijms committed May 23, 2022
1 parent 6aa4b03 commit 7ff2e2f
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.glassfish.weld.connector;

import static java.util.logging.Level.FINE;
import static org.glassfish.weld.connector.WeldUtils.EXPANDED_JAR_SUFFIX;
import static org.glassfish.weld.connector.WeldUtils.EXPANDED_RAR_SUFFIX;
import static org.glassfish.weld.connector.WeldUtils.JAR_SUFFIX;
Expand All @@ -36,6 +37,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.logging.Logger;

import org.glassfish.api.deployment.DeploymentContext;
import org.glassfish.api.deployment.archive.ArchiveType;
Expand All @@ -53,6 +55,7 @@
public class WeldSniffer extends GenericSniffer {

private static final String[] containers = { "org.glassfish.weld.WeldContainer" };
private static final Logger logger = Logger.getLogger(WeldSniffer.class.getName());

public WeldSniffer() {
// We do not haGenericSniffer(String containerName, String appStigma, String urlPattern
Expand Down Expand Up @@ -124,6 +127,7 @@ private boolean scanLibDir(DeploymentContext context, ReadableArchive archive, S
entryPresent = isArchiveCDIEnabled(context, jarInLib, META_INF_BEANS_XML);
jarInLib.close();
} catch (IOException e) {
logger.log(FINE, "", e);
}
}
}
Expand All @@ -137,7 +141,8 @@ protected boolean isEntryPresent(ReadableArchive archive, String entry) {
try {
entryPresent = archive.exists(entry);
} catch (IOException e) {
// ignore
// do not ignore
logger.log(FINE, "", e);
}
return entryPresent;
}
Expand All @@ -153,7 +158,8 @@ protected boolean isArchiveCDIEnabled(DeploymentContext context, ReadableArchive
} finally {
try {
beansXmlInputStream.close();
} catch (Exception ignore) {
} catch (Exception notignore) {
logger.log(FINE, "", notignore);
}
}
}
Expand Down Expand Up @@ -227,7 +233,8 @@ public String[] getAnnotationNames(DeploymentContext context) {
} finally {
try {
beansXmlInputStream.close();
} catch (IOException ignore) {
} catch (IOException notignore) {
logger.log(FINE, "", notignore);
}
}
}
Expand Down

0 comments on commit 7ff2e2f

Please sign in to comment.