Uploaded image for project: 'Apache InLong'
  1. Apache InLong
  2. INLONG-96

Fix typo & use IllegalArgumentException

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Low
    • Resolution: Fixed
    • None
    • 0.5.0
    • None

    Description

      1. Fix typo
      validConsumerGroupParmeter -> validConsumerGroupParameter
      pushIsListenerWaitTimeoutRollBack -> pushListenerWaitTimeoutRollBack
      pushIsListenerThrowedRollBack -> pushListenerThrowedRollBack

      2. Use IllegalArgumentException
      In ConsumerConfig#validConsumerGroupParameter

      private void validConsumerGroupParameter(String consumerGroup) throws Exception {
              if (TStringUtils.isBlank(consumerGroup)) {
                  throw new Exception("Illegal parameter: consumerGroup is Blank!");
              }
              String tmpConsumerGroup = String.valueOf(consumerGroup).trim();
              if (tmpConsumerGroup.length() > TBaseConstants.META_MAX_GROUPNAME_LENGTH) {
                  throw new Exception(new StringBuilder(512)
                          .append("Illegal parameter: the max length of consumerGroup is ")
                          .append(TBaseConstants.META_MAX_GROUPNAME_LENGTH)
                          .append(" characters").toString());
              }
              if (!tmpConsumerGroup.matches(TBaseConstants.META_TMP_GROUP_VALUE)) {
                  throw new Exception(new StringBuilder(512)
                          .append("Illegal parameter: the value of consumerGroup")
                          .append(" must begin with a letter, ")
                          .append("can only contain characters,numbers,hyphen,and underscores").toString());
              }
          }
      

      will change to throw IllegalArgumentException

      private void validConsumerGroupParameter(String consumerGroup) throws Exception {
              if (TStringUtils.isBlank(consumerGroup)) {
                  throw new IllegalArgumentException("Illegal parameter: consumerGroup is Blank!");
              }
              String tmpConsumerGroup = String.valueOf(consumerGroup).trim();
              if (tmpConsumerGroup.length() > TBaseConstants.META_MAX_GROUPNAME_LENGTH) {
                  throw new IllegalArgumentException(new StringBuilder(512)
                          .append("Illegal parameter: the max length of consumerGroup is ")
                          .append(TBaseConstants.META_MAX_GROUPNAME_LENGTH)
                          .append(" characters").toString());
              }
              if (!tmpConsumerGroup.matches(TBaseConstants.META_TMP_GROUP_VALUE)) {
                  throw new IllegalArgumentException(new StringBuilder(512)
                          .append("Illegal parameter: the value of consumerGroup")
                          .append(" must begin with a letter, ")
                          .append("can only contain characters,numbers,hyphen,and underscores").toString());
              }
          }
      

      Attachments

        Activity

          People

            technoboy Guo Jiwei
            technoboy Guo Jiwei
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m