|
|
Choosing A Webhost: |
svn commit: r520931 - /lenya/trunk/src/modules/sourcerepository/java/src/or: msg#00019cms.lenya.cvs
Author: andreas Date: Wed Mar 21 09:12:24 2007 New Revision: 520931 URL: http://svn.apache.org/viewvc?view=rev&rev=520931 Log: [refactoring] extracted method Modified: lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeMetaData.java Modified: lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeMetaData.java URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeMetaData.java?view=diff&rev=520931&r1=520930&r2=520931 ============================================================================== --- lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeMetaData.java (original) +++ lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeMetaData.java Wed Mar 21 09:12:24 2007 @@ -124,12 +124,7 @@ Element[] elements = getElementSet().getElements(); for (int i = 0; i < elements.length; i++) { if (elements[i].getActionOnCopy() == Element.ONCOPY_COPY) { - String key = elements[i].getName(); - removeAllValues(key); - String[] values = other.getValues(key); - for (int j = 0; j < values.length; j++) { - addValue(key, values[j]); - } + replaceBy(other, elements[i]); } else if (elements[i].getActionOnCopy() == Element.ONCOPY_DELETE) { String key = elements[i].getName(); removeAllValues(key); @@ -137,15 +132,19 @@ } } + protected void replaceBy(MetaData other, Element element) throws MetaDataException { + String key = element.getName(); + removeAllValues(key); + String[] values = other.getValues(key); + for (int j = 0; j < values.length; j++) { + addValue(key, values[j]); + } + } + public void forcedReplaceBy(MetaData other) throws MetaDataException { Element[] elements = getElementSet().getElements(); for (int i = 0; i < elements.length; i++) { - String key = elements[i].getName(); - removeAllValues(key); - String[] values = other.getValues(key); - for (int j = 0; j < values.length; j++) { - addValue(key, values[j]); - } + replaceBy(other, elements[i]); } }
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |