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

Static analysis spotbugs #458

Merged
merged 2 commits into from
Jul 6, 2021
Merged

Conversation

pankajagrawal16
Copy link
Contributor

@pankajagrawal16 pankajagrawal16 commented Jul 6, 2021

Issue #, if available:

Description of changes:

It will display failed checks like this. PR fixes all the spotbugs identified issues as well.

image

Checklist

Breaking change checklist

RFC issue #:

  • Migration process documented
  • Implement warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@pankajagrawal16 pankajagrawal16 force-pushed the static-analysis-spotbugs branch 8 times, most recently from f930cdf to 85f3469 Compare July 6, 2021 12:25
@aws-powertools aws-powertools deleted a comment from stevehouel Jul 6, 2021
@aws-powertools aws-powertools deleted a comment from stevehouel Jul 6, 2021
@pankajagrawal16 pankajagrawal16 force-pushed the static-analysis-spotbugs branch from 85f3469 to 60d85d3 Compare July 6, 2021 12:29
@pankajagrawal16 pankajagrawal16 force-pushed the static-analysis-spotbugs branch from 60d85d3 to b204d3f Compare July 6, 2021 12:32
@pankajagrawal16 pankajagrawal16 requested a review from msailes July 6, 2021 12:32
@@ -85,8 +85,13 @@ public void setSchemaVersion(SpecVersion.VersionFlag version) {
* @param <T> Must extends {@link BaseFunction}
*/
public <T extends BaseFunction> void addFunction(T function) {
configuration.functionRegistry().extend(function);
jmesPath = new JacksonRuntime(configuration, getObjectMapper());
FunctionRegistry functionRegistryWithExtendedFunctions = configuration.functionRegistry().extend(function);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a neat finding and was actually a bug

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


if (schema.startsWith(CLASSPATH)) {
String filePath = schema.substring(CLASSPATH.length());
try (InputStream schemaStream = ValidationAspect.class.getResourceAsStream(filePath)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This too

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@msailes msailes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pankajagrawal16 pankajagrawal16 merged commit 9d4d9fe into master Jul 6, 2021
@pankajagrawal16 pankajagrawal16 deleted the static-analysis-spotbugs branch July 6, 2021 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants