Uploaded image for project: 'CloudStack'
  1. CloudStack
  2. CLOUDSTACK-10360

Inconsistent method name

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • Security Level: Public (Anyone can view this level - this is the default.)
    • None

    Description

      The following method is named as "scoped" that seems to whether the variable config is scoped in _scopedStorages or not.
      Actually, the method tries to find a storage of which scope equals to the scope of config.
      So that, the method name "findStorage" should be more clear than "scoped".

          public ScopedConfigStorage scoped(ConfigKey<?> config) {
              for (ScopedConfigStorage storage : _scopedStorages) {
                  if (storage.getScope() == config.scope()) {
                      return storage;
                  }
              }
      
              throw new CloudRuntimeException("Unable to find config storage for this scope: " + config.scope() + " for " + config.key());
          }
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            BruceKuiLIU KuiLIU
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment