cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [2/2] git commit: updated refs/heads/master to 08f2ec5
Date Mon, 18 Apr 2016 12:35:27 GMT
Merge pull request #1263 from rafaelweingartner/lrg-cs-hackday-018

Removed unused code from com.cloud.api.ApiServer**Removed \_ from variables names**: private
variables with \_ at the beginning is common in C++ but not in Java.

**Removed unused code from ApiServer:**
- com.cloud.api.ApiServer.getPluggableServices(): unused method;
- com.cloud.api.ApiServer.getApiAccessCheckers(): unused method;

**Methods and variables access level reviewed:**
- com.cloud.api.ApiServer.handleAsyncJobPublishEvent(String, String ,Object): this method
was private but the annotation @MessageHandler requests public methods, as can be seen in
org.apache.cloudstack.framework.messagebus.MessageDispatcher.buildHandlerMethodCache(Class\<?\>),
which searches methods with the @MessageHandler annotation and changes
it to be accessible (setAccessible(true)). Thus, there is no reason for handleAsyncJobPublishEvent
be a private method and lead some other dev to wrong conclusions about the use of the method;
- Global variables and methods called just by this class (ApiServer) were changed to private.

**Changed variables and methods from static to non-static (if possible):** as some variables/methods
are used just by one object of this class, instantiated by Spring, they were changed to non-static.

With that, calls from com.cloud.api.ApiServlet.ApiServlet() that used static methods from
ApiServer, were changed from ApiServer.\<staticMethodName\> to \_apiServer.\<methodName\>
that refers to the org.apache.cloudstack.api.ApiServerService interface. Thus, methods com.cloud.api.ApiServer.getJSONContentType()
and com.cloud.api.ApiServer.isSecureSessionCookieEnabled() had to be added in the interface
(org.apache.cloudstack.api.ApiServerService, interface implemented by class ApiServer).

* pr/1263:
  The goal of this PR is to review com.cloud.api.ApiServer class, with the following actions:

Signed-off-by: Will Stevens <williamstevens@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/08f2ec50
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/08f2ec50
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/08f2ec50

Branch: refs/heads/master
Commit: 08f2ec5044952c4c8dae4f9388558bba196767c1
Parents: 749b716 48888e7
Author: Will Stevens <williamstevens@gmail.com>
Authored: Mon Apr 18 08:34:53 2016 -0400
Committer: Will Stevens <williamstevens@gmail.com>
Committed: Mon Apr 18 08:34:53 2016 -0400

----------------------------------------------------------------------
 .../apache/cloudstack/api/ApiServerService.java |  14 +-
 server/src/com/cloud/api/ApiServer.java         | 312 +++++++++----------
 server/src/com/cloud/api/ApiServlet.java        | 106 +++----
 server/test/com/cloud/api/ApiServletTest.java   |  13 +-
 4 files changed, 223 insertions(+), 222 deletions(-)
----------------------------------------------------------------------



Mime
View raw message