8076290: JCK test api/xsl/conf/string/string17 starts failing after JDK-8074297
Reviewed-by: joehw
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java Mon Mar 30 14:54:57 2015 +0300
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java Wed Apr 01 16:01:10 2015 +0300
@@ -298,7 +298,7 @@
return(EMPTYSTRING);
int istart = (int)Math.round(start) - 1;
- final int ilength = (int)Math.round(length);
+ int ilength = (int)Math.round(length);
final int isum;
if (Double.isInfinite(length))
isum = Integer.MAX_VALUE;
@@ -309,8 +309,10 @@
if (isum < 0 || istart > strlen)
return(EMPTYSTRING);
- if (istart < 0)
+ if (istart < 0) {
+ ilength += istart;
istart = 0;
+ }
try {
istart = value.offsetByCodePoints(0, istart);