Skip to content

Commit

Permalink
Merge pull request #194 from schwehr/codespell
Browse files Browse the repository at this point in the history
codespell
  • Loading branch information
hunterhacker authored Oct 20, 2021
2 parents aa6f028 + b7cb36b commit c6065f6
Show file tree
Hide file tree
Showing 56 changed files with 136 additions and 137 deletions.
4 changes: 2 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ Added JDOM_FEATURE constants to JDOMSource and JDOMResult which can be used
with TransformerFactory.getFeature() to determine if the transformer natively
supports JDOM.

Moved the printing of the line seperator after the doctype up to
Moved the printing of the line separator after the doctype up to
output(Document, Writer). This allows someone who doesn't want a newline
after the decl to kludge it away.

Expand Down Expand Up @@ -1052,7 +1052,7 @@ uses an Iterator. Should lighten the burden on outputting large documents.

Added CVS Id variable to the top of each file for better tracking.

Changed pi.getValue("nonexistant") to return null instead of "". Also made it
Changed pi.getValue("nonexistent") to return null instead of "". Also made it
so that any parse error aborts and clears the parse results.

Created a new implementations of clone() without any constructor calls.
Expand Down
2 changes: 1 addition & 1 deletion contrib/src/java/org/jdom2/contrib/beans/DateUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static Date parseDate(String s) {
return new Date(Long.parseLong(s));
}
catch (NumberFormatException nfe) {
// Getting rediculous now...
// Getting ridiculous now...
}

