From 08ba900017ac18bca9e6515e65b90e93d7941a0b Mon Sep 17 00:00:00 2001
From: Phi-Long Do
Date: Tue, 26 Apr 2022 09:11:04 +0200
Subject: [PATCH] Fix #147 ("expected" misspelled as "excepted")
---
src/main/java/com/ctc/wstx/cfg/ErrorConsts.java | 2 +-
.../java/com/ctc/wstx/dtd/FullDTDReader.java | 4 ++--
.../java/com/ctc/wstx/sr/BasicStreamReader.java | 8 ++++----
.../java/stax2/typed/ReaderBinaryTestBase.java | 16 ++++++++--------
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/main/java/com/ctc/wstx/cfg/ErrorConsts.java b/src/main/java/com/ctc/wstx/cfg/ErrorConsts.java
index 3de28882..c2840ebb 100644
--- a/src/main/java/com/ctc/wstx/cfg/ErrorConsts.java
+++ b/src/main/java/com/ctc/wstx/cfg/ErrorConsts.java
@@ -70,7 +70,7 @@ public class ErrorConsts
public static String ERR_WF_PI_MISSING_TARGET = "Missing processing instruction target";
public static String ERR_WF_PI_XML_TARGET = "Illegal processing instruction target (\"{0}\"); 'xml' (case insensitive) is reserved by the specs.";
- public static String ERR_WF_PI_XML_MISSING_SPACE = "excepted either space or \"?>\" after PI target";
+ public static String ERR_WF_PI_XML_MISSING_SPACE = "expected either space or \"?>\" after PI target";
// // // Entity problems:
diff --git a/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java b/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java
index f9a04a48..523c4a39 100644
--- a/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java
+++ b/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java
@@ -2227,7 +2227,7 @@ private void handleAttlistDecl()
*/
/*
} else if (c != '>') {
- throwDTDUnexpectedChar(c, "; excepted either '>' closing ATTLIST declaration, or a white space character separating individual attribute declarations");
+ throwDTDUnexpectedChar(c, "; expected either '>' closing ATTLIST declaration, or a white space character separating individual attribute declarations");
*/
}
if (c == '>') {
@@ -2299,7 +2299,7 @@ private void handleElementDecl()
+keyw+"' (for element <"+elemName+">); expected ANY or EMPTY");
} while (false);
} else {
- throwDTDUnexpectedChar(c, ": excepted '(' to start content specification for element <"+elemName+">");
+ throwDTDUnexpectedChar(c, ": expected '(' to start content specification for element <"+elemName+">");
}
// Ok, still need the trailing gt-char to close the declaration:
diff --git a/src/main/java/com/ctc/wstx/sr/BasicStreamReader.java b/src/main/java/com/ctc/wstx/sr/BasicStreamReader.java
index 6140f100..f9dfe268 100644
--- a/src/main/java/com/ctc/wstx/sr/BasicStreamReader.java
+++ b/src/main/java/com/ctc/wstx/sr/BasicStreamReader.java
@@ -1945,7 +1945,7 @@ protected void checkCData() throws XMLStreamException
// Plus, need the bracket too:
char c = getNextCharFromCurrent(SUFFIX_IN_CDATA);
if (c != '[') {
- throwUnexpectedChar(c, "excepted '[' after '') {
- throwUnexpectedChar(c, " excepted space, or '>' or \"/>\"");
+ throwUnexpectedChar(c, " expected space, or '>' or \"/>\"");
}
if (c == '/') {
@@ -3188,7 +3188,7 @@ private final boolean handleNonNsAttrs(char c)
if (c <= CHAR_SPACE) {
c = getNextInCurrAfterWS(SUFFIX_IN_ELEMENT, c);
} else if (c != '/' && c != '>') {
- throwUnexpectedChar(c, " excepted space, or '>' or \"/>\"");
+ throwUnexpectedChar(c, " expected space, or '>' or \"/>\"");
}
if (c == '/') {
c = getNextCharFromCurrent(SUFFIX_IN_ELEMENT);
@@ -4027,7 +4027,7 @@ private final int readPIPrimary()
// Ok, let's just verify we get space then
char c = getNextCharFromCurrent(SUFFIX_IN_XML_DECL);
if (!isSpaceChar(c)) {
- throwUnexpectedChar(c, "excepted a space in xml declaration after 'xml'");
+ throwUnexpectedChar(c, "expected a space in xml declaration after 'xml'");
}
return handleMultiDocStart(START_DOCUMENT);
}
diff --git a/src/test/java/stax2/typed/ReaderBinaryTestBase.java b/src/test/java/stax2/typed/ReaderBinaryTestBase.java
index 456ade63..10827d20 100644
--- a/src/test/java/stax2/typed/ReaderBinaryTestBase.java
+++ b/src/test/java/stax2/typed/ReaderBinaryTestBase.java
@@ -395,7 +395,7 @@ public void testInvalidElemPadding()
/*int count = */ sr.readElementAsBinary(resultBuffer, 0, resultBuffer.length, b64variant);
fail("Should have received an exception for invalid padding");
} catch (TypedXMLStreamException ex) {
- // any way to check that it's the excepted message? not right now
+ // any way to check that it's the expected message? not right now
}
sr.close();
}
@@ -425,7 +425,7 @@ public void testInvalidWhitespace()
/*int count = */ sr.readElementAsBinary(resultBuffer, 0, resultBuffer.length, b64variant);
fail("Should have received an exception for white space used 'inside' 4-char base64 unit");
} catch (TypedXMLStreamException ex) {
- // any way to check that it's the excepted message? not right now
+ // any way to check that it's the expected message? not right now
}
sr.close();
}
@@ -446,7 +446,7 @@ public void testInvalidWeirdChars()
/*int count = */ sr.readElementAsBinary(resultBuffer, 0, resultBuffer.length, b64variant);
fail("Should have received an exception for invalid base64 character");
} catch (TypedXMLStreamException ex) {
- // any way to check that it's the excepted message? not right now
+ // any way to check that it's the expected message? not right now
}
sr.close();
}
@@ -482,7 +482,7 @@ public void testIncompleteInvalidElem()
/*int count = */ sr.readElementAsBinary(resultBuffer, 0, resultBuffer.length, b64variant);
fail("Should have received an exception for incomplete base64 unit");
} catch (TypedXMLStreamException ex) {
- // any way to check that it's the excepted message? not right now
+ // any way to check that it's the expected message? not right now
}
sr.close();
}
@@ -556,7 +556,7 @@ public void testInvalidAttrPadding()
/*byte[] data = */ sr.getAttributeAsBinary(0, b64variant);
fail("Should have received an exception for invalid padding");
} catch (TypedXMLStreamException ex) {
- // any way to check that it's the excepted message? not right now
+ // any way to check that it's the expected message? not right now
}
sr.close();
}
@@ -575,7 +575,7 @@ public void testInvalidAttrWhitespace()
/*byte[] data = */ sr.getAttributeAsBinary(0, b64variant);
fail("Should have received an exception for white space used 'inside' 4-char base64 unit");
} catch (TypedXMLStreamException ex) {
- // any way to check that it's the excepted message? not right now
+ // any way to check that it's the expected message? not right now
}
sr.close();
}
@@ -594,7 +594,7 @@ public void testInvalidAttrWeirdChars()
/*byte[] data = */ sr.getAttributeAsBinary(0, b64variant);
fail("Should have received an exception for invalid base64 character");
} catch (TypedXMLStreamException ex) {
- // any way to check that it's the excepted message? not right now
+ // any way to check that it's the expected message? not right now
}
sr.close();
}
@@ -627,7 +627,7 @@ public void testInvalidAttrIncomplete()
/*byte[] data = */ sr.getAttributeAsBinary(0, b64variant);
fail("Should have received an exception for incomplete base64 unit");
} catch (TypedXMLStreamException ex) {
- // any way to check that it's the excepted message? not right now
+ // any way to check that it's the expected message? not right now
}
sr.close();
}