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
PAYARA-1840 RAR detector now checks for all JCA annotations #1790
PAYARA-1840 RAR detector now checks for all JCA annotations #1790
Conversation
All archives are now checked for annotations, regardless of type
jenkins test please |
Quick build and test passed! |
@@ -151,8 +152,7 @@ public void scanArchive(ReadableArchive archive) { | |||
} finally { | |||
is.close(); | |||
} | |||
} else if (entryName.endsWith(".jar") && | |||
entryName.indexOf('/') == -1) { | |||
} else if (!entryName.contains("/")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why has this changed? It looks like it may produce side effects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because otherwise it will not scan non-jars for annotations. The code below it is in a try statement anyway so any problems will be caught.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side effect when calling jarSubArchive.entries().
com.sun.enterprise.deployment.deploy.shared.InputJarArchive#entries(boolean) does not throw an IOException but a RuntimeException. The effect is the exception is not catch by the inner try-catch bloc but the outer one, skipping all other entries in the archive.
javax.resource.spi.Connector.class}; | ||
javax.resource.spi.Connector.class, | ||
javax.resource.spi.ConfigProperty.class, | ||
javax.resource.spi.ConnectionDefinition.class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct as other applications can have these annotations and aren't rar files.
You need to see which ones are rar only and which ones can be used by clients of a rar
jenkins test please |
private static final Class[] connectorAnnotations = new Class[]{ | ||
javax.resource.spi.Connector.class}; | ||
javax.resource.spi.Connector.class, | ||
javax.resource.spi.ConfigProperty.class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ConfigProperty
is used in WARs which use Resource Adapters, I'd swap it for @Activation
Quick build and test passed! |
jenkins test please |
Quick build and test passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In GenericAnnotationDetector#scanArchive,, trying to read any non-.class file as zip archive has side effect
@@ -151,8 +152,7 @@ public void scanArchive(ReadableArchive archive) { | |||
} finally { | |||
is.close(); | |||
} | |||
} else if (entryName.endsWith(".jar") && | |||
entryName.indexOf('/') == -1) { | |||
} else if (!entryName.contains("/")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side effect when calling jarSubArchive.entries().
com.sun.enterprise.deployment.deploy.shared.InputJarArchive#entries(boolean) does not throw an IOException but a RuntimeException. The effect is the exception is not catch by the inner try-catch bloc but the outer one, skipping all other entries in the archive.
All archives are now checked for annotations, regardless of type