Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-3230

ComponentConfigurationFactory#create method should remove redundant type.toUpperCase invoke

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      follow is a code snippet of ComponentConfigurationFactory#create() method 

       

      try

      {   confType = (Class<? extends ComponentConfiguration>) Class.forName(type);   return confType.getConstructor(String.class).newInstance(type); }

      catch (Exception ignored) {
        try {
          // has been invoke type.toUpperCase(Locale.ENGLISH)
          type = type.toUpperCase(Locale.ENGLISH);
          switch (component) {
            case SOURCE:
            // here, no need invoke type.toUpperCase(Locale.ENGLISH) again, it's redundant, should remove
              return SourceConfigurationType.valueOf(type.toUpperCase(Locale.ENGLISH))
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ykgarfield yangkun
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: