From 1bb3d93c941d34329b2d36a38a4c6f8c0e1905d0 Mon Sep 17 00:00:00 2001 From: Robert Kleinschmager Date: Sun, 2 Apr 2017 17:47:41 +0200 Subject: [PATCH] Fix off issue #22 fails if pom is big enough (8kb) * fixed pom parser, as logic to check for x-m-l letters does not respected input tokenization --- .../java/org/codehaus/plexus/util/xml/pull/MXParser.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java b/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java index 263537ab..24c71095 100644 --- a/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java +++ b/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java @@ -2469,7 +2469,7 @@ protected boolean parsePI() if(tokenize) posStart = pos; final int curLine = lineNumber; final int curColumn = columnNumber; - int piTargetStart = pos + bufAbsoluteStart; + int piTargetStart = pos; int piTargetEnd = -1; final boolean normalizeIgnorableWS = tokenize == true && roundtripSupported == false; boolean normalizedCR = false; @@ -2495,7 +2495,7 @@ protected boolean parsePI() seenQ = false; } else { if(piTargetEnd == -1 && isS(ch)) { - piTargetEnd = pos - 1 + bufAbsoluteStart; + piTargetEnd = pos - 1; // [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) if((piTargetEnd - piTargetStart) == 3) { @@ -2520,7 +2520,7 @@ protected boolean parsePI() } parseXmlDecl(ch); if(tokenize) posEnd = pos - 2; - final int off = piTargetStart - bufAbsoluteStart + 3; + final int off = piTargetStart + 3; final int len = pos - 2 - off; xmlDeclContent = newString(buf, off, len); return false; @@ -2575,8 +2575,6 @@ protected boolean parsePI() //throw new XmlPullParserException( // "processing instruction must have PITarget name", this, null); } - piTargetStart -= bufAbsoluteStart; - piTargetEnd -= bufAbsoluteStart; if(tokenize) { posEnd = pos - 2; if(normalizeIgnorableWS) {