package com.ctrip.framework.apollo.spring.config;

import com.ctrip.framework.apollo.Config;

import org.springframework.core.env.PropertySource;

/**
 * Property source wrapper for Config
 *
 * @author Jason Song(song_s@ctrip.com)
 */
public class ConfigPropertySource extends PropertySource<Config> {
  public ConfigPropertySource(String name, Config source) {
    super(name, source);
  }

  @Override
  public Object getProperty(String name) {
    return this.source.getProperty(name, null);
  }
}

@@ -55,43 +55,22 @@
 ort 
-com.ctrip.framework.apollo.Config;%0A
+java.util.Set;
 %0Aimp
@@ -102,16 +102,26 @@
 ore.env.
+Enumerable
 Property
@@ -129,16 +129,59 @@
 ource;%0A%0A
+import com.ctrip.framework.apollo.Config;%0A%0A
 /**%0A * P
@@ -303,16 +303,26 @@
 extends 
+Enumerable
 Property
@@ -338,16 +338,78 @@
 nfig%3E %7B%0A
+  private static final String%5B%5D EMPTY_ARRAY = new String%5B0%5D;%0A%0A
   public
@@ -490,16 +490,271 @@
 );%0A  %7D%0A%0A
+  @Override%0A  public String%5B%5D getPropertyNames() %7B%0A    Set%3CString%3E propertyNames = this.source.getPropertyNames();%0A    if (propertyNames.isEmpty()) %7B%0A      return EMPTY_ARRAY;%0A    %7D%0A    return propertyNames.toArray(new String%5BpropertyNames.size()%5D);%0A  %7D%0A%0A
   @Overr

fix for Spring 4.1.2 that composite property source should extend EnumerablePropertySource