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

PAYARA-3723 Fixing sonar blocker bugs with unclosed resources and potential NPE #3868

Merged
merged 3 commits into from Apr 10, 2019

Conversation

Projects
None yet
6 participants
@svendiedrichsen
Copy link
Contributor

commented Mar 26, 2019

No description provided.

@Cousjava

This comment has been minimized.

Copy link
Member

commented Mar 27, 2019

Jenkins test please

@mulderbaba mulderbaba added this to the 5.192 milestone Mar 30, 2019

@Pandrex247
Copy link
Member

left a comment

Looks fine to me, just some formatting niggles

import org.glassfish.appclient.client.acc.JWSACCClassLoader;
import org.glassfish.appclient.common.Util;

import javax.swing.*;

This comment has been minimized.

Copy link
@Pandrex247

Pandrex247 Apr 3, 2019

Member

Minor point, but is this necessary? Aren't we only using one class from here?


private byte[] serialize(Object obj) throws IOException {
try(ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = getFactory().createObjectOutputStream(bos)) {

This comment has been minimized.

Copy link
@Pandrex247

Pandrex247 Apr 3, 2019

Member

Formatting is a little off here, makes this a bit hard to read as this line looks like it belongs with the ones below.

This comment has been minimized.

Copy link
@svendiedrichsen

svendiedrichsen Apr 3, 2019

Author Contributor

This is actually 2 Closables in one try-with-resources block. To have them both automatically closed. I have made now 2 try blocks to make clearer.

return JsonbBuilder
.create()
.fromJson(objectValue.toString(), type);
try(Jsonb jsonb = JsonbBuilder.create()) {

This comment has been minimized.

Copy link
@Pandrex247

Pandrex247 Apr 3, 2019

Member

Super minor, you missed a space between try and (

@@ -245,6 +243,12 @@ private AuthenticationStatus validateAuthorizationCode(HttpMessageContext httpCo
}
}

private JsonObject readJsonObject(String tokensBody) {
try(JsonReader reader = Json.createReader(new StringReader(tokensBody))) {

This comment has been minimized.

Copy link
@Pandrex247

Pandrex247 Apr 3, 2019

Member

Same as other comment, just nitpicking formatting here

@svendiedrichsen

This comment has been minimized.

Copy link
Contributor Author

commented Apr 3, 2019

@Pandrex247 I have made the requested code changes.

@Cousjava

This comment has been minimized.

Copy link
Member

commented Apr 9, 2019

Jenkins test please

@Pandrex247 Pandrex247 changed the title Fixing sonar blocker bugs with unclosed resources and potential NPE PAYARA-3723 Fixing sonar blocker bugs with unclosed resources and potential NPE Apr 10, 2019

@Pandrex247 Pandrex247 merged commit e797815 into payara:master Apr 10, 2019

59 checks passed

Payara Quick Build and Test Quick build and test passed!
Details
security/snyk - api/payara-api/pom.xml (payara-ci) No new issues
Details
security/snyk - api/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/admin/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/admingui/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ant-tasks/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/appclient/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/batch/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/common/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/concurrent/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/connectors/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/core/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/deployment/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ejb/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/extras/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/featuresets/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/flashlight/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/grizzly/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ha/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/installer/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/javaee-api/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/jdbc/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/jms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/load-balancer/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/orb/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/osgi-platforms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/packager/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/payara-appserver-modules/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/persistence/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/registration/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/resources/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/security/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/tests/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/transaction/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/web/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/webservices/pom.xml (payara-ci) No new issues
Details
security/snyk - copyright/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/admin/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/cluster/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/common/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/core/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/deployment/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/diagnostics/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/flashlight/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/grizzly/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/hk2/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/osgi-platforms/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/packager/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/payara-modules/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/resources-l10n/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/resources/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/security/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/test-utils/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/tests/pom.xml (payara-ci) No new issues
Details
security/snyk - pom.xml (payara-ci) No new issues
Details

@svendiedrichsen svendiedrichsen deleted the svendiedrichsen:sonar-blocker-npe branch Apr 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.