{"action":"created","issue":{"url":"https://api.github.com/repos/apache/cloudstack/issues/714","labels_url":"https://api.github.com/repos/apache/cloudstack/issues/714/labels{/name}","comments_url":"https://api.github.com/repos/apache/cloudstack/issues/714/comments","events_url":"https://api.github.com/repos/apache/cloudstack/issues/714/events","html_url":"https://github.com/apache/cloudstack/pull/714","id":101677306,"number":714,"title":"Changed variable s_logger to non-static and fixed its name in “com.cloud.utils.component.ComponentLifecycleBase” and its subclasses","user":{"login":"pedro-martins","id":8620806,"avatar_url":"https://avatars.githubusercontent.com/u/8620806?v=3","gravatar_id":"","url":"https://api.github.com/users/pedro-martins","html_url":"https://github.com/pedro-martins","followers_url":"https://api.github.com/users/pedro-martins/followers","following_url":"https://api.github.com/users/pedro-martins/following{/other_user}","gists_url":"https://api.github.com/users/pedro-martins/gists{/gist_id}","starred_url":"https://api.github.com/users/pedro-martins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedro-martins/subscriptions","organizations_url":"https://api.github.com/users/pedro-martins/orgs","repos_url":"https://api.github.com/users/pedro-martins/repos","events_url":"https://api.github.com/users/pedro-martins/events{/privacy}","received_events_url":"https://api.github.com/users/pedro-martins/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":27,"created_at":"2015-08-18T15:02:19Z","updated_at":"2015-08-22T12:27:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/714","html_url":"https://github.com/apache/cloudstack/pull/714","diff_url":"https://github.com/apache/cloudstack/pull/714.diff","patch_url":"https://github.com/apache/cloudstack/pull/714.patch"},"body":"Hi guys, \r\nWe have noticed that every single class that is a subclass of “ComponentLifecycleBase” instantiate their on “logger” manually and uses a nonstandard name. We fixed that by changing the variable in “ComponentLifecycleBase” to protected and non-static and instantiated it using the method “getClass” from Object class. Therefore, we can reduce the code in a few hundred lines and use a more intuitive name for the logger variable.\r\n\r\nDuring that process we found a static method that used the “s_logger” variable in classes:\r\ncom.cloud.network.element.VirtualRouterElement \r\norg.apache.cloudstack.network.element.InternalLoadBalancerElement \r\n\r\nTo fix that we had to create a new class “com.cloud.network.element.HAProxyLBRule”, instantiate it with @Componente and inject into the aforementioned classes.\r\n\r\nThe class that we create is “com.cloud.network.element.HAProxyLBRule” and has the following methods:\r\ncom.cloud.network.element.HAProxyLBRule.containsOnlyNumbers(String, String)\r\ncom.cloud.network.element.HAProxyLBRule.validateHAProxyLBRule(LoadBalancingRule)\r\n\r\nSadly we could not write test cases to it; hence we did not fully understand those methods. However, if anyone out there understands it, we would appreciate some code to be added to it.\r\n\r\nAs minor this change may seem; we believe that it enhances a little bit the ACS code by using standard name to logger variable.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apache/cloudstack/issues/comments/133687118","html_url":"https://github.com/apache/cloudstack/pull/714#issuecomment-133687118","issue_url":"https://api.github.com/repos/apache/cloudstack/issues/714","id":133687118,"user":{"login":"asfbot","id":5243949,"avatar_url":"https://avatars.githubusercontent.com/u/5243949?v=3","gravatar_id":"","url":"https://api.github.com/users/asfbot","html_url":"https://github.com/asfbot","followers_url":"https://api.github.com/users/asfbot/followers","following_url":"https://api.github.com/users/asfbot/following{/other_user}","gists_url":"https://api.github.com/users/asfbot/gists{/gist_id}","starred_url":"https://api.github.com/users/asfbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asfbot/subscriptions","organizations_url":"https://api.github.com/users/asfbot/orgs","repos_url":"https://api.github.com/users/asfbot/repos","events_url":"https://api.github.com/users/asfbot/events{/privacy}","received_events_url":"https://api.github.com/users/asfbot/received_events","type":"User","site_admin":false},"created_at":"2015-08-22T12:27:12Z","updated_at":"2015-08-22T12:27:12Z","body":"[cloudstack-pull-rats #373](https://builds.apache.org/job/cloudstack-pull-rats/373/) FAILURE\nLooks like there's a problem with this pull request"}}