You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by DaanHoogland <gi...@git.apache.org> on 2015/06/19 13:48:21 UTC

[GitHub] cloudstack pull request: findbugs UC useless condition

GitHub user DaanHoogland opened a pull request:

    https://github.com/apache/cloudstack/pull/490

    findbugs UC useless condition

      not sure what findbugs means yet, is it negating the if-condition against the assert?
      This should at least turn both warnings into one.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/DaanHoogland/cloudstack findbugs-UC

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/490.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #490
    
----
commit 90b9e9328d662fc45e5ccc24e1213f2308fa5bcf
Author: Daan Hoogland <da...@onecht.net>
Date:   2015-06-19T11:38:45Z

    findbugs UC useless condition
      not sure what findbugs means yet, but this should at least turn both
      warnings into one.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: findbugs UC useless condition

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/490#discussion_r32825228
  
    --- Diff: engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java ---
    @@ -391,6 +391,32 @@ private static void tagCommand(Command cmd) {
             }
         }
     
    +    /**
    +     * @param commands
    +     * @return
    +     */
    +    private Command[] checkForCommandsAndTag(Commands commands) {
    +        Command[] cmds = commands.toCommands();
    +
    +        assert cmds.length > 0 : "Ask yourself this about a hundred times.  Why am I  sending zero length commands?";
    --- End diff --
    
    it was done like this in two places by Alena. I had the idea she had a goal in mind. the assert is only nice in debug situation so her goal was probably educating developers. the following if negates it, kind of completely.
    
    @bhaisaab it is also a test of the new findbugs messages that i am leaving it in for. Shall we?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: findbugs UC useless condition

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cloudstack/pull/490


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request: findbugs UC useless condition

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/490#discussion_r32824227
  
    --- Diff: engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java ---
    @@ -391,6 +391,32 @@ private static void tagCommand(Command cmd) {
             }
         }
     
    +    /**
    +     * @param commands
    +     * @return
    +     */
    +    private Command[] checkForCommandsAndTag(Commands commands) {
    +        Command[] cmds = commands.toCommands();
    +
    +        assert cmds.length > 0 : "Ask yourself this about a hundred times.  Why am I  sending zero length commands?";
    --- End diff --
    
    is this assert necessary ;)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---