From: Juergen H. <jho...@us...> - 2006-04-21 00:14:24
|
Update of /cvsroot/springframework/spring/src/org/springframework/core/io/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19629/src/org/springframework/core/io/support Modified Files: Tag: mbranch-1-2 PropertiesLoaderSupport.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: PropertiesLoaderSupport.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/core/io/support/PropertiesLoaderSupport.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** PropertiesLoaderSupport.java 2 Oct 2005 19:42:41 -0000 1.4 --- PropertiesLoaderSupport.java 21 Apr 2006 00:13:48 -0000 1.4.2.1 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 46,50 **** protected final Log logger = LogFactory.getLog(getClass()); ! private Properties properties; private Resource[] locations; --- 46,50 ---- protected final Log logger = LogFactory.getLog(getClass()); ! private Properties[] localProperties; private Resource[] locations; *************** *** 65,69 **** */ public void setProperties(Properties properties) { ! this.properties = properties; } --- 65,77 ---- */ public void setProperties(Properties properties) { ! this.localProperties = new Properties[] {properties}; ! } ! ! /** ! * Set local properties, e.g. via the "props" tag in XML bean definitions, ! * allowing for merging multiple properties sets into one. ! */ ! public void setPropertiesArray(Properties[] propertiesArray) { ! this.localProperties = propertiesArray; } *************** *** 139,147 **** } ! if (this.properties != null) { ! // Use propertyNames enumeration to also catch default properties. ! for (Enumeration en = this.properties.propertyNames(); en.hasMoreElements();) { ! String key = (String) en.nextElement(); ! result.setProperty(key, this.properties.getProperty(key)); } } --- 147,158 ---- } ! if (this.localProperties != null) { ! for (int i = 0; i < this.localProperties.length; i++) { ! Properties props = this.localProperties[i]; ! // Use propertyNames enumeration to also catch default properties. ! for (Enumeration en = props.propertyNames(); en.hasMoreElements();) { ! String key = (String) en.nextElement(); ! result.setProperty(key, props.getProperty(key)); ! } } } |