Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5080 Payara logback libs produce NPE / FISH-1007 #5082

Merged
merged 3 commits into from
Jan 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,18 @@ public ConfigApplicationContainer load(ConfigContainer container,
// This is performed here so that the ApplicationContainer executes regardless of CDI extension state
final Types types = deploymentContext.getTransientAppMetaData(Types.class.getName(), Types.class);

final Type annotationType = types.getBy(ConfigProperty.class.getName());
final Type classType = types.getBy(Config.class.getName());
final boolean annotationFound = annotationType != null;
final boolean classFound = classType != null;
if (types != null) {
final Type annotationType = types.getBy(ConfigProperty.class.getName());
final Type classType = types.getBy(Config.class.getName());
final boolean annotationFound = annotationType != null;
final boolean classFound = classType != null;

if (annotationFound || classFound) {
// Register the CDI extension
final Collection<Supplier<Extension>> snifferExtensions = deploymentContext.getTransientAppMetaData(WeldDeployer.SNIFFER_EXTENSIONS, Collection.class);
if (snifferExtensions != null) {
snifferExtensions.add(ConfigCdiExtension::new);
if (annotationFound || classFound) {
// Register the CDI extension
final Collection<Supplier<Extension>> snifferExtensions = deploymentContext.getTransientAppMetaData(WeldDeployer.SNIFFER_EXTENSIONS, Collection.class);
if (snifferExtensions != null) {
snifferExtensions.add(ConfigCdiExtension::new);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import org.glassfish.api.deployment.DeploymentContext;
import org.glassfish.api.deployment.archive.ReadableArchive;
import org.glassfish.hk2.api.PerLookup;
import org.glassfish.hk2.classmodel.reflect.Type;
import org.glassfish.hk2.classmodel.reflect.Types;
import org.jvnet.hk2.annotations.Service;

Expand Down Expand Up @@ -90,8 +89,15 @@ public Class<? extends Annotation>[] getAnnotationTypes() {
public boolean handles(DeploymentContext context) {
final Types types = context.getTransientAppMetaData(Types.class.getName(), Types.class);

if (types.getBy(MetricRegistry.class.getName()) != null) return true;
if (types.getBy(Metric.class.getName()) != null) return true;
if (types != null) {
if (types.getBy(MetricRegistry.class.getName()) != null) {
return true;
}

if (types.getBy(Metric.class.getName()) != null) {
return true;
}
}

return super.handles(context);
}
Expand Down