test_class.file: dubbo-config/dubbo-config-api/src/test/java/com/alibaba/dubbo/config/AbstractConfigTest.java
test_class.identifier: AbstractConfigTest
test_case.body: @Test
      public void testAppendProperties2() throws Exception {
          try {
              System.setProperty("dubbo.properties.two.i", "2");
              PropertiesConfig config = new PropertiesConfig("two");
              AbstractConfig.appendProperties(config);
              TestCase.assertEquals(2, config.getI());
          } finally {
              System.clearProperty("dubbo.properties.two.i");
          }
      }
test_case.class_method_signature: AbstractConfigTest.testAppendProperties2()
test_case.full_signature: @Test public void testAppendProperties2()
test_case.identifier: testAppendProperties2
test_case.invocations: setProperty appendProperties assertEquals getI clearProperty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAppendProperties2()
focal_class.declarator: logger = LoggerFactory.getLogger(AbstractConfig.class)
focal_class.modifier: protected static final
focal_class.original_string: protected static final Logger logger = LoggerFactory.getLogger(AbstractConfig.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: serialVersionUID = 4267533505537413570L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 4267533505537413570L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: MAX_LENGTH = 200
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_LENGTH = 200;
focal_class.type: int
focal_class.var_name: MAX_LENGTH
focal_class.declarator: MAX_PATH_LENGTH = 200
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_PATH_LENGTH = 200;
focal_class.type: int
focal_class.var_name: MAX_PATH_LENGTH
focal_class.declarator: PATTERN_NAME = Pattern.compile("[\\-._0-9a-zA-Z]+")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PATTERN_NAME = Pattern.compile("[\\-._0-9a-zA-Z]+");
focal_class.type: Pattern
focal_class.var_name: PATTERN_NAME
focal_class.declarator: PATTERN_MULTI_NAME = Pattern.compile("[,\\-._0-9a-zA-Z]+")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PATTERN_MULTI_NAME = Pattern.compile("[,\\-._0-9a-zA-Z]+");
focal_class.type: Pattern
focal_class.var_name: PATTERN_MULTI_NAME
focal_class.declarator: PATTERN_METHOD_NAME = Pattern.compile("[a-zA-Z][0-9a-zA-Z]*")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PATTERN_METHOD_NAME = Pattern.compile("[a-zA-Z][0-9a-zA-Z]*");
focal_class.type: Pattern
focal_class.var_name: PATTERN_METHOD_NAME
focal_class.declarator: PATTERN_PATH = Pattern.compile("[/\\-$._0-9a-zA-Z]+")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PATTERN_PATH = Pattern.compile("[/\\-$._0-9a-zA-Z]+");
focal_class.type: Pattern
focal_class.var_name: PATTERN_PATH
focal_class.declarator: PATTERN_NAME_HAS_SYMBOL = Pattern.compile("[:*,\\s/\\-._0-9a-zA-Z]+")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PATTERN_NAME_HAS_SYMBOL = Pattern.compile("[:*,\\s/\\-._0-9a-zA-Z]+");
focal_class.type: Pattern
focal_class.var_name: PATTERN_NAME_HAS_SYMBOL
focal_class.declarator: PATTERN_KEY = Pattern.compile("[*,\\-._0-9a-zA-Z]+")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PATTERN_KEY = Pattern.compile("[*,\\-._0-9a-zA-Z]+");
focal_class.type: Pattern
focal_class.var_name: PATTERN_KEY
focal_class.declarator: legacyProperties = new HashMap<String, String>()
focal_class.modifier: private static final
focal_class.original_string: private static final Map<String, String> legacyProperties = new HashMap<String, String>();
focal_class.type: Map<String, String>
focal_class.var_name: legacyProperties
focal_class.declarator: SUFFIXES = new String[]{"Config", "Bean"}
focal_class.modifier: private static final
focal_class.original_string: private static final String[] SUFFIXES = new String[]{"Config", "Bean"};
focal_class.type: String[]
focal_class.var_name: SUFFIXES
focal_class.declarator: id
focal_class.modifier: protected
focal_class.original_string: protected String id;
focal_class.type: String
focal_class.var_name: id
focal_class.file: dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/AbstractConfig.java
focal_class.identifier: AbstractConfig
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: AbstractConfig.convertLegacyValue(String key, String value)
focal_class.full_signature: private static String convertLegacyValue(String key, String value)
focal_class.identifier: convertLegacyValue
focal_class.modifiers: private static
focal_class.parameters: (String key, String value)
focal_class.return: String
focal_class.signature: String convertLegacyValue(String key, String value)
focal_class.class_method_signature: AbstractConfig.appendProperties(AbstractConfig config)
focal_class.full_signature: protected static void appendProperties(AbstractConfig config)
focal_class.identifier: appendProperties
focal_class.modifiers: protected static
focal_class.parameters: (AbstractConfig config)
focal_class.return: void
focal_class.signature: void appendProperties(AbstractConfig config)
focal_class.class_method_signature: AbstractConfig.getTagName(Class<?> cls)
focal_class.full_signature: private static String getTagName(Class<?> cls)
focal_class.identifier: getTagName
focal_class.modifiers: private static
focal_class.parameters: (Class<?> cls)
focal_class.return: String
focal_class.signature: String getTagName(Class<?> cls)
focal_class.class_method_signature: AbstractConfig.appendParameters(Map<String, String> parameters, Object config)
focal_class.full_signature: protected static void appendParameters(Map<String, String> parameters, Object config)
focal_class.identifier: appendParameters
focal_class.modifiers: protected static
focal_class.parameters: (Map<String, String> parameters, Object config)
focal_class.return: void
focal_class.signature: void appendParameters(Map<String, String> parameters, Object config)
focal_class.class_method_signature: AbstractConfig.appendParameters(Map<String, String> parameters, Object config, String prefix)
focal_class.full_signature: @SuppressWarnings("unchecked") protected static void appendParameters(Map<String, String> parameters, Object config, String prefix)
focal_class.identifier: appendParameters
focal_class.modifiers: @SuppressWarnings("unchecked") protected static
focal_class.parameters: (Map<String, String> parameters, Object config, String prefix)
focal_class.return: void
focal_class.signature: void appendParameters(Map<String, String> parameters, Object config, String prefix)
focal_class.class_method_signature: AbstractConfig.appendAttributes(Map<Object, Object> parameters, Object config)
focal_class.full_signature: protected static void appendAttributes(Map<Object, Object> parameters, Object config)
focal_class.identifier: appendAttributes
focal_class.modifiers: protected static
focal_class.parameters: (Map<Object, Object> parameters, Object config)
focal_class.return: void
focal_class.signature: void appendAttributes(Map<Object, Object> parameters, Object config)
focal_class.class_method_signature: AbstractConfig.appendAttributes(Map<Object, Object> parameters, Object config, String prefix)
focal_class.full_signature: protected static void appendAttributes(Map<Object, Object> parameters, Object config, String prefix)
focal_class.identifier: appendAttributes
focal_class.modifiers: protected static
focal_class.parameters: (Map<Object, Object> parameters, Object config, String prefix)
focal_class.return: void
focal_class.signature: void appendAttributes(Map<Object, Object> parameters, Object config, String prefix)
focal_class.class_method_signature: AbstractConfig.isPrimitive(Class<?> type)
focal_class.full_signature: private static boolean isPrimitive(Class<?> type)
focal_class.identifier: isPrimitive
focal_class.modifiers: private static
focal_class.parameters: (Class<?> type)
focal_class.return: boolean
focal_class.signature: boolean isPrimitive(Class<?> type)
focal_class.class_method_signature: AbstractConfig.convertPrimitive(Class<?> type, String value)
focal_class.full_signature: private static Object convertPrimitive(Class<?> type, String value)
focal_class.identifier: convertPrimitive
focal_class.modifiers: private static
focal_class.parameters: (Class<?> type, String value)
focal_class.return: Object
focal_class.signature: Object convertPrimitive(Class<?> type, String value)
focal_class.class_method_signature: AbstractConfig.checkExtension(Class<?> type, String property, String value)
focal_class.full_signature: protected static void checkExtension(Class<?> type, String property, String value)
focal_class.identifier: checkExtension
focal_class.modifiers: protected static
focal_class.parameters: (Class<?> type, String property, String value)
focal_class.return: void
focal_class.signature: void checkExtension(Class<?> type, String property, String value)
focal_class.class_method_signature: AbstractConfig.checkMultiExtension(Class<?> type, String property, String value)
focal_class.full_signature: protected static void checkMultiExtension(Class<?> type, String property, String value)
focal_class.identifier: checkMultiExtension
focal_class.modifiers: protected static
focal_class.parameters: (Class<?> type, String property, String value)
focal_class.return: void
focal_class.signature: void checkMultiExtension(Class<?> type, String property, String value)
focal_class.class_method_signature: AbstractConfig.checkLength(String property, String value)
focal_class.full_signature: protected static void checkLength(String property, String value)
focal_class.identifier: checkLength
focal_class.modifiers: protected static
focal_class.parameters: (String property, String value)
focal_class.return: void
focal_class.signature: void checkLength(String property, String value)
focal_class.class_method_signature: AbstractConfig.checkPathLength(String property, String value)
focal_class.full_signature: protected static void checkPathLength(String property, String value)
focal_class.identifier: checkPathLength
focal_class.modifiers: protected static
focal_class.parameters: (String property, String value)
focal_class.return: void
focal_class.signature: void checkPathLength(String property, String value)
focal_class.class_method_signature: AbstractConfig.checkName(String property, String value)
focal_class.full_signature: protected static void checkName(String property, String value)
focal_class.identifier: checkName
focal_class.modifiers: protected static
focal_class.parameters: (String property, String value)
focal_class.return: void
focal_class.signature: void checkName(String property, String value)
focal_class.class_method_signature: AbstractConfig.checkNameHasSymbol(String property, String value)
focal_class.full_signature: protected static void checkNameHasSymbol(String property, String value)
focal_class.identifier: checkNameHasSymbol
focal_class.modifiers: protected static
focal_class.parameters: (String property, String value)
focal_class.return: void
focal_class.signature: void checkNameHasSymbol(String property, String value)
focal_class.class_method_signature: AbstractConfig.checkKey(String property, String value)
focal_class.full_signature: protected static void checkKey(String property, String value)
focal_class.identifier: checkKey
focal_class.modifiers: protected static
focal_class.parameters: (String property, String value)
focal_class.return: void
focal_class.signature: void checkKey(String property, String value)
focal_class.class_method_signature: AbstractConfig.checkMultiName(String property, String value)
focal_class.full_signature: protected static void checkMultiName(String property, String value)
focal_class.identifier: checkMultiName
focal_class.modifiers: protected static
focal_class.parameters: (String property, String value)
focal_class.return: void
focal_class.signature: void checkMultiName(String property, String value)
focal_class.class_method_signature: AbstractConfig.checkPathName(String property, String value)
focal_class.full_signature: protected static void checkPathName(String property, String value)
focal_class.identifier: checkPathName
focal_class.modifiers: protected static
focal_class.parameters: (String property, String value)
focal_class.return: void
focal_class.signature: void checkPathName(String property, String value)
focal_class.class_method_signature: AbstractConfig.checkMethodName(String property, String value)
focal_class.full_signature: protected static void checkMethodName(String property, String value)
focal_class.identifier: checkMethodName
focal_class.modifiers: protected static
focal_class.parameters: (String property, String value)
focal_class.return: void
focal_class.signature: void checkMethodName(String property, String value)
focal_class.class_method_signature: AbstractConfig.checkParameterName(Map<String, String> parameters)
focal_class.full_signature: protected static void checkParameterName(Map<String, String> parameters)
focal_class.identifier: checkParameterName
focal_class.modifiers: protected static
focal_class.parameters: (Map<String, String> parameters)
focal_class.return: void
focal_class.signature: void checkParameterName(Map<String, String> parameters)
focal_class.class_method_signature: AbstractConfig.checkProperty(String property, String value, int maxlength, Pattern pattern)
focal_class.full_signature: protected static void checkProperty(String property, String value, int maxlength, Pattern pattern)
focal_class.identifier: checkProperty
focal_class.modifiers: protected static
focal_class.parameters: (String property, String value, int maxlength, Pattern pattern)
focal_class.return: void
focal_class.signature: void checkProperty(String property, String value, int maxlength, Pattern pattern)
focal_class.class_method_signature: AbstractConfig.getId()
focal_class.full_signature: @Parameter(excluded = true) public String getId()
focal_class.identifier: getId
focal_class.modifiers: @Parameter(excluded = true) public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getId()
focal_class.class_method_signature: AbstractConfig.setId(String id)
focal_class.full_signature: public void setId(String id)
focal_class.identifier: setId
focal_class.modifiers: public
focal_class.parameters: (String id)
focal_class.return: void
focal_class.signature: void setId(String id)
focal_class.class_method_signature: AbstractConfig.appendAnnotation(Class<?> annotationClass, Object annotation)
focal_class.full_signature: protected void appendAnnotation(Class<?> annotationClass, Object annotation)
focal_class.identifier: appendAnnotation
focal_class.modifiers: protected
focal_class.parameters: (Class<?> annotationClass, Object annotation)
focal_class.return: void
focal_class.signature: void appendAnnotation(Class<?> annotationClass, Object annotation)
focal_class.class_method_signature: AbstractConfig.isAnnotationArray(Class target)
focal_class.full_signature:  boolean isAnnotationArray(Class target)
focal_class.identifier: isAnnotationArray
focal_class.parameters: (Class target)
focal_class.return: boolean
focal_class.signature: boolean isAnnotationArray(Class target)
focal_class.class_method_signature: AbstractConfig.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: protected static void appendProperties(AbstractConfig config) {
          if (config == null) {
              return;
          }
          String prefix = "dubbo." + getTagName(config.getClass()) + ".";
          Method[] methods = config.getClass().getMethods();
          for (Method method : methods) {
              try {
                  String name = method.getName();
                  if (name.length() > 3 && name.startsWith("set") && Modifier.isPublic(method.getModifiers())
                          && method.getParameterTypes().length == 1 && isPrimitive(method.getParameterTypes()[0])) {
                      String property = StringUtils.camelToSplitName(name.substring(3, 4).toLowerCase() + name.substring(4), ".");
  
                      String value = null;
                      if (config.getId() != null && config.getId().length() > 0) {
                          String pn = prefix + config.getId() + "." + property;
                          value = System.getProperty(pn);
                          if (!StringUtils.isBlank(value)) {
                              logger.info("Use System Property " + pn + " to config dubbo");
                          }
                      }
                      if (value == null || value.length() == 0) {
                          String pn = prefix + property;
                          value = System.getProperty(pn);
                          if (!StringUtils.isBlank(value)) {
                              logger.info("Use System Property " + pn + " to config dubbo");
                          }
                      }
                      if (value == null || value.length() == 0) {
                          Method getter;
                          try {
                              getter = config.getClass().getMethod("get" + name.substring(3));
                          } catch (NoSuchMethodException e) {
                              try {
                                  getter = config.getClass().getMethod("is" + name.substring(3));
                              } catch (NoSuchMethodException e2) {
                                  getter = null;
                              }
                          }
                          if (getter != null) {
                              if (getter.invoke(config) == null) {
                                  if (config.getId() != null && config.getId().length() > 0) {
                                      value = ConfigUtils.getProperty(prefix + config.getId() + "." + property);
                                  }
                                  if (value == null || value.length() == 0) {
                                      value = ConfigUtils.getProperty(prefix + property);
                                  }
                                  if (value == null || value.length() == 0) {
                                      String legacyKey = legacyProperties.get(prefix + property);
                                      if (legacyKey != null && legacyKey.length() > 0) {
                                          value = convertLegacyValue(legacyKey, ConfigUtils.getProperty(legacyKey));
                                      }
                                  }
  
                              }
                          }
                      }
                      if (value != null && value.length() > 0) {
                          method.invoke(config, convertPrimitive(method.getParameterTypes()[0], value));
                      }
                  }
              } catch (Exception e) {
                  logger.error(e.getMessage(), e);
              }
          }
      }
focal_method.class_method_signature: AbstractConfig.appendProperties(AbstractConfig config)
focal_method.full_signature: protected static void appendProperties(AbstractConfig config)
focal_method.identifier: appendProperties
focal_method.invocations: getTagName getClass getMethods getClass getName length startsWith isPublic getModifiers getParameterTypes isPrimitive getParameterTypes camelToSplitName toLowerCase substring substring getId length getId getId getProperty isBlank info length getProperty isBlank info length getMethod getClass substring getMethod getClass substring invoke getId length getId getProperty getId length getProperty length get length convertLegacyValue getProperty length invoke convertPrimitive getParameterTypes error getMessage
focal_method.modifiers: protected static
focal_method.parameters: (AbstractConfig config)
focal_method.return: void
focal_method.signature: void appendProperties(AbstractConfig config)