Skip to content

Commit 47e3079

Browse files
unmarshaller performance: also use bulk operation for Pcdata
1 parent 389817c commit 47e3079

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/ValidatingUnmarshaller.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
package org.glassfish.jaxb.runtime.v2.runtime.unmarshaller;
1212

13+
import org.glassfish.jaxb.runtime.v2.runtime.output.Pcdata;
1314
import org.glassfish.jaxb.runtime.v2.util.FatalAdapter;
1415
import org.glassfish.jaxb.core.v2.runtime.unmarshaller.LocatorEx;
1516
import org.xml.sax.SAXException;
@@ -111,6 +112,9 @@ else if (pcdata instanceof StringBuilder) {
111112
else if (pcdata instanceof StringBuffer) {
112113
((StringBuffer) pcdata).getChars(0, len, buf, 0);
113114
}
115+
else if (pcdata instanceof Pcdata) {
116+
((Pcdata) pcdata).writeTo(buf, 0);
117+
}
114118
else {
115119
for (int i = 0; i < len; i++)
116120
buf[i] = pcdata.charAt(i); // this is slow due to n range checks

0 commit comments

Comments
 (0)