diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 3787ed42bebc2bebc584d917cd577bd87eb7af4e..bfcf786af53efbc0fefd137a21191c42f1f268a1 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 e4d63c1391602effa65814d44ec3d09f77e5e5b2..660eb0c0aac328b47627b18b8839e6024b9a2cd8 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 82483dc719d12b6eab06540ac96907338e5c5237..ae5726cbfa2a2f631a6e572b441c8abe18d4a0f9 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 d885ef9cbaf38f07b7395bd54c1ddbbb7ee520d9..75a64a1c0caf9fc267d3f0bb41a81e1dd23ab8de 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 92f4097c265e45ea3fd0b2fc7042f44fa07db1eb..07204a8ea57c5976170b406c49f6640e3101a744 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 625a521741a6bc77c8a0f7e6ccf8e28a9a61c463..8d9d28287560898fdfe3b77148432253232c2471 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 7da98f414e2338e8b0eb209e7246a9c6f8ed3100..d822413fd09cffd339e38f3fb2be691e4579b533 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 e58bdb00ee014029f9d159263a895151fc785d59..d63a4e1b7735e65ace31b0c3e4cec98e9acb18be 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 4826073a7864f82b230bc2ba0e07320e129aa74e..0cd86589c4f612776a746c90f7cc5b2d701d0280 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 3db74b15907ea05bef154d38ac773b43925b9c58..aaeb71c0f318ea6739029d9dd6290b10efa9bdb6 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 b558d4c803f0c9d5fbfa1e99ab8f4cbb74c22078..67b7a76e5850d4376a51aba255cce6994c41e3d6 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 63b3c9ee17deb17f0c1d6d1cb93704b086424c64..5df89e78583b352caba26c417f9de98e483b355b 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 0692b1ab26c44f931c9563a868eca0f294cd3505..c202fbf6661419179a367094285b375436c5748a 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 46c611ad7717c96db6b4e5acc9f9437a8dbf113a..53b078c34c1fe2d573e3b33a8b93467dcaea88a1 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 d80d776533fa8c42aa0420189e2f6be629fecf2e..66522f42e7635beaf6a72cea1cd06a7d545dd0e8 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 f264517529d236855f4cd5981485990769cfc493..9a4c0d8c9fcfc85b922d97299b9f76e501588ac6 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 920be5ff62c5e67754c225ab4282ee4581e2d2bd..38dcec3b20356e9ed5745c1dbca18f8bafe98b76 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 ded386330ff604aa5e1b380413f6a0492eb90969..3461993b60060d32b57f0198d202f912991486eb 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 f28fbfa23bb6950b17b273ffbd17d61f6b6bdd6e..6cf6d03485770d2de3535456953dfd0724418b8d 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 bc50c98de2da197367af4d7a6c8de5ed918be187..6661c78080afff495a7f447f4ccdb3f3767365f9 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 8ab1b3b509fa32e5a10f81b8cc184199118e1fb6..cb1b562d8c8759ad7175aeb30aa4516c650f9746 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 16127348b942b93b92ad24da5456e997b44d76d9..28ac059152fac66bbbdc2b6d0eb97bd7d4e0ef8e 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 093363408df91c3bdb4bf46fd85a18be68c4d7a4..2d639f83f6089a36623fd9e0c0d0ba587e566d3e 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 e57483a1225e3e4eb66b71aa32eb24448801db51..f5d4dae0399a9658e791fc870d39553a69caed6a 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 809fce13cd65a0ef5c5ca9aafdd0c031cb48cfc6..b63c66393114e448dd0e768d346a873d52878166 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();