From 0934210cc1ac12ffe2045a1b7f190ba375e15e0b Mon Sep 17 00:00:00 2001 From: Andrius Merkys <merkys@debian.org> Date: Tue, 23 Aug 2022 02:06:22 -0400 Subject: [PATCH] New upstream version 2.3 --- .github/workflows/maven.yml | 2 +- .gitignore | 6 +-- CITATION.cff | 6 +-- README.md | 2 +- pom.xml | 23 ++++++++-- .../data_structure/ThriftyList.java | 16 ++++--- src/main/java/org/xmlcml/euclid/IntSet.java | 5 --- src/main/java/org/xmlcml/euclid/Line2.java | 1 - .../java/org/xmlcml/euclid/Real2Array.java | 2 +- .../xmlcml/euclid/Real2RangeComparator.java | 2 +- .../java/org/xmlcml/euclid/RealArray.java | 2 +- .../org/xmlcml/euclid/RealComparator.java | 2 +- .../xmlcml/euclid/RealRangeComparator.java | 2 +- .../java/org/xmlcml/euclid/Transform2.java | 9 ++-- .../java/org/xmlcml/euclid/Univariate.java | 4 -- src/main/java/org/xmlcml/euclid/Util.java | 15 +++---- src/main/java/org/xmlcml/euclid/Vector2.java | 2 +- src/main/java/org/xmlcml/stml/STMLArray.java | 20 +++------ .../java/org/xmlcml/stml/STMLElement.java | 4 +- src/main/java/org/xmlcml/stml/STMLScalar.java | 10 +---- .../stml/attribute/DelimiterAttribute.java | 2 +- .../xmlcml/stml/attribute/IntSTAttribute.java | 2 - .../xmlcml/stml/interfacex/HasDictRef.java | 2 +- .../java/org/xmlcml/testutil/TestUtils.java | 5 +-- src/main/java/org/xmlcml/xml/XMLUtil.java | 44 +++++++++---------- 25 files changed, 85 insertions(+), 105 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 3787ed4..bfcf786 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ 8, 11, 14 ] + java: [ 8, 11, 14, 17 ] name: Java ${{ matrix.java }} steps: diff --git a/.gitignore b/.gitignore index e4d63c1..660eb0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ foo -^.project$ -^.settings/ -^.classpath$ +.project +.settings/ +.classpath ^.hgignore~$ ^.gitignore~$ ^target/.* diff --git a/CITATION.cff b/CITATION.cff index 82483dc..ae5726c 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,9 +1,9 @@ cff-version: 1.2.0 message: "If you use this software, please cite it as below." title: Euclid -version: 2.1 -date-released: 2022-03-27 -url: "https://github.com/BlueObelisk/cmlxom" +version: 2.3 +date-released: 2022-08-21 +url: "https://github.com/BlueObelisk/euclid" preferred-citation: type: article authors: diff --git a/README.md b/README.md index d885ef9..75a64a1 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ It's used a lot in CML tools (JUMBO, JUMBO-converters) and also AMI (for extract Instructions to increase the version: ```shell -mvn versions:set -DnewVersion=2.2-SNAPSHOT +mvn versions:set -DnewVersion=2.4-SNAPSHOT ``` Deploy to Sonatype with the following commands, for snapshots and releases respectively: diff --git a/pom.xml b/pom.xml index 92f4097..07204a8 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ <groupId>org.blueobelisk</groupId> <artifactId>euclid</artifactId> - <version>2.1</version> + <version>2.3</version> <packaging>jar</packaging> <properties> @@ -230,13 +230,18 @@ <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> - <version>2.17.2</version> + <version>2.18.0</version> <type>pom</type> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-1.2-api</artifactId> - <version>2.17.2</version> + <version>2.18.0</version> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + <version>2.18.0</version> </dependency> <dependency> @@ -253,13 +258,23 @@ <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> - <version>2.10.14</version> + <version>2.11.0</version> </dependency> <dependency> <groupId>xom</groupId> <artifactId>xom</artifactId> <version>1.3.7</version> + <exclusions> + <exclusion> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> + </exclusion> + <exclusion> + <groupId>xalan</groupId> + <artifactId>xalan</artifactId> + </exclusion> + </exclusions> </dependency> </dependencies> diff --git a/src/main/java/blogspot/software_and_algorithms/stern_library/data_structure/ThriftyList.java b/src/main/java/blogspot/software_and_algorithms/stern_library/data_structure/ThriftyList.java index 625a521..8d9d282 100644 --- a/src/main/java/blogspot/software_and_algorithms/stern_library/data_structure/ThriftyList.java +++ b/src/main/java/blogspot/software_and_algorithms/stern_library/data_structure/ThriftyList.java @@ -48,12 +48,8 @@ import java.util.NoSuchElementException; * this data structure achieves O(sqrt(this.size())) time middle * insertion/deletion by maintaining circular lists throughout. * <p> - * - * @author Kevin L. Stern - * - * @see ArrayList - * @see ArrayDeque - * @techreport{ResizableArraysTR, author = {Andrej Brodnik and Svante Carlsson + * <pre> + * @techreport{ResizableArraysTR, author = {Andrej Brodnik and Svante Carlsson * and Erik D. Demaine and J. Ian Munro and * Robert Sedgewick}, title = {Resizable Arrays * in Optimal Time and Space}, institution = @@ -64,10 +60,16 @@ import java.util.NoSuchElementException; * {http://www.cs.uwaterloo * .ca/research/tr/1999/09/CS-99-09.pdf}, year = * {1999}} - * @misc{Goodrich_tieredvectors:, author = {Michael T. Goodrich and John G. + * @misc{Goodrich_tieredvectors:, author = {Michael T. Goodrich and John G. * Kloss and II}, title = {Tiered Vectors: * Efficient Dynamic Arrays for Rank-Based * Sequences}, year = {} } + * </pre> + * + * @author Kevin L. Stern + * + * @see ArrayList + * @see ArrayDeque */ public class ThriftyList<T> extends AbstractList<T> implements List<T>, Deque<T>, Serializable, Cloneable { diff --git a/src/main/java/org/xmlcml/euclid/IntSet.java b/src/main/java/org/xmlcml/euclid/IntSet.java index 7da98f4..d822413 100644 --- a/src/main/java/org/xmlcml/euclid/IntSet.java +++ b/src/main/java/org/xmlcml/euclid/IntSet.java @@ -56,11 +56,6 @@ public class IntSet implements EuclidConstants { Set<Integer> set; - /** gets all permutations of integers from 0 to n-1. - * crude - * @param number - * @return list of all permutations (no special order) - */ public static Map<Integer, List<List<Integer>>> integerMap = new HashMap<Integer, List<List<Integer>>>(); /** diff --git a/src/main/java/org/xmlcml/euclid/Line2.java b/src/main/java/org/xmlcml/euclid/Line2.java index e58bdb0..d63a4e1 100644 --- a/src/main/java/org/xmlcml/euclid/Line2.java +++ b/src/main/java/org/xmlcml/euclid/Line2.java @@ -426,7 +426,6 @@ public class Line2 implements EuclidConstants { /** set point at either end. * * @param i (0/from or 1/to) - * @return */ public void setXY(Real2 xy, int i) { if (i == 0) { diff --git a/src/main/java/org/xmlcml/euclid/Real2Array.java b/src/main/java/org/xmlcml/euclid/Real2Array.java index 4826073..0cd8658 100644 --- a/src/main/java/org/xmlcml/euclid/Real2Array.java +++ b/src/main/java/org/xmlcml/euclid/Real2Array.java @@ -252,7 +252,7 @@ public class Real2Array implements EuclidConstants , Iterable<Real2> { * get element. * * @param elem - * @return element + * @param r2 */ public void setElement(int elem, Real2 r2) { xarr.setElementAt(elem, r2.getX()); diff --git a/src/main/java/org/xmlcml/euclid/Real2RangeComparator.java b/src/main/java/org/xmlcml/euclid/Real2RangeComparator.java index 3db74b1..aaeb71c 100755 --- a/src/main/java/org/xmlcml/euclid/Real2RangeComparator.java +++ b/src/main/java/org/xmlcml/euclid/Real2RangeComparator.java @@ -19,7 +19,7 @@ import java.util.Comparator; import org.apache.log4j.Logger; -/** comparator for use with TreeSet<Double> and other tools which normally require equals(). +/** comparator for use with {@code TreeSet<Double>} and other tools which normally require equals(). * * @author pm286 * diff --git a/src/main/java/org/xmlcml/euclid/RealArray.java b/src/main/java/org/xmlcml/euclid/RealArray.java index b558d4c..67b7a76 100644 --- a/src/main/java/org/xmlcml/euclid/RealArray.java +++ b/src/main/java/org/xmlcml/euclid/RealArray.java @@ -1500,7 +1500,7 @@ public class RealArray extends ArrayBase implements Iterable<Double> { * experimental approach to finding baseline and adjusting to it. * Finds peak of distribution * read source code if you need to use this - * @throws JumboException (many) + * * @return base offset */ public double getBaseLine() { diff --git a/src/main/java/org/xmlcml/euclid/RealComparator.java b/src/main/java/org/xmlcml/euclid/RealComparator.java index 63b3c9e..5df89e7 100755 --- a/src/main/java/org/xmlcml/euclid/RealComparator.java +++ b/src/main/java/org/xmlcml/euclid/RealComparator.java @@ -17,7 +17,7 @@ package org.xmlcml.euclid; import java.util.Comparator; -/** comparator for use with TreeSet<Double> and other tools which normally require equals(). +/** comparator for use with {@code TreeSet<Double>} and other tools which normally require equals(). * epsilon is initially set to zero, so only exact equality matches * * @author pm286 diff --git a/src/main/java/org/xmlcml/euclid/RealRangeComparator.java b/src/main/java/org/xmlcml/euclid/RealRangeComparator.java index 0692b1a..c202fbf 100755 --- a/src/main/java/org/xmlcml/euclid/RealRangeComparator.java +++ b/src/main/java/org/xmlcml/euclid/RealRangeComparator.java @@ -17,7 +17,7 @@ package org.xmlcml.euclid; import java.util.Comparator; -/** comparator for use with TreeSet<Double> and other tools which normally require equals(). +/** comparator for use with {@code TreeSet<Double>} and other tools which normally require equals(). * * @author pm286 * diff --git a/src/main/java/org/xmlcml/euclid/Transform2.java b/src/main/java/org/xmlcml/euclid/Transform2.java index 46c611a..53b078c 100644 --- a/src/main/java/org/xmlcml/euclid/Transform2.java +++ b/src/main/java/org/xmlcml/euclid/Transform2.java @@ -298,8 +298,7 @@ public class Transform2 extends RealSquareMatrix { *@param in Description of the Parameter *@param out Description of the Parameter *@param keepAspectRatio Description of the Parameter - *@exception ArithmeticException Description of the Exception - *@throws zero-sized dimensions + *@throws ArithmeticException */ public Transform2(Window2 in, Window2 out, boolean keepAspectRatio) throws ArithmeticException { @@ -322,8 +321,7 @@ public class Transform2 extends RealSquareMatrix { *@param originOut Description of the Parameter *@param dimensionOut Description of the Parameter *@param keepAspectRatio Description of the Parameter - *@exception ArithmeticException Description of the Exception - *@throws zero-sized dimensions + *@throws ArithmeticException */ public Transform2(Real2 originIn, Real2 dimensionIn, Real2 originOut, Real2 dimensionOut, boolean keepAspectRatio) throws ArithmeticException { @@ -612,7 +610,6 @@ public class Transform2 extends RealSquareMatrix { * Description of the Parameter * @return Description of the Return Value * @exception EuclidRuntimeException - * <code>r</code> is zero length */ public static Transform2 flipAboutVector(Real2 r) throws EuclidRuntimeException { r = r.getUnitVector(); @@ -635,7 +632,7 @@ public class Transform2 extends RealSquareMatrix { /** * get translation component only * - * @return The translation value + * @param xy */ public void setTranslation(Real2 xy) { flmat[0][2] = xy.x; diff --git a/src/main/java/org/xmlcml/euclid/Univariate.java b/src/main/java/org/xmlcml/euclid/Univariate.java index d80d776..66522f4 100644 --- a/src/main/java/org/xmlcml/euclid/Univariate.java +++ b/src/main/java/org/xmlcml/euclid/Univariate.java @@ -235,8 +235,6 @@ public class Univariate { * by standard deviation. result (the "z"-values") therefore have mean of * zero and stdev of 1.0. does not modify this. * - * @ arrays too small - * * @return the normalized values */ public RealArray getNormalizedValues() { @@ -257,8 +255,6 @@ public class Univariate { * get deviate values. array transformed by subtrating mean. result * therefore has mean of zero. does not modify this. * - * @ arrays too small - * * @return the deviate values */ public RealArray getDeviateValues() { diff --git a/src/main/java/org/xmlcml/euclid/Util.java b/src/main/java/org/xmlcml/euclid/Util.java index f264517..9a4c0d8 100644 --- a/src/main/java/org/xmlcml/euclid/Util.java +++ b/src/main/java/org/xmlcml/euclid/Util.java @@ -774,7 +774,7 @@ public class Util implements EuclidConstants { /** * remove balanced (well-formed) markup from a string. Crude (that is not - * fully XML-compliant);</BR> Example: "This is <A + * fully XML-compliant);<BR /> Example: "This is <A * HREF="foo">bar</A> and </BR> a break" goes to "This is bar * and a break" * @@ -1797,11 +1797,11 @@ public class Util implements EuclidConstants { /** * convert single IsoLatin1 character to 2 UTF8 characters . quick and dirty - * user has responsibility for selecting characters a {@literal >}= x80 && a {@literal <}= xBF =={@literal >} - * xC2 a a {@literal >}= xC0 && a {@literal <}= xFF =={@literal >} xC3 a - x40 + * user has responsibility for selecting characters a {@literal >}= x80 AND a {@literal <}= xBF =={@literal >} + * xC2 a a {@literal >}= xC0 AND a {@literal <}= xFF =={@literal >} xC3 a - x40 * * @param a - * char to be converted (a {@literal >}= x80 && a {@literal <}xff) + * char to be converted (a {@literal >}= x80 AND a {@literal <}xff) * @return 2 characters or null */ public static char[] convertLatin1ToUTF8(char a) { @@ -2929,7 +2929,6 @@ public class Util implements EuclidConstants { /** outputs to sysout. * primarily to allow trapping and tracing of sysout calls * which we try to avoid anyway - * @param s */ public static void println() { SYSOUT.println(); @@ -3046,9 +3045,9 @@ public class Util implements EuclidConstants { * from Stackoverflow: * http://stackoverflow.com/questions/204784/how-to-construct-a-relative-path-in-java-from-two-absolute-paths-or-urls * - * @param target targetPath is calculated to this file - * @param base basePath is calculated from this file - * @param separator directory separator. The platform default is not assumed so that we can test Unix behaviour when running on Windows (for example) + * @param targetPath targetPath is calculated to this file + * @param basePath basePath is calculated from this file + * @param pathSeparator directory separator. The platform default is not assumed so that we can test Unix behaviour when running on Windows (for example) * @return */ public static String getRelativePath(String targetPath, String basePath, String pathSeparator) { diff --git a/src/main/java/org/xmlcml/euclid/Vector2.java b/src/main/java/org/xmlcml/euclid/Vector2.java index 920be5f..38dcec3 100644 --- a/src/main/java/org/xmlcml/euclid/Vector2.java +++ b/src/main/java/org/xmlcml/euclid/Vector2.java @@ -97,7 +97,7 @@ public class Vector2 extends Real2 { * projection of this onto vector. does not alter this. result = vector.norm() * * (this.norm() dot vector.norm()) * - * @param v vector to project onto + * @param v2 vector to project onto * @return projected vector */ public Vector2 projectOnto(Vector2 v2) { diff --git a/src/main/java/org/xmlcml/stml/STMLArray.java b/src/main/java/org/xmlcml/stml/STMLArray.java index ded3863..3461993 100755 --- a/src/main/java/org/xmlcml/stml/STMLArray.java +++ b/src/main/java/org/xmlcml/stml/STMLArray.java @@ -189,8 +189,6 @@ public class STMLArray extends STMLElement implements HasUnits, HasArraySize, * * @param array * @param delimiter - * @throws STMLException - * doubles must not contain delimiter */ public STMLArray(int[] array, String delimiter) { setDelimiter(delimiter); @@ -251,9 +249,12 @@ public class STMLArray extends STMLElement implements HasUnits, HasArraySize, /** * creates array of type comptatible with scalar can be used to add * subsequently scalar contents to array does NOT add scalar contents - * typical use List<STMLScalar> scalars; STMLArray array = + * typical use: + * <pre> + * List<STMLScalar> scalars; STMLArray array = * STMLArray.createEmptyArray(scalars.get(0)); for (STMLScalar scalar : * scalars) { array.append(scalar); } + * </pre> * * @param scalar * @return @@ -269,7 +270,6 @@ public class STMLArray extends STMLElement implements HasUnits, HasArraySize, /** * creates a new array formed from a subset of the current array - * @param array * @param start inclusive start * @param end inclusive end * @return new array of correct dataType and dictRef; null if fails @@ -765,8 +765,6 @@ public class STMLArray extends STMLElement implements HasUnits, HasArraySize, * * @param array * the array to test; can have different owner - * @throws STMLException - * if not of same numeric data type and size */ public void checkNumericConformability(STMLArray array) { String thisDataType = this.getDataType(); @@ -791,8 +789,6 @@ public class STMLArray extends STMLElement implements HasUnits, HasArraySize, * * @param array * the array to subtract; can have different owner - * @throws STMLException - * inappropriate dataTypes, unequal arrays * @return new array */ public STMLArray subtract(STMLArray array) { @@ -823,9 +819,6 @@ public class STMLArray extends STMLElement implements HasUnits, HasArraySize, * * @param array * the array to add; can have different owner - * @throws STMLException - * inappropriate dataTypes, unequal arrays - * * @return the new array */ public STMLArray plus(STMLArray array) { @@ -870,8 +863,7 @@ public class STMLArray extends STMLElement implements HasUnits, HasArraySize, /** * add a double. datatype must have been set to XSD_DOUBLE * - * @param d - * double to add + * @param b * @throws RuntimeException * dataType not XSD_DOUBLE */ @@ -1053,7 +1045,7 @@ public class STMLArray extends STMLElement implements HasUnits, HasArraySize, /** makes a list of STMLArrays * * @param elements - * @return List<STMLArray> + * @return {@code List<STMLArray>} */ public static List<STMLArray> extractArrays(List<Element> elements) { List<STMLArray> arrayList = new ArrayList<STMLArray>(); diff --git a/src/main/java/org/xmlcml/stml/STMLElement.java b/src/main/java/org/xmlcml/stml/STMLElement.java index f28fbfa..6cf6d03 100755 --- a/src/main/java/org/xmlcml/stml/STMLElement.java +++ b/src/main/java/org/xmlcml/stml/STMLElement.java @@ -144,7 +144,7 @@ public class STMLElement extends Element implements XMLConstants { /** converts a SVG file to SVGElement * - * @param file + * @param is * @return */ public static STMLElement readAndCreateSTML(InputStream is) { @@ -294,8 +294,6 @@ public class STMLElement extends Element implements XMLConstants { * * @param name * of attribute - * @throws STMLException - * standard message */ protected void unknownAttributeName(String name) { throw new RuntimeException("Unknown STML attribute " + name + " on " diff --git a/src/main/java/org/xmlcml/stml/STMLScalar.java b/src/main/java/org/xmlcml/stml/STMLScalar.java index bc50c98..6661c78 100755 --- a/src/main/java/org/xmlcml/stml/STMLScalar.java +++ b/src/main/java/org/xmlcml/stml/STMLScalar.java @@ -55,7 +55,7 @@ public class STMLScalar extends STMLElement implements HasUnits, HasScalar, HasD } /** - * contructor. + * constructor. * * @param old */ @@ -369,8 +369,6 @@ public class STMLScalar extends STMLElement implements HasUnits, HasScalar, HasD * * @param scalar * the scalar to subtract; can have different owner - * @throws CMLException - * inappropriate dataTypes * @return new scalar */ public STMLScalar subtract(STMLScalar scalar) { @@ -392,8 +390,6 @@ public class STMLScalar extends STMLElement implements HasUnits, HasScalar, HasD * * @param scalar * the scalar to subtract; can have different owner - * @throws CMLException - * inappropriate dataTypes, unequal scalars */ public void subtractEquals(STMLScalar scalar) { checkNumericConformability(scalar); @@ -412,8 +408,6 @@ public class STMLScalar extends STMLElement implements HasUnits, HasScalar, HasD * * @param scalar * the scalar to add; - * @throws CMLException - * inappropriate dataTypes * @return new scalar */ public STMLScalar plus(STMLScalar scalar) { @@ -435,8 +429,6 @@ public class STMLScalar extends STMLElement implements HasUnits, HasScalar, HasD * * @param scalar * the scalar to subtract; - * @throws CMLException - * inappropriate dataTypes, unequal scalars */ public void plusEquals(STMLScalar scalar) { checkNumericConformability(scalar); diff --git a/src/main/java/org/xmlcml/stml/attribute/DelimiterAttribute.java b/src/main/java/org/xmlcml/stml/attribute/DelimiterAttribute.java index 8ab1b3b..cb1b562 100755 --- a/src/main/java/org/xmlcml/stml/attribute/DelimiterAttribute.java +++ b/src/main/java/org/xmlcml/stml/attribute/DelimiterAttribute.java @@ -246,7 +246,7 @@ public class DelimiterAttribute extends StringSTAttribute { /** set double content. if delimiter is not whitespace, prepend and append it * - * @param dd array of doubles + * @param bb array of booleans * @return string */ public String getDelimitedXMLContent(boolean[] bb) { diff --git a/src/main/java/org/xmlcml/stml/attribute/IntSTAttribute.java b/src/main/java/org/xmlcml/stml/attribute/IntSTAttribute.java index 1612734..28ac059 100755 --- a/src/main/java/org/xmlcml/stml/attribute/IntSTAttribute.java +++ b/src/main/java/org/xmlcml/stml/attribute/IntSTAttribute.java @@ -126,8 +126,6 @@ public class IntSTAttribute extends STMLAttribute { * * @param i * the value - * @throws STMLException - * wrong type or value fails */ public void checkValue(int i) { if (cmlType != null) { diff --git a/src/main/java/org/xmlcml/stml/interfacex/HasDictRef.java b/src/main/java/org/xmlcml/stml/interfacex/HasDictRef.java index 0933634..2d639f8 100755 --- a/src/main/java/org/xmlcml/stml/interfacex/HasDictRef.java +++ b/src/main/java/org/xmlcml/stml/interfacex/HasDictRef.java @@ -53,7 +53,7 @@ public interface HasDictRef { /** set dictRef value. * - * @return value + * @param dictRef */ void setDictRef(String dictRef); diff --git a/src/main/java/org/xmlcml/testutil/TestUtils.java b/src/main/java/org/xmlcml/testutil/TestUtils.java index e57483a..f5d4dae 100644 --- a/src/main/java/org/xmlcml/testutil/TestUtils.java +++ b/src/main/java/org/xmlcml/testutil/TestUtils.java @@ -1135,8 +1135,7 @@ public final class TestUtils implements STMLConstants { * tests 2 XML objects for equality using canonical XML. * * @param message - * @param refNode - * first node + * @param refXMLString * @param testNode * second node * @param stripWhite @@ -1390,7 +1389,7 @@ public final class TestUtils implements STMLConstants { /** * convenience method to parse test file. - * @param filename relative to classpath + * @param file relative to classpath * @return root element */ public static Element parseValidFile(File file) { diff --git a/src/main/java/org/xmlcml/xml/XMLUtil.java b/src/main/java/org/xmlcml/xml/XMLUtil.java index 809fce1..b63c663 100755 --- a/src/main/java/org/xmlcml/xml/XMLUtil.java +++ b/src/main/java/org/xmlcml/xml/XMLUtil.java @@ -132,7 +132,6 @@ public abstract class XMLUtil implements XMLConstants { * uses element.query(xpath, xPathContext); * @param element * @param xpath - * @param xPathContext defines prefix/namespace used in query * @return value if exactly 1 node (0 or many returns null) */ public static String getSingleValue(Element element, String xpath) { @@ -231,11 +230,7 @@ public abstract class XMLUtil implements XMLConstants { * * @param el * the element - * @param os - * output stream - * @param indent - * indentation - * @throws IOException + * @param message */ public static void debug(Element el, String message) { Util.println(">>>>" + message + ">>>>"); @@ -539,8 +534,9 @@ public abstract class XMLUtil implements XMLConstants { } /** - * copies atributes of 'from' to 'to' - * @param element + * copies attributes of 'from' to 'to' + * @param from + * @param to * @throws IllegalArgumentException null arguments */ public static void copyAttributes(Element from, Element to) throws IllegalArgumentException { @@ -697,8 +693,8 @@ public abstract class XMLUtil implements XMLConstants { * tests 2 XML objects for equality using recursive descent. * includes namespace testing * - * @param refString xml serialization of first Element - * @param testNode second Element + * @param refNodeXML xml serialization of first Element + * @param testElement second Element * @param stripWhite if true remove w/s nodes * @return message of where elements differ (null if identical) */ @@ -719,8 +715,8 @@ public abstract class XMLUtil implements XMLConstants { * tests 2 XML objects for equality using recursive descent. * includes namespace testing * - * @param refNode first node - * @param testNode second node + * @param refElement first node + * @param testElement second node * @param stripWhite if true remove w/s nodes * @return message of where elements differ (null if identical) */ @@ -1145,12 +1141,12 @@ public abstract class XMLUtil implements XMLConstants { * take many seconds or, if offline, can cause failure to parse. * * This is dangerous but so is the DOCTYPE - * -<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN' - 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'> + * <pre> + * <!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN' + * 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'> + * </pre> * @param s * @return - * @throws IOException */ public static String stripDTD(String s) { if (s != null) { @@ -1171,7 +1167,6 @@ public abstract class XMLUtil implements XMLConstants { 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'> * @param s * @return - * @throws IOException */ public static Element stripDTDAndParse(String s) { Element root = null; @@ -1186,10 +1181,12 @@ public abstract class XMLUtil implements XMLConstants { * * crude - adds /{@literal >} and then deletes any /{@literal >}{@literal (/tag)} * - * String s = "<a><meta></a>"; - s = XMLUtil.addMissingEndTags(s, "meta"); - Assert.assertEquals("<a><meta/></a>", s); - + * <pre> + * String s = "<a><meta></a>"; + * s = XMLUtil.addMissingEndTags(s, "meta"); + * Assert.assertEquals("<a><meta/></a>", s); + * </pre> + * * @param s * @param tag * @return @@ -1264,8 +1261,9 @@ public abstract class XMLUtil implements XMLConstants { } /** - * copies atributes of 'from' to 'to' - * @param element + * copies attributes of 'from' to 'to' + * @param from + * @param to */ public static void copyAttributesFromTo(Element from, Element to) { int natt = from.getAttributeCount(); -- GitLab