Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jamesagnew/hapi-fhir
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesagnew committed Sep 16, 2016
2 parents da73123 + e2f03a9 commit a3108eb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import static org.apache.commons.lang3.StringUtils.isNotEmpty;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -1870,13 +1871,17 @@ public void enteringNewElement(String theNamespaceUri, String theLocalPart) thro
} else if (theLocalPart.equals("profile")) {
@SuppressWarnings("unchecked")
List<IdDt> profiles = (List<IdDt>) myMap.get(ResourceMetadataKeyEnum.PROFILES);
if (profiles == null) {
profiles = new ArrayList<IdDt>();
myMap.put(ResourceMetadataKeyEnum.PROFILES, profiles);
List<IdDt> newProfiles;
if (profiles != null) {
newProfiles = new ArrayList<IdDt>(profiles.size() + 1);
newProfiles.addAll(profiles);
} else {
newProfiles = new ArrayList<IdDt>(1);
}
IdDt profile = new IdDt();
push(new PrimitiveState(getPreResourceState(), profile));
profiles.add(profile);
newProfiles.add(profile);
myMap.put(ResourceMetadataKeyEnum.PROFILES, Collections.unmodifiableList(newProfiles));
} else if (theLocalPart.equals("tag")) {
TagList tagList = (TagList) myMap.get(ResourceMetadataKeyEnum.TAG_LIST);
if (tagList == null) {
Expand Down

0 comments on commit a3108eb

Please sign in to comment.