Skip to content

Commit 1bb3d93

Browse files
committed
Fix off issue codehaus-plexus#22 <?m2e execute onConfiguration?> fails if pom is big enough (8kb)
* fixed pom parser, as logic to check for x-m-l letters does not respected input tokenization
1 parent 21cedc9 commit 1bb3d93

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2469,7 +2469,7 @@ protected boolean parsePI()
24692469
if(tokenize) posStart = pos;
24702470
final int curLine = lineNumber;
24712471
final int curColumn = columnNumber;
2472-
int piTargetStart = pos + bufAbsoluteStart;
2472+
int piTargetStart = pos;
24732473
int piTargetEnd = -1;
24742474
final boolean normalizeIgnorableWS = tokenize == true && roundtripSupported == false;
24752475
boolean normalizedCR = false;
@@ -2495,7 +2495,7 @@ protected boolean parsePI()
24952495
seenQ = false;
24962496
} else {
24972497
if(piTargetEnd == -1 && isS(ch)) {
2498-
piTargetEnd = pos - 1 + bufAbsoluteStart;
2498+
piTargetEnd = pos - 1;
24992499

25002500
// [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
25012501
if((piTargetEnd - piTargetStart) == 3) {
@@ -2520,7 +2520,7 @@ protected boolean parsePI()
25202520
}
25212521
parseXmlDecl(ch);
25222522
if(tokenize) posEnd = pos - 2;
2523-
final int off = piTargetStart - bufAbsoluteStart + 3;
2523+
final int off = piTargetStart + 3;
25242524
final int len = pos - 2 - off;
25252525
xmlDeclContent = newString(buf, off, len);
25262526
return false;
@@ -2575,8 +2575,6 @@ protected boolean parsePI()
25752575
//throw new XmlPullParserException(
25762576
// "processing instruction must have PITarget name", this, null);
25772577
}
2578-
piTargetStart -= bufAbsoluteStart;
2579-
piTargetEnd -= bufAbsoluteStart;
25802578
if(tokenize) {
25812579
posEnd = pos - 2;
25822580
if(normalizeIgnorableWS) {

0 commit comments

Comments
 (0)