Skip to content

Commit

Permalink
Fix off issue codehaus-plexus#22 <?m2e execute onConfiguration?> fail…
Browse files Browse the repository at this point in the history
…s if pom is big enough (8kb)

* fixed pom parser, as logic to check for x-m-l letters does not respected input tokenization
  • Loading branch information
roka-actico committed Apr 2, 2017
1 parent 21cedc9 commit 1bb3d93
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java
Expand Up @@ -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;
Expand All @@ -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) {
Expand All @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1bb3d93

Please sign in to comment.