ISO8601 iso = parseISO8601(s);
Expand Down
7 changes: 3 additions & 4 deletions contrib/src/java/org/jdom2/contrib/ids/IdAttribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected Attribute setParent(Element parent) {
if (this.getAttributeType() == Attribute.ID_TYPE) {
Document doc;

// Udpate the owning document's lookup table.
// Update the owning document's lookup table.
if (oldParent != null) {
doc = oldParent.getDocument();
if (doc instanceof IdDocument) {
Expand All @@ -125,7 +125,7 @@ public Attribute setValue(String value) {
super.setValue(value);

if (this.getAttributeType() == Attribute.ID_TYPE) {
// Udpate the owning document's lookup table.
// Update the owning document's lookup table.
Document doc = this.getDocument();
if (doc instanceof IdDocument) {
((IdDocument)doc).removeId(oldValue);
Expand All @@ -142,7 +142,7 @@ public Attribute setAttributeType(AttributeType type) {
if (type != oldType) {
super.setAttributeType(type);

// Udpate the owning document's lookup table.
// Update the owning document's lookup table.
Document doc = this.getDocument();
if (doc instanceof IdDocument) {
if (oldType == Attribute.ID_TYPE) {
Expand All @@ -156,4 +156,3 @@ public Attribute setAttributeType(AttributeType type) {
return this;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
import org.jdom2.input.sax.SAXHandlerFactory;

/**
* This builder works in parallell with {@link LineNumberElement}
* This builder works in parallel with {@link LineNumberElement}
* to provide each element with information on its beginning and
* ending line number in the corresponding source.
* This only works for SAX parsers that supply that information, and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public void setValidation(boolean validate) {
}

/**
* Specifies whether or not the parser should elminate whitespace
* Specifies whether or not the parser should eliminate whitespace
* in element content (sometimes known as "ignorable whitespace")
* when building the document. Only whitespace which is contained
* within element content that has an element only content model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public abstract class XPathMatcher {
"org.jdom2.contrib.input.scanner.JakartaRegExpXPathMatcher";

/**
* The constructor to instanciate a new XPathMatcher concrete
* The constructor to instantiate a new XPathMatcher concrete
* implementation.
*
* @see #newXPathMatcher
Expand Down Expand Up @@ -225,7 +225,7 @@ protected static String getPathPatternAsRE(String expr)
// It the expression ends with a square backet, a test part is
// present. => Strip it!
// Note: Any other sub-expression between square backet is view as
// a RE alphabet definition and proccessed. OK, that's not
// a RE alphabet definition and processed. OK, that's not
// XPath compliant but that's very convenient!
String path = (expr.endsWith("]"))?
expr.substring(0, expr.lastIndexOf('[')): expr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static final void closeWriters() throws IOException {
}

/**
* Ensure instantation cannot occur.
* Ensure instantiation cannot occur.
*/
private SavingVerifier() { }

Expand Down
16 changes: 8 additions & 8 deletions contrib/src/java/org/jdom2/contrib/schema/Schema.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public class Schema {
* @param type the schema type.
*
* @throws JDOMException if the schema document can not be
* parsed according to the specfied type.
* parsed according to the specified type.
* @throws IOException if an I/O error occurred while reading
* the schema document.
*/
Expand Down Expand Up @@ -304,7 +304,7 @@ public List<ValidationError> validate(Element element) throws JDOMException {
* @return the compiled schema.
*
* @throws JDOMException if the schema document can not be
* parsed according to the specfied type.
* parsed according to the specified type.
* @throws IOException if an I/O error occurred while reading
* the schema document.
*/
Expand All @@ -327,7 +327,7 @@ public static Schema parse(String uri, Type type)
* @return the compiled schema.
*
* @throws JDOMException if the schema document can not be
* parsed according to the specfied type.
* parsed according to the specified type.
* @throws IOException if an I/O error occurred while reading
* the schema document.
*/
Expand All @@ -353,7 +353,7 @@ public static Schema parse(InputStream byteStream, Type type, String uri)
* @return the compiled schema.
*
* @throws JDOMException if the schema document can not be
* parsed according to the specfied type.
* parsed according to the specified type.
* @throws IOException if an I/O error occurred while reading
* the schema document.
*/
Expand All @@ -376,7 +376,7 @@ public static Schema parse(Reader reader, Type type, String uri)
* @return the compiled schema.
*
* @throws JDOMException if the schema document can not be
* parsed according to the specfied type.
* parsed according to the specified type.
* @throws IOException if an I/O error occurred while reading
* the schema document.
*/
Expand All @@ -393,14 +393,14 @@ public static Schema parse(File file, Type type)
* according to the specified schema type and returns a compiled
* schema object.
*
* @param source the SAX inout source to read the schema
* @param source the SAX input source to read the schema
* definition from.
* @param type the schema type.
*
* @return the compiled schema.
*
* @throws JDOMException if the schema document can not be
* parsed according to the specfied type.
* parsed according to the specified type.
* @throws IOException if an I/O error occurred while reading
* the schema document.
*/
Expand Down Expand Up @@ -452,7 +452,7 @@ public List<ValidationError> getErrors() {
}

/**
* Returns the JDOM node currently being ouputted by
* Returns the JDOM node currently being outputted by
* SAXOuputter.
*
* @return the current JDOM node.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
final public class VerifierBuilder {

/**
* Ensure instantation cannot occur.
* Ensure instantiation cannot occur.
*/
private VerifierBuilder() { }

Expand Down Expand Up @@ -297,7 +297,7 @@ public static boolean isXMLNameCharacter(final char c) {

// remove check for || c == ':'
// JDOM Attributes and Elements cannot start with ':' since JDOM
// seperates the prefix from the name.
// separates the prefix from the name.
// we do not want ':' in the bitmask, instead we add it later.

return (isXMLLetter(c) || isXMLDigit(c) || c == '.' || c == '-'
Expand All @@ -320,7 +320,7 @@ public static boolean isXMLNameStartCharacter(final char c) {

// remove check for || c == ':'
// JDOM Attributes and Elements cannot start with ':' since JDOM
// seperates the prefix from the name.
// separates the prefix from the name.
// we do not want ':' in the bitmask, instead we add it later.

return (isXMLLetter(c) || c == '_');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private Object wrapContext(Object context) {
case Text:
return DOM.wrap((Text)context);
}
throw new IllegalStateException("Should never break out of swich");
throw new IllegalStateException("Should never break out of switch");
} else if (context instanceof Attribute) {
return DOM.wrap((Attribute)context);
} else if (context instanceof Document) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private static final int getType(NamespaceAware nsa) {
} else if (nsa instanceof NamespacePointer) {
return DTM.NAMESPACE_NODE;
}
throw new IllegalStateException("Unknonw node type " + nsa);
throw new IllegalStateException("Unknown node type " + nsa);
}

private NamespaceAware[] i_nodes = new NamespaceAware[1024];
Expand Down
2 changes: 1 addition & 1 deletion core/src/java/org/jdom2/AttributeList.java
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ void clearAndSet(final Collection<? extends Attribute> collection) {
final int oldModCount = modCount;

// clear the current system
// we need to detatch before we add so that we don't run in to a problem
// we need to detach before we add so that we don't run in to a problem
// where an attribute in the to-add list is one that we are 'clearing'
// first.
while (size > 0) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/java/org/jdom2/CDATA.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void append(final String str) {
}

// we have to do late checking since the end of a CDATA section could
// have been created by concating both strings:
// have been created by concatenating both strings:
// "]" + "]>"
// or
// "]]" + ">"
Expand Down
4 changes: 2 additions & 2 deletions core/src/java/org/jdom2/CloneBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
class CloneBase implements Cloneable {

/**
* Change the permission of the no-arg constructor from public to protcted.
* Change the permission of the no-arg constructor from public to protected.
* <p>
* Otherwise package-private class's constructor is not really public. Changing this to
* 'protected' makes this constructor available to all subclasses regardless of the
Expand All @@ -85,7 +85,7 @@ protected CloneBase() {
* All JDOM core classes are Cloneable, and never throw
* CloneNotSupportedException. Additionally all Cloneable JDOM classes
* return the correct type of instance from this method and there is no
* need to cast the result (co-variant return vaue).
* need to cast the result (co-variant return value).
* <p>
* Subclasses of this should still call super.clone() in their clone method.
*/
Expand Down
2 changes: 1 addition & 1 deletion core/src/java/org/jdom2/DescendantIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void remove() {
// we have a next element, or our next move was up anyway.
return;
}
// our next move was going to be down, or accross, but those are not
// our next move was going to be down, or across, but those are not
// possible any more, need to check up.
// our next will be up.
while (ssize > 0) {
Expand Down
6 changes: 3 additions & 3 deletions core/src/java/org/jdom2/Document.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public Document() {}
*
* @param rootElement <code>Element</code> for document root.
* @param docType <code>DocType</code> declaration.
* @param baseURI the URI from which this doucment was loaded.
* @param baseURI the URI from which this document was loaded.
* @throws IllegalAddException if the given docType object
* is already attached to a document or the given
* rootElement already has a parent
Expand Down Expand Up @@ -555,7 +555,7 @@ public Document setContent(int index, Content child) {
}

/**
* Replace the child at the given index whith the supplied
* Replace the child at the given index with the supplied
* collection.
* <p>
* In event of an exception the original content will be unchanged and
Expand Down Expand Up @@ -688,7 +688,7 @@ public Document clone() {
final Document doc = (Document) super.clone();

// The clone has a reference to this object's content list, so
// owerwrite with a empty list
// overwrite with a empty list
doc.content = new ContentList(doc);

// Add the cloned content to clone
Expand Down
10 changes: 5 additions & 5 deletions core/src/java/org/jdom2/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ public List<Namespace> getAdditionalNamespaces() {
* (i&#46;e&#46; the text that's left after all references are resolved
* and all other markup is stripped out.)
*
* @return a concatentation of all text node descendants
* @return a concatenation of all text node descendants
*/
@Override
public String getValue() {
Expand All @@ -466,7 +466,7 @@ public String getValue() {
* "attachments" to a parent element or document.
* <p>
* An element is a root element when it has a parent and that parent is a
* Document. In particular, this means that detatched Elements are <b>not</b>
* Document. In particular, this means that detached Elements are <b>not</b>
* root elements.
*
* @return whether this is a root element
Expand Down Expand Up @@ -876,7 +876,7 @@ public Element setContent(final int index, final Content child) {
}

/**
* Replace the child at the given index whith the supplied
* Replace the child at the given index with the supplied
* collection.
* <p>
* In event of an exception the original content will be unchanged and
Expand Down Expand Up @@ -1454,7 +1454,7 @@ public Element clone() {
// clone().
// element.parent = null;

// Reference to content list and attribute lists are copyed by
// Reference to content list and attribute lists are copied by
// super.clone() so we set it new lists if the original had lists
element.content = new ContentList(element);
element.attributes = attributes == null ? null : new AttributeList(element);
Expand Down Expand Up @@ -1699,7 +1699,7 @@ public boolean removeChildren(final String cname, final Namespace ns) {
* most complex rules for the namespaces-in-scope.
* <p>
* The scope is built up from a number of sources following the rules of
* XML namespace inheritence as follows:
* XML namespace inheritance as follows:
* <ul>
* <li>The {@link Namespace#XML_NAMESPACE} is added
* <li>The element's namespace is added (commonly
Expand Down
2 changes: 1 addition & 1 deletion core/src/java/org/jdom2/JDOMFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public DocType docType(int line, int col, String elementName,
*
* @param rootElement <code>Element</code> for document root.
* @param docType <code>DocType</code> declaration.
* @param baseURI the URI from which this doucment was loaded.
* @param baseURI the URI from which this document was loaded.
* @return the created Document instance
*/
public Document document(Element rootElement, DocType docType, String baseURI);
Expand Down
2 changes: 1 addition & 1 deletion core/src/java/org/jdom2/Namespace.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public static Namespace getNamespace(final String prefix, final String uri) {
// 1. avoid having to create a new NamespaceKey for each query.
// 2. avoid a 'big' synchronisation bottleneck in the Namespace class.
// 3. no-memory-lookup for pre-existing Namespaces... (avoid 'new' and
// most String methods that allocte memory (like trim())
// most String methods that allocate memory (like trim())

if (uri == null) {
if (prefix == null || NS_PREFIX_DEFAULT.equals(prefix)) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/java/org/jdom2/Verifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ private static final byte[] buildBitFlags() {
private static final byte MASKXMLLETTERORDIGIT = MASKXMLLETTER | MASKXMLDIGIT;

/**
* Ensure instantation cannot occur.
* Ensure instantiation cannot occur.
*/
private Verifier() { }

Expand Down Expand Up @@ -1206,7 +1206,7 @@ public static boolean isXMLCombiningChar(final char c) {
*/
public static boolean isXMLExtender(final char c) {
/*
* This function is not accellerated by the bitmask system because
* This function is not accelerated by the bitmask system because
* there are no longer any actual calls to it from the JDOM code.
* It used to be called by the isXMLNameCharacter() method before
* the bitmask optimization. Now the VerifierBuilder code actually
Expand Down
Loading

0 comments on commit c6065f6

Please sign in to comment.