-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use HttpJsonRequest instead of HttpJsonHelper #1163
Conversation
ok |
Can we remove HttpJsonHelper after that? |
Yes, we can! |
@@ -95,8 +97,11 @@ public ServiceDescriptor getServiceDescriptor() throws IOException, ServerExcept | |||
myServiceDescriptor = serviceDescriptor; | |||
if (myServiceDescriptor == null) { | |||
try { | |||
myServiceDescriptor = serviceDescriptor = HttpJsonHelper.options(getServiceDescriptorClass(), baseUrl); | |||
} catch (NotFoundException | ConflictException | UnauthorizedException | ForbiddenException e) { | |||
myServiceDescriptor = serviceDescriptor = requestFactory.fromUrl(baseUrl) |
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.
WDYT about rewriting this method without myServiceDescriptor variable?
if (serviceDescriptor == null) {
synchronized (this) {
if (serviceDescriptor == null) {
try {
return serviceDescriptor = requestFactory.fromUrl(baseUrl)
.useOptionsMethod()
.request()
.as(getServiceDescriptorClass(), null);
} catch (NotFoundException | ConflictException | UnauthorizedException | ForbiddenException e) {
throw new ServerException(e.getServiceError());
}
}
}
}
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.
Looks OK for me from concurrency POW. @evoevodin WDYT?
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.
+1
LGTM |
ok |
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
cc3e3ce
to
0985c2f
Compare
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
Hi, |
@tareqhs Yes. If you want you can do so. |
@skabashnyuk @sleshchenko @evoevodin Please review