Skip to content

Commit

Permalink
[NOJIRA]
Browse files Browse the repository at this point in the history
A second attempt at returning something other than null for getDOM.
  • Loading branch information
Bill Smith committed Aug 28, 2018
1 parent 4571b3e commit 96bdcbf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@ public void detach() {

@Nullable
public Element getDOM() {
XMLObjectProviderRegistry registry = ConfigurationService.get(XMLObjectProviderRegistry.class);
try {
return registry.getMarshallerFactory().getMarshaller(this).marshall(this);
} catch (MarshallingException e) {
// TODO: some sort of logging?
return null;
}
return null;
}

public String getNamespaceURI() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
import com.google.common.collect.Lists;

import lombok.EqualsAndHashCode;
import org.opensaml.core.config.ConfigurationService;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.config.XMLObjectProviderRegistry;
import org.opensaml.core.xml.io.MarshallingException;
import org.springframework.util.StringUtils;
import org.w3c.dom.Element;

import javax.annotation.Nullable;

Expand Down Expand Up @@ -262,4 +266,15 @@ public List<XMLObject> getOrderedChildren() {

return Collections.unmodifiableList(children);
}

@Override
public Element getDOM() {
XMLObjectProviderRegistry registry = ConfigurationService.get(XMLObjectProviderRegistry.class);
try {
return registry.getMarshallerFactory().getMarshaller(this).marshall(this);
} catch (MarshallingException e) {
// TODO: some sort of logging?
return null;
}
}
}

0 comments on commit 96bdcbf

Please sign in to comment.