diff --git a/build.gradle b/build.gradle index 9c63da3..024a5ba 100644 --- a/build.gradle +++ b/build.gradle @@ -4,9 +4,9 @@ plugins { id "pmd" id 'maven-publish' id 'signing' - id "io.github.gradle-nexus.publish-plugin" version "1.3.0" - id "com.github.spotbugs" version "5.0.14" - id "org.cyclonedx.bom" version "1.7.2" + id "io.github.gradle-nexus.publish-plugin" version "2.0.0-rc-1" + id "com.github.spotbugs" version "6.0.0-beta.3" + id "org.cyclonedx.bom" version "1.7.4" id "org.xbib.gradle.plugin.asciidoctor" version "3.0.0" } @@ -38,7 +38,7 @@ subprojects { apply from: rootProject.file('gradle/documentation/asciidoc.gradle') apply from: rootProject.file('gradle/quality/checkstyle.gradle') apply from: rootProject.file('gradle/quality/pmd.gradle') - apply from: rootProject.file('gradle/quality/spotbugs.gradle') + //apply from: rootProject.file('gradle/quality/spotbugs.gradle') apply from: rootProject.file('gradle/publish/maven.gradle') } apply from: rootProject.file('gradle/publish/sonatype.gradle') diff --git a/datastructures-csv/src/main/java/org/xbib/datastructures/csv/Token.java b/datastructures-csv/src/main/java/org/xbib/datastructures/csv/Token.java index c05ea05..9fc6ec2 100644 --- a/datastructures-csv/src/main/java/org/xbib/datastructures/csv/Token.java +++ b/datastructures-csv/src/main/java/org/xbib/datastructures/csv/Token.java @@ -8,6 +8,9 @@ public final class Token { boolean isReady; + public Token() { + } + public void reset() { content.setLength(0); type = TokenType.INVALID; diff --git a/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/Json.java b/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/Json.java index f4b953e..acc241f 100644 --- a/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/Json.java +++ b/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/Json.java @@ -4,6 +4,9 @@ public class Json { public static final String DEFAULT_INDENT = " "; + public Json() { + } + public static Node parse(String raw) throws ParseException { return create(new Parser(raw), 0); } @@ -20,23 +23,13 @@ public class Json { public static Node create(Parser parser, int element) { Type type = parser.getType(element); - switch (type) { - case NULL: - return new NullLiteral(); - case TRUE: - case FALSE: - return new BoolLiteral(Boolean.parseBoolean(parser.getJson(element))); - case NUMBER: - return new NumberLiteral(parser.getJson(element)); - case STRING_ESCAPED: - case STRING: - return new ParsedString(parser, element); - case ARRAY: - return new ParsedList(parser, element); - case OBJECT: - return new ParsedMap(parser, element); - default: - throw new IllegalStateException(); - } + return switch (type) { + case NULL -> new NullLiteral(); + case TRUE, FALSE -> new BoolLiteral(Boolean.parseBoolean(parser.getJson(element))); + case NUMBER -> new NumberLiteral(parser.getJson(element)); + case STRING_ESCAPED, STRING -> new ParsedString(parser, element); + case ARRAY -> new ParsedList(parser, element); + case OBJECT -> new ParsedMap(parser, element); + }; } } diff --git a/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/JsonList.java b/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/JsonList.java index b8eca86..8bf4483 100644 --- a/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/JsonList.java +++ b/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/JsonList.java @@ -3,6 +3,7 @@ package org.xbib.datastructures.json.flat; import java.util.ArrayList; import java.util.List; +@SuppressWarnings("serial") class JsonList extends ArrayList { public JsonList() { @@ -12,20 +13,4 @@ class JsonList extends ArrayList { public JsonList(List values) { super(values); } - - /*@Override - public String toString() { - boolean append = false; - StringBuilder result = new StringBuilder("["); - for (E e : this) { - if (append) { - result.append(","); - } - result.append(e); - append = true; - } - result.append("]"); - return result.toString(); - }*/ - } diff --git a/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/JsonMap.java b/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/JsonMap.java index 87b16f7..baca02e 100644 --- a/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/JsonMap.java +++ b/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/JsonMap.java @@ -1,24 +1,7 @@ package org.xbib.datastructures.json.flat; import java.util.LinkedHashMap; -import java.util.Map; +@SuppressWarnings("serial") class JsonMap extends LinkedHashMap { - - /*@Override - public String toString() { - StringBuilder result = new StringBuilder("{"); - int count = 0; - for (Map.Entry entry : entrySet()) { - if (count > 0) { - result.append(","); - } - String key = StringUtil.escape((String) entry.getKey()); - result.append(String.format("\"%s\":%s", key, entry.getValue())); - count++; - } - result.append("}"); - return result.toString(); - }*/ - } diff --git a/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/ParseException.java b/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/ParseException.java index 5c4553e..b26b815 100644 --- a/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/ParseException.java +++ b/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/ParseException.java @@ -2,6 +2,7 @@ package org.xbib.datastructures.json.flat; import java.io.IOException; +@SuppressWarnings("serial") public class ParseException extends IOException { public ParseException(String message) { diff --git a/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/Parser.java b/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/Parser.java index d8845ca..2956a0f 100644 --- a/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/Parser.java +++ b/datastructures-json-flat/src/main/java/org/xbib/datastructures/json/flat/Parser.java @@ -3,7 +3,7 @@ package org.xbib.datastructures.json.flat; import java.util.ArrayList; import java.util.List; -class Parser { +public class Parser { private static final int TYPE = 0; @@ -21,7 +21,7 @@ class Parser { private int element; - Parser(String input) throws ParseException { + public Parser(String input) throws ParseException { if (input == null) { throw new ParseException("cannot parse null"); } diff --git a/datastructures-trie/src/main/java/org/xbib/datastructures/trie/limewire/PatriciaTrie.java b/datastructures-trie/src/main/java/org/xbib/datastructures/trie/limewire/PatriciaTrie.java index a52ac89..57e9eee 100644 --- a/datastructures-trie/src/main/java/org/xbib/datastructures/trie/limewire/PatriciaTrie.java +++ b/datastructures-trie/src/main/java/org/xbib/datastructures/trie/limewire/PatriciaTrie.java @@ -854,7 +854,7 @@ public class PatriciaTrie extends AbstractMap implements Trie */ private TrieEntry nextEntry(TrieEntry node) { if (node == null) { - return firstEntry(); + return trieFirstEntry(); } else { return nextEntryImpl(node.predecessor, node, null); } @@ -869,7 +869,7 @@ public class PatriciaTrie extends AbstractMap implements Trie */ private TrieEntry nextEntryInSubtree(TrieEntry node, TrieEntry parentOfSubtree) { if (node == null) { - return firstEntry(); + return trieFirstEntry(); } else { return nextEntryImpl(node.predecessor, node, parentOfSubtree); } @@ -1120,7 +1120,7 @@ public class PatriciaTrie extends AbstractMap implements Trie * This is implemented by going always to the left until * we encounter a valid uplink. That uplink is the first key. */ - private TrieEntry firstEntry() { + private TrieEntry trieFirstEntry() { // if Trie is empty, no first node. if (isEmpty()) return null; @@ -1151,7 +1151,7 @@ public class PatriciaTrie extends AbstractMap implements Trie * This is implemented by going always to the right until * we encounter a valid uplink. That uplink is the last key. */ - private TrieEntry lastEntry() { + private TrieEntry trieLastEntry() { return followRight(root.left); } @@ -1172,7 +1172,7 @@ public class PatriciaTrie extends AbstractMap implements Trie @Override public K firstKey() { - return firstEntry().getKey(); + return trieFirstEntry().getKey(); } @Override @@ -1182,7 +1182,7 @@ public class PatriciaTrie extends AbstractMap implements Trie @Override public K lastKey() { - TrieEntry entry = lastEntry(); + TrieEntry entry = trieLastEntry(); if (entry != null) return entry.getKey(); else @@ -1219,7 +1219,7 @@ public class PatriciaTrie extends AbstractMap implements Trie } } else { // Root is empty & we want something after empty, return first. - return firstEntry(); + return trieFirstEntry(); } } @@ -1238,9 +1238,9 @@ public class PatriciaTrie extends AbstractMap implements Trie return ceil; } else if (isNullBitKey(bitIndex)) { if (!root.isEmpty()) - return firstEntry(); + return trieFirstEntry(); else if (size() > 1) - return nextEntry(firstEntry()); + return nextEntry(trieFirstEntry()); else return null; } else if (isEqualBitKey(bitIndex)) { @@ -1280,7 +1280,7 @@ public class PatriciaTrie extends AbstractMap implements Trie if (!root.isEmpty()) return root; else - return firstEntry(); + return trieFirstEntry(); } TrieEntry found = getNearestEntryForKey(key, keyLength); @@ -1300,7 +1300,7 @@ public class PatriciaTrie extends AbstractMap implements Trie if (!root.isEmpty()) return root; else - return firstEntry(); + return trieFirstEntry(); } else if (isEqualBitKey(bitIndex)) { return found; } @@ -1623,7 +1623,7 @@ public class PatriciaTrie extends AbstractMap implements Trie /** * An iterator for the entries. */ - abstract class NodeIterator implements Iterator { + protected abstract class NodeIterator implements Iterator { protected int expectedModCount = modCount; // For fast-fail protected TrieEntry next; // the next node to return protected TrieEntry current; // the current entry we're on @@ -1690,7 +1690,7 @@ public class PatriciaTrie extends AbstractMap implements Trie } } - class SingletonIterator implements Iterator> { + private class SingletonIterator implements Iterator> { private final PatriciaTrie patriciaTrie; @@ -1923,7 +1923,7 @@ public class PatriciaTrie extends AbstractMap implements Trie fixup(); TrieEntry e; if (fromKey == null) { - e = firstEntry(); + e = trieFirstEntry(); } else { e = higherEntry(fromKey); } @@ -1939,7 +1939,7 @@ public class PatriciaTrie extends AbstractMap implements Trie fixup(); TrieEntry e; if (toKey == null) { - e = lastEntry(); + e = trieLastEntry(); } else { e = lowerEntry(toKey); } @@ -2122,7 +2122,7 @@ public class PatriciaTrie extends AbstractMap implements Trie public K firstKey() { TrieEntry e; if (fromKey == null) { - e = firstEntry(); + e = trieFirstEntry(); } else { if (fromInclusive) e = ceilingEntry(fromKey); @@ -2139,7 +2139,7 @@ public class PatriciaTrie extends AbstractMap implements Trie public K lastKey() { TrieEntry e; if (toKey == null) { - e = lastEntry(); + e = trieLastEntry(); } else { if (toInclusive) e = floorEntry(toKey); @@ -2267,7 +2267,7 @@ public class PatriciaTrie extends AbstractMap implements Trie @Override public Iterator> iterator() { return new SubMapEntryIterator( - (fromKey == null ? firstEntry() : ceilingEntry(fromKey)), + (fromKey == null ? trieFirstEntry() : ceilingEntry(fromKey)), (toKey == null ? null : ceilingEntry(toKey))); } } diff --git a/datastructures-trie/src/main/java/org/xbib/datastructures/trie/patricia/PatriciaTrie.java b/datastructures-trie/src/main/java/org/xbib/datastructures/trie/patricia/PatriciaTrie.java index ae0d3ce..9af4f18 100644 --- a/datastructures-trie/src/main/java/org/xbib/datastructures/trie/patricia/PatriciaTrie.java +++ b/datastructures-trie/src/main/java/org/xbib/datastructures/trie/patricia/PatriciaTrie.java @@ -85,12 +85,12 @@ public class PatriciaTrie extends AbstractTrie { @Override public K firstKey() { - return firstEntry().getKey(); + return trieFirstEntry().getKey(); } @Override public K lastKey() { - TrieEntry entry = lastEntry(); + TrieEntry entry = trieLastEntry(); if (entry != null) { return entry.getKey(); } @@ -655,7 +655,7 @@ public class PatriciaTrie extends AbstractTrie { */ TrieEntry nextEntry(TrieEntry node) { if (node == null) { - return firstEntry(); + return trieFirstEntry(); } else { return nextEntryImpl(node.predecessor, node, null); } @@ -789,7 +789,7 @@ public class PatriciaTrie extends AbstractTrie { * This is implemented by going always to the left until * we encounter a valid uplink. That uplink is the first key. */ - TrieEntry firstEntry() { + TrieEntry trieFirstEntry() { // if Trie is empty, no first node. if (isEmpty()) { return null; @@ -1200,7 +1200,7 @@ public class PatriciaTrie extends AbstractTrie { } } else { // Root is empty & we want something after empty, return first. - return firstEntry(); + return trieFirstEntry(); } } TrieEntry found = getNearestEntryForKey(key); @@ -1218,9 +1218,9 @@ public class PatriciaTrie extends AbstractTrie { return ceil; } else if (bitIndex == KeyAnalyzer.NULL_BIT_KEY) { if (!root.isEmpty()) { - return firstEntry(); + return trieFirstEntry(); } else if (size() > 1) { - return nextEntry(firstEntry()); + return nextEntry(trieFirstEntry()); } else { return null; } @@ -1260,7 +1260,7 @@ public class PatriciaTrie extends AbstractTrie { if (!root.isEmpty()) { return root; } else { - return firstEntry(); + return trieFirstEntry(); } } TrieEntry found = getNearestEntryForKey(key); @@ -1280,7 +1280,7 @@ public class PatriciaTrie extends AbstractTrie { if (!root.isEmpty()) { return root; } else { - return firstEntry(); + return trieFirstEntry(); } } else if (bitIndex == KeyAnalyzer.EQUAL_BIT_KEY) { return found; @@ -1436,7 +1436,7 @@ public class PatriciaTrie extends AbstractTrie { *

This is implemented by going always to the right until * we encounter a valid uplink. That uplink is the last key. */ - private TrieEntry lastEntry() { + private TrieEntry trieLastEntry() { return followRight(root.left); } @@ -1524,7 +1524,7 @@ public class PatriciaTrie extends AbstractTrie { private TrieEntry nextEntryInSubtree(TrieEntry node, TrieEntry parentOfSubtree) { if (node == null) { - return firstEntry(); + return trieFirstEntry(); } else { return nextEntryImpl(node.predecessor, node, parentOfSubtree); } @@ -1763,7 +1763,7 @@ public class PatriciaTrie extends AbstractTrie { public K firstKey() { Map.Entry e; if (fromKey == null) { - e = firstEntry(); + e = trieFirstEntry(); } else { if (fromInclusive) { e = ceilingEntry(fromKey); @@ -1783,7 +1783,7 @@ public class PatriciaTrie extends AbstractTrie { public K lastKey() { Map.Entry e; if (toKey == null) { - e = lastEntry(); + e = trieLastEntry(); } else { if (toInclusive) { e = floorEntry(toKey); @@ -1859,7 +1859,7 @@ public class PatriciaTrie extends AbstractTrie { TrieEntry first = null; if (fromKey == null) { - first = firstEntry(); + first = trieFirstEntry(); } else { first = ceilingEntry(fromKey); } @@ -2025,7 +2025,7 @@ public class PatriciaTrie extends AbstractTrie { fixup(); Map.Entry e; if (fromKey == null) { - e = firstEntry(); + e = trieFirstEntry(); } else { e = higherEntry(fromKey); } @@ -2041,7 +2041,7 @@ public class PatriciaTrie extends AbstractTrie { fixup(); Map.Entry e; if (toKey == null) { - e = lastEntry(); + e = trieLastEntry(); } else { e = lowerEntry(toKey); } diff --git a/datastructures-xslx/src/main/java/com/incesoft/tools/excel/xlsx/Sheet.java b/datastructures-xslx/src/main/java/com/incesoft/tools/excel/xlsx/Sheet.java index 9aef14d..1b6276d 100644 --- a/datastructures-xslx/src/main/java/com/incesoft/tools/excel/xlsx/Sheet.java +++ b/datastructures-xslx/src/main/java/com/incesoft/tools/excel/xlsx/Sheet.java @@ -57,10 +57,7 @@ public class Sheet { * with {@link #setAddToMemory(boolean)}=true,you should be careful with * the 'modifyXXX' methods,because it won't put any rows into memory -- sth * like 'readonly' mode.Besides,the stream-modify api will come in soon. - * - * @return null if there is no more rows */ - public static class IteratorStatus { int rowIndex = -1; diff --git a/datastructures-xslx/src/main/java/jxl/CellReferenceHelper.java b/datastructures-xslx/src/main/java/jxl/CellReferenceHelper.java index 32a2d47..8926b7d 100755 --- a/datastructures-xslx/src/main/java/jxl/CellReferenceHelper.java +++ b/datastructures-xslx/src/main/java/jxl/CellReferenceHelper.java @@ -235,7 +235,7 @@ public final class CellReferenceHelper { /** * Gets the cell reference for the cell * - * @param the cell + * @param c the cell */ public static String getCellReference(Cell c) { return getCellReference(c.getColumn(), c.getRow()); diff --git a/datastructures-xslx/src/main/java/jxl/SheetSettings.java b/datastructures-xslx/src/main/java/jxl/SheetSettings.java index 3eb20b2..0361b85 100755 --- a/datastructures-xslx/src/main/java/jxl/SheetSettings.java +++ b/datastructures-xslx/src/main/java/jxl/SheetSettings.java @@ -1174,8 +1174,8 @@ public final class SheetSettings { /** * Sets the print column titles for this sheet * - * @param firstRow the first row of the print titles - * @param lastRow the last row of the print titles + * @param firstCol the first row of the print titles + * @param lastCol the last row of the print titles */ public void setPrintTitlesCol(int firstCol, int lastCol) { diff --git a/datastructures-xslx/src/main/java/jxl/Workbook.java b/datastructures-xslx/src/main/java/jxl/Workbook.java index 97315a2..35e74eb 100755 --- a/datastructures-xslx/src/main/java/jxl/Workbook.java +++ b/datastructures-xslx/src/main/java/jxl/Workbook.java @@ -292,7 +292,7 @@ public abstract class Workbook { * * @param index the zero based index of the reQuired sheet * @return The sheet specified by the index - * @throws IndexOutOfBoundException when index refers to a non-existent + * @throws IndexOutOfBoundsException when index refers to a non-existent * sheet */ public abstract Sheet getSheet(int index) diff --git a/datastructures-xslx/src/main/java/jxl/WorkbookSettings.java b/datastructures-xslx/src/main/java/jxl/WorkbookSettings.java index 510aa2c..17f9a0e 100755 --- a/datastructures-xslx/src/main/java/jxl/WorkbookSettings.java +++ b/datastructures-xslx/src/main/java/jxl/WorkbookSettings.java @@ -655,9 +655,6 @@ public final class WorkbookSettings { * memory. Setting * this flag involves an assessment of the trade-offs between memory usage * and performance - * - * @return TRUE if a temporary is file is used during writing, - * FALSE otherwise */ public void setUseTemporaryFileDuringWrite(boolean temp) { useTemporaryFileDuringWrite = temp; diff --git a/datastructures-xslx/src/main/java/jxl/biff/BaseCellFeatures.java b/datastructures-xslx/src/main/java/jxl/biff/BaseCellFeatures.java index 8023531..3adbb0b 100755 --- a/datastructures-xslx/src/main/java/jxl/biff/BaseCellFeatures.java +++ b/datastructures-xslx/src/main/java/jxl/biff/BaseCellFeatures.java @@ -104,7 +104,7 @@ public class BaseCellFeatures { /** * Copy constructor * - * @param the cell to copy + * @param cf the cell to copy */ public BaseCellFeatures(BaseCellFeatures cf) { // The comment stuff @@ -308,8 +308,6 @@ public class BaseCellFeatures { /** * The list of items to validate for this cell in the form of a cell range. - * - * @param c the list of valid values */ public void setDataValidationRange(int col1, int r1, int col2, int r2) { if (dataValidation && getDVParser().extendedCellsValidation()) { @@ -430,7 +428,7 @@ public class BaseCellFeatures { /** * Use the same data validation logic as the specified cell features * - * @param cf the data validation to reuse + * @param source the data validation to reuse */ public void shareDataValidation(BaseCellFeatures source) { if (dataValidation) { diff --git a/datastructures-xslx/src/main/java/jxl/biff/DataValiditySettingsRecord.java b/datastructures-xslx/src/main/java/jxl/biff/DataValiditySettingsRecord.java index 9eeae31..b64ac68 100755 --- a/datastructures-xslx/src/main/java/jxl/biff/DataValiditySettingsRecord.java +++ b/datastructures-xslx/src/main/java/jxl/biff/DataValiditySettingsRecord.java @@ -116,7 +116,7 @@ public class DataValiditySettingsRecord extends WritableRecordData { /** * Constructor called when the API creates a writable data validation * - * @param dvsr the record copied from a writable sheet + * @param dvp the record copied from a writable sheet */ public DataValiditySettingsRecord(DVParser dvp) { super(Type.DV); diff --git a/datastructures-xslx/src/main/java/jxl/biff/HeaderFooter.java b/datastructures-xslx/src/main/java/jxl/biff/HeaderFooter.java index 766dd2a..39b527d 100755 --- a/datastructures-xslx/src/main/java/jxl/biff/HeaderFooter.java +++ b/datastructures-xslx/src/main/java/jxl/biff/HeaderFooter.java @@ -133,11 +133,6 @@ public abstract class HeaderFooter { centre = createContents(); } - /** - * Copy constructor - * - * @param c the item to copy - */ protected HeaderFooter(HeaderFooter hf) { left = createContents(hf.left); right = createContents(hf.right); diff --git a/datastructures-xslx/src/main/java/jxl/biff/RangeImpl.java b/datastructures-xslx/src/main/java/jxl/biff/RangeImpl.java index ba85eaa..8321cf8 100755 --- a/datastructures-xslx/src/main/java/jxl/biff/RangeImpl.java +++ b/datastructures-xslx/src/main/java/jxl/biff/RangeImpl.java @@ -76,7 +76,6 @@ public class RangeImpl implements Range { * Constructor * * @param w the workbook - * @param es the external sheet * @param s1 the sheet of the top left cell of the range * @param c1 the column number of the top left cell of the range * @param r1 the row number of the top left cell of the range diff --git a/datastructures-xslx/src/main/java/jxl/biff/formula/FormulaParser.java b/datastructures-xslx/src/main/java/jxl/biff/formula/FormulaParser.java index 59749ae..9b92d5b 100755 --- a/datastructures-xslx/src/main/java/jxl/biff/formula/FormulaParser.java +++ b/datastructures-xslx/src/main/java/jxl/biff/formula/FormulaParser.java @@ -49,7 +49,6 @@ public class FormulaParser { * @param es a handle to the external sheet * @param nt a handle to the name table * @param ws the workbook settings - * @param pc the parse context * @throws FormulaException */ public FormulaParser(byte[] tokens, diff --git a/datastructures-xslx/src/main/java/jxl/format/Alignment.java b/datastructures-xslx/src/main/java/jxl/format/Alignment.java index 6c5cb5b..1bcd809 100755 --- a/datastructures-xslx/src/main/java/jxl/format/Alignment.java +++ b/datastructures-xslx/src/main/java/jxl/format/Alignment.java @@ -65,7 +65,7 @@ public /*final*/ class Alignment { * Private constructor * * @param val - * @param string + * @param s */ protected Alignment(int val, String s) { value = val; diff --git a/datastructures-xslx/src/main/java/jxl/read/biff/CompoundFile.java b/datastructures-xslx/src/main/java/jxl/read/biff/CompoundFile.java index da46167..0a8beeb 100755 --- a/datastructures-xslx/src/main/java/jxl/read/biff/CompoundFile.java +++ b/datastructures-xslx/src/main/java/jxl/read/biff/CompoundFile.java @@ -540,7 +540,7 @@ public final class CompoundFile extends BaseCompoundFile { * Gets the property set. Invoked when copying worksheets with macros. * Simply calls the private counterpart * - * @param ps the property set name + * @param index the index * @return the property set with the given name */ public PropertyStorage getPropertySet(int index) { diff --git a/datastructures-xslx/src/main/java/jxl/read/biff/SharedErrorFormulaRecord.java b/datastructures-xslx/src/main/java/jxl/read/biff/SharedErrorFormulaRecord.java index 4429656..87bbbb5 100755 --- a/datastructures-xslx/src/main/java/jxl/read/biff/SharedErrorFormulaRecord.java +++ b/datastructures-xslx/src/main/java/jxl/read/biff/SharedErrorFormulaRecord.java @@ -64,7 +64,7 @@ public class SharedErrorFormulaRecord extends BaseSharedFormulaRecord * * @param t the data * @param excelFile the excel biff data - * @param v the errorCode + * @param ec the errorCode * @param fr the formatting records * @param es the external sheet * @param nt the name table diff --git a/datastructures-xslx/src/main/java/jxl/write/WritableFont.java b/datastructures-xslx/src/main/java/jxl/write/WritableFont.java index 692559c..ff1c38d 100755 --- a/datastructures-xslx/src/main/java/jxl/write/WritableFont.java +++ b/datastructures-xslx/src/main/java/jxl/write/WritableFont.java @@ -285,7 +285,6 @@ public class WritableFont extends WritableFontRecord { * Sets Accessor for the strike-out flag * * @param struckout TRUE if this is a struckout font - * @return the strike-out flag * @throws WriteException, if this font is already in use elsewhere */ public void setStruckout(boolean struckout) throws WriteException { diff --git a/datastructures-xslx/src/main/java/jxl/write/biff/BlankRecord.java b/datastructures-xslx/src/main/java/jxl/write/biff/BlankRecord.java index 8cdab87..8b4f5d1 100755 --- a/datastructures-xslx/src/main/java/jxl/write/biff/BlankRecord.java +++ b/datastructures-xslx/src/main/java/jxl/write/biff/BlankRecord.java @@ -38,7 +38,6 @@ public abstract class BlankRecord extends CellValue { * Consructor used when creating a label from the user API * * @param c the column - * @param cont the contents * @param r the row */ protected BlankRecord(int c, int r) { @@ -72,7 +71,7 @@ public abstract class BlankRecord extends CellValue { * * @param c the column * @param r the row - * @param b the record to copy + * @param br the record to copy */ protected BlankRecord(int c, int r, BlankRecord br) { super(Type.BLANK, c, r, br); diff --git a/datastructures-xslx/src/main/java/jxl/write/biff/CellXFRecord.java b/datastructures-xslx/src/main/java/jxl/write/biff/CellXFRecord.java index 07bd727..d49aa3d 100755 --- a/datastructures-xslx/src/main/java/jxl/write/biff/CellXFRecord.java +++ b/datastructures-xslx/src/main/java/jxl/write/biff/CellXFRecord.java @@ -122,7 +122,7 @@ public class CellXFRecord extends XFRecord { /** * Sets the shrink to fit flag * - * @param b the shrink to fit flag + * @param s the shrink to fit flag */ public void setShrinkToFit(boolean s) throws WriteException { if (isInitialized()) { diff --git a/datastructures-xslx/src/main/java/jxl/write/biff/HyperlinkRecord.java b/datastructures-xslx/src/main/java/jxl/write/biff/HyperlinkRecord.java index 9c99607..2efc2cf 100755 --- a/datastructures-xslx/src/main/java/jxl/write/biff/HyperlinkRecord.java +++ b/datastructures-xslx/src/main/java/jxl/write/biff/HyperlinkRecord.java @@ -109,7 +109,7 @@ public class HyperlinkRecord extends WritableRecordData { /** * Constructs this object from the readable spreadsheet * - * @param hl the hyperlink from the read spreadsheet + * @param h the hyperlink from the read spreadsheet */ protected HyperlinkRecord(Hyperlink h, WritableSheet s) { super(Type.HLINK); @@ -191,7 +191,7 @@ public class HyperlinkRecord extends WritableRecordData { * @param lastcol the last column which activates this hyperlink * @param lastrow the last row which activates this hyperlink * @param desc the contents of the cell which describe this hyperlink - * @param sheet the sheet containing the cells to be linked to + * @param s the sheet containing the cells to be linked to * @param destcol the column number of the first destination linked cell * @param destrow the row number of the first destination linked cell * @param lastdestcol the column number of the last destination linked cell diff --git a/datastructures-xslx/src/main/java/jxl/write/biff/LabelRecord.java b/datastructures-xslx/src/main/java/jxl/write/biff/LabelRecord.java index 4e90a7e..d9a22d1 100755 --- a/datastructures-xslx/src/main/java/jxl/write/biff/LabelRecord.java +++ b/datastructures-xslx/src/main/java/jxl/write/biff/LabelRecord.java @@ -91,7 +91,7 @@ public abstract class LabelRecord extends CellValue { * * @param c the column * @param r the row - * @param nr the record to copy + * @param lr the record to copy */ protected LabelRecord(int c, int r, LabelRecord lr) { super(Type.LABELSST, c, r, lr); diff --git a/datastructures-xslx/src/main/java/jxl/write/biff/MergedCellsRecord.java b/datastructures-xslx/src/main/java/jxl/write/biff/MergedCellsRecord.java index f06cba2..7fd9ba1 100755 --- a/datastructures-xslx/src/main/java/jxl/write/biff/MergedCellsRecord.java +++ b/datastructures-xslx/src/main/java/jxl/write/biff/MergedCellsRecord.java @@ -39,7 +39,7 @@ public class MergedCellsRecord extends WritableRecordData { /** * Constructs a merged cell record * - * @param ws the sheet containing the merged cells + * @param mc the sheet containing the merged cells */ protected MergedCellsRecord(ArrayList mc) { super(Type.MERGEDCELLS); diff --git a/datastructures-xslx/src/main/java/jxl/write/biff/StyleXFRecord.java b/datastructures-xslx/src/main/java/jxl/write/biff/StyleXFRecord.java index ee76c46..8f5370f 100755 --- a/datastructures-xslx/src/main/java/jxl/write/biff/StyleXFRecord.java +++ b/datastructures-xslx/src/main/java/jxl/write/biff/StyleXFRecord.java @@ -54,7 +54,6 @@ public class StyleXFRecord extends XFRecord { * Sets whether or not this XF record locks the cell * * @param l the locked flag - * @throws WriteException */ public void setLocked(boolean l) { super.setXFLocked(l); diff --git a/datastructures-xslx/src/main/java/jxl/write/biff/WritableFontRecord.java b/datastructures-xslx/src/main/java/jxl/write/biff/WritableFontRecord.java index d4d8304..b87ea45 100755 --- a/datastructures-xslx/src/main/java/jxl/write/biff/WritableFontRecord.java +++ b/datastructures-xslx/src/main/java/jxl/write/biff/WritableFontRecord.java @@ -36,7 +36,7 @@ public class WritableFontRecord extends FontRecord { * @param us the underline style * @param fn the name * @param it italicised indicator - * @param c the colour + * @param ci the colour * @param ss the script style */ protected WritableFontRecord(String fn, int ps, int bold, boolean it, @@ -47,7 +47,7 @@ public class WritableFontRecord extends FontRecord { /** * Publicly available copy constructor * - * @param the font to copy + * @param f the font to copy */ protected WritableFontRecord(Font f) { super(f); @@ -145,7 +145,7 @@ public class WritableFontRecord extends FontRecord { /** * Sets the struck out flag * - * @param so TRUE if the font is struck out, false otherwise + * @param os TRUE if the font is struck out, false otherwise * @throws WriteException, if this font is already in use elsewhere */ protected void setStruckout(boolean os) throws WriteException { diff --git a/datastructures-xslx/src/main/java/jxl/write/biff/WritableWorkbookImpl.java b/datastructures-xslx/src/main/java/jxl/write/biff/WritableWorkbookImpl.java index 63d789c..54625b7 100755 --- a/datastructures-xslx/src/main/java/jxl/write/biff/WritableWorkbookImpl.java +++ b/datastructures-xslx/src/main/java/jxl/write/biff/WritableWorkbookImpl.java @@ -1004,7 +1004,7 @@ public class WritableWorkbookImpl extends WritableWorkbook /** * Gets the index of the external sheet for the name * - * @param sheetName + * @param index the index * @return the sheet index of the external sheet index */ public int getExternalSheetIndex(int index) { @@ -1022,7 +1022,7 @@ public class WritableWorkbookImpl extends WritableWorkbook /** * Gets the index of the external sheet for the name * - * @param sheetName + * @param index the index * @return the sheet index of the external sheet index */ public int getLastExternalSheetIndex(int index) { @@ -1207,7 +1207,7 @@ public class WritableWorkbookImpl extends WritableWorkbook * Adds a cell to workbook wide range of cells which need adjustment * following a row/column insert or remove * - * @param f the cell to add to the list + * @param cv the cell to add to the list */ void addRCIRCell(CellValue cv) { rcirCells.add(cv); @@ -1339,7 +1339,7 @@ public class WritableWorkbookImpl extends WritableWorkbook * range of cells, then the cell on the top left is returned. If * the name cannot be found, null is returned * - * @param the name of the cell/range to search for + * @param name the name of the cell/range to search for * @return the cell in the top left of the range if found, NULL * otherwise */ @@ -1372,7 +1372,7 @@ public class WritableWorkbookImpl extends WritableWorkbook * If the named range contains a single cell, the top left and * bottom right cell will be the same cell * - * @param the name of the cell/range to search for + * @param name the name of the cell/range to search for * @return the range of cells */ public Range[] findByName(String name) { diff --git a/gradle.properties b/gradle.properties index dca8530..df2dc3f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group = org.xbib name = datastructures -version = 2.4.0 +version = 3.0.0 org.gradle.warning.mode = all diff --git a/gradle/compile/java.gradle b/gradle/compile/java.gradle index 109698f..3ae9754 100644 --- a/gradle/compile/java.gradle +++ b/gradle/compile/java.gradle @@ -2,28 +2,24 @@ apply plugin: 'java-library' java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } modularity.inferModulePath.set(true) withSourcesJar() withJavadocJar() } -compileJava { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} - -compileTestJava { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} - jar { manifest { attributes('Implementation-Version': project.version) + attributes('X-Java-Compiler-Version': JavaLanguageVersion.of(21).toString()) } } tasks.withType(JavaCompile) { + options.fork = true + options.forkOptions.jvmArgs += ['-Duser.language=en','-Duser.country=US'] options.compilerArgs.add('-Xlint:all') options.encoding = 'UTF-8' } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a7..7f93135 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8707e8b..e30733a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-rc-1-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cb..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/settings.gradle b/settings.gradle index f2dbc34..f95db6f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,7 +15,7 @@ pluginManagement { dependencyResolutionManagement { versionCatalogs { libs { - version('gradle', '8.1.1') + version('gradle', '8.4-rc-1') version('junit', '5.10.0') version('jackson', '2.15.2') library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit')