comparison src/org/tmatesoft/hg/internal/ConfigFile.java @ 498:0205a5c4566b

Issue 38: preserve user formatting and comments when updating configuration files
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 26 Oct 2012 18:17:15 +0200
parents db48a77ec8ff
children e1b29756f901
comparison
equal deleted inserted replaced
497:02140be396d5 498:0205a5c4566b
60 60
61 public List<String> getSectionNames() { 61 public List<String> getSectionNames() {
62 return sections == null ? Collections.<String>emptyList() : Collections.unmodifiableList(sections); 62 return sections == null ? Collections.<String>emptyList() : Collections.unmodifiableList(sections);
63 } 63 }
64 64
65 /**
66 * Access map of section keys and values.
67 * @param sectionName name of the section to retrieve
68 * @return never <code>null</code>, empty map in case no section with specified name found
69 */
65 public Map<String,String> getSection(String sectionName) { 70 public Map<String,String> getSection(String sectionName) {
66 if (sections == null) { 71 if (sections == null) {
67 return Collections.emptyMap(); 72 return Collections.emptyMap();
68 } 73 }
69 int x = sections.indexOf(sectionName); 74 int x = sections.indexOf(sectionName);