Update to avoid index out of bounds exception with 1 character operation names

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1203686 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
antelder 2011-11-18 15:11:06 +00:00
parent 6f11123620
commit 14ed14d267

View file

@ -78,7 +78,7 @@ public class AXIOMXMLHelper implements XMLHelper<OMElement> {
@Override
public OMElement createWrapper(QName qname) {
// The OMElement2JAXB transformer wants the opName to be capitalized
String opName = Character.toUpperCase(qname.getLocalPart().charAt(0)) + qname.getLocalPart().substring(1);
String opName = Character.toUpperCase(qname.getLocalPart().charAt(0)) + qname.getLocalPart().length() > 1 ? qname.getLocalPart().substring(1) : "";
OMElement om = factory.createOMElement(qname);
OMNamespace defaultNS = om.declareDefaultNamespace(qname.getNamespaceURI());
return factory.createOMElement(opName, defaultNS);