MCPcopy Create free account
hub / github.com/Qihoo360/poseidon / removeSection

Method removeSection

builder/index/src/main/java/util/IniParser.java:360–372  ·  view source on GitHub ↗

Removes a section if it exists. @param name the section's name @return true if the section actually existed @throws IllegalArgumentException when trying to remove the common section

(String name)

Source from the content-addressed store, hash-verified

358 * @throws IllegalArgumentException when trying to remove the common section
359 */
360 public boolean removeSection(String name) {
361 String normName = normSection(name);
362 if (this.commonName != null && this.commonName.equals(normName)) {
363 throw new IllegalArgumentException("Can't remove common section");
364 }
365 if (hasSection(normName)) {
366 this.sections.remove(normName);
367 this.sectionOrder.remove(normName);
368 return true;
369 } else {
370 return false;
371 }
372 }
373
374 /**
375 * Returns all section names in this instance minus the common section if

Callers

nothing calls this directly

Calls 3

normSectionMethod · 0.95
hasSectionMethod · 0.95
removeMethod · 0.45

Tested by

no test coverage detected