Compare commits

..

3 Commits

Author SHA1 Message Date
Harald Kuhr 75d7d5cdef Using new sequence support in DDSImageWriter
+ some minor bonus clean-up
2026-03-13 11:40:06 +01:00
Harald Kuhr 177eec06cc Using new sequence support in exising writers. 2026-03-13 11:38:28 +01:00
Harald Kuhr dc3d77ad95 New class for simpler sequence write support. 2026-03-13 11:37:47 +01:00
17 changed files with 61 additions and 94 deletions
+3 -3
View File
@@ -35,7 +35,7 @@ jobs:
- name: Run Tests
run: mvn --batch-mode --no-transfer-progress test
- name: Publish Test Report
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v5
uses: mikepenz/action-junit-report@49b2ca06f62aa7ef83ae6769a2179271e160d8e4 # v5
if: ${{ !cancelled() }}
with:
report_paths: "**/target/surefire-reports/TEST*.xml"
@@ -57,7 +57,7 @@ jobs:
- name: Run Tests
run: mvn --batch-mode --no-transfer-progress test
- name: Publish Test Report
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v5
uses: mikepenz/action-junit-report@49b2ca06f62aa7ef83ae6769a2179271e160d8e4 # v5
if: ${{ !cancelled() }}
with:
report_paths: "**/target/surefire-reports/TEST*.xml"
@@ -91,7 +91,7 @@ jobs:
- name: Run Tests
run: mvn --batch-mode --no-transfer-progress test
- name: Publish Test Report
uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v5
uses: mikepenz/action-junit-report@49b2ca06f62aa7ef83ae6769a2179271e160d8e4 # v5
if: ${{ !cancelled() }}
with:
report_paths: "**/target/surefire-reports/TEST*.xml"
+3 -3
View File
@@ -37,7 +37,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -51,7 +51,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -64,6 +64,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
category: "/language:${{matrix.language}}"
+2 -2
View File
@@ -49,7 +49,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: SARIF file
path: results.sarif
@@ -57,6 +57,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
sarif_file: results.sarif
@@ -284,6 +284,20 @@ abstract class AbstractDecoratedMap<K, V> extends AbstractMap<K, V> implements M
return false;
}
/*
// NOTE: Extra cautions is taken, to only remove the entry if it
// equals the entry in the map
Object key = ((Entry) o).getKey();
Entry entry = (Entry) entries.get(key);
// Same entry?
if (entry != null && entry.equals(o)) {
return AbstractWrappedMap.this.remove(key) != null;
}
return false;
*/
//noinspection unchecked
return AbstractDecoratedMap.this.removeEntry((Entry) o) != null;
}
@@ -308,7 +322,7 @@ abstract class AbstractDecoratedMap<K, V> extends AbstractMap<K, V> implements M
return containsKey(o);
}
public boolean remove(Object o) {
return AbstractDecoratedMap.this.removeEntry(getEntry((K) o)) != null;
return AbstractDecoratedMap.this.remove(o) != null;
}
public void clear() {
AbstractDecoratedMap.this.clear();
@@ -137,43 +137,43 @@ public final class BeanMap extends AbstractMap<String, Object> implements Serial
}
private class BeanIterator implements Iterator<Entry<String, Object>> {
private final Iterator<PropertyDescriptor> iterator;
private final Iterator<PropertyDescriptor> mIterator;
public BeanIterator(final Iterator<PropertyDescriptor> pIterator) {
iterator = pIterator;
mIterator = pIterator;
}
public boolean hasNext() {
return iterator.hasNext();
return mIterator.hasNext();
}
public BeanEntry next() {
return new BeanEntry(iterator.next());
return new BeanEntry(mIterator.next());
}
public void remove() {
iterator.remove();
mIterator.remove();
}
}
private class BeanEntry implements Entry<String, Object> {
private final PropertyDescriptor descriptor;
private final PropertyDescriptor mDescriptor;
public BeanEntry(final PropertyDescriptor pDescriptor) {
this.descriptor = pDescriptor;
this.mDescriptor = pDescriptor;
}
public String getKey() {
return descriptor.getName();
return mDescriptor.getName();
}
public Object getValue() {
return unwrap(new Wrapped() {
public Object run() throws IllegalAccessException, InvocationTargetException {
final Method method = descriptor.getReadMethod();
final Method method = mDescriptor.getReadMethod();
// A write-only bean.
if (method == null) {
throw new UnsupportedOperationException("No getter: " + descriptor.getName());
throw new UnsupportedOperationException("No getter: " + mDescriptor.getName());
}
return method.invoke(bean);
@@ -184,10 +184,10 @@ public final class BeanMap extends AbstractMap<String, Object> implements Serial
public Object setValue(final Object pValue) {
return unwrap(new Wrapped() {
public Object run() throws IllegalAccessException, InvocationTargetException {
final Method method = descriptor.getWriteMethod();
final Method method = mDescriptor.getWriteMethod();
// A read-only bean.
if (method == null) {
throw new UnsupportedOperationException("No write method for property: " + descriptor.getName());
throw new UnsupportedOperationException("No write method for property: " + mDescriptor.getName());
}
final Object old = getValue();
@@ -71,6 +71,7 @@ public abstract class ObjectAbstractTest {
// TODO: What more can we test?
}
// TODO: assert that either BOTH or NONE of equals/hashcode is overridden
@Test
public void testEqualsHashCode(){
Object obj = makeObject();
@@ -327,4 +328,5 @@ public abstract class ObjectAbstractTest {
return new Cloneable() {};
}
}
}
@@ -30,8 +30,6 @@
package com.twelvemonkeys.util;
import org.junit.jupiter.api.Nested;
import java.beans.IntrospectionException;
import java.io.Serializable;
import java.util.Map;
@@ -174,16 +172,4 @@ public class BeanMapTest extends MapAbstractTest {
}
static class NullBean implements Serializable { }
@Nested
public class TestBeanMapEntrySet extends TestMapEntrySet {
}
@Nested
public class TestBeanMapKeySet extends TestMapKeySet {
}
@Nested
public class TestBeanMapValues extends TestMapValues {
}
}
@@ -436,24 +436,24 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
*/
public Object[] getFullNonNullElements() {
return new Object[] {
"",
"One",
2,
new String(""),
new String("One"),
new Integer(2),
"Three",
4,
new Integer(4),
"One",
5.0,
6F,
new Double(5),
new Float(6),
"Seven",
"Eight",
"Nine",
10,
(short) 11,
12L,
new String("Nine"),
new Integer(10),
new Short((short)11),
new Long(12),
"Thirteen",
"14",
"15",
(byte) 16
new Byte((byte)16)
};
}
@@ -1149,7 +1149,7 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
public void testUnsupportedRemove() {
if (isRemoveSupported()) return;
resetFull();
resetEmpty();
try {
collection.clear();
fail("clear should raise UnsupportedOperationException");
@@ -1159,7 +1159,7 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
verifyAll();
try {
collection.remove(getFullElements()[0]);
collection.remove(null);
fail("remove should raise UnsupportedOperationException");
} catch (UnsupportedOperationException e) {
// expected
@@ -1167,7 +1167,7 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
verifyAll();
try {
collection.removeAll(Arrays.asList(getFullElements()));
collection.removeAll(null);
fail("removeAll should raise UnsupportedOperationException");
} catch (UnsupportedOperationException e) {
// expected
@@ -1175,7 +1175,7 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
verifyAll();
try {
collection.retainAll(Collections.emptySet());
collection.retainAll(null);
fail("removeAll should raise UnsupportedOperationException");
} catch (UnsupportedOperationException e) {
// expected
@@ -1192,6 +1192,7 @@ public abstract class CollectionAbstractTest extends ObjectAbstractTest {
// expected
}
verifyAll();
}
@@ -212,17 +212,5 @@ public class LRUMapTest extends LinkedMapTest {
list.add(pEntry.getKey());
}
}
@Nested
public class TestLRUMapEntrySet extends TestMapEntrySet {
}
@Nested
public class TestLRUMapKeySet extends TestMapKeySet {
}
@Nested
public class TestLRUMapValues extends TestMapValues {
}
}
@@ -201,16 +201,4 @@ public class LinkedMapTest extends MapAbstractTest {
public void tearDown() throws Exception {
labRat = null;
}
@Nested
public class TestLinkedMapEntrySet extends TestMapEntrySet {
}
@Nested
public class TestLinkedMapKeySet extends TestMapKeySet {
}
@Nested
public class TestLinkedMapValues extends TestMapValues {
}
}
@@ -1255,7 +1255,7 @@ public abstract class MapAbstractTest extends ObjectAbstractTest {
}
*/
protected abstract class TestMapEntrySet extends SetAbstractTest {
public class TestMapEntrySet extends SetAbstractTest {
// Have to implement manually; entrySet doesn't support addAll
public Object[] getFullElements() {
@@ -1429,7 +1429,7 @@ public abstract class MapAbstractTest extends ObjectAbstractTest {
}
*/
protected abstract class TestMapKeySet extends SetAbstractTest {
public class TestMapKeySet extends SetAbstractTest {
public Object[] getFullElements() {
return getSampleKeys();
}
@@ -1495,7 +1495,7 @@ public abstract class MapAbstractTest extends ObjectAbstractTest {
}
*/
protected abstract class TestMapValues extends CollectionAbstractTest {
public class TestMapValues extends CollectionAbstractTest {
public Object[] getFullElements() {
return getSampleValues();
}
@@ -668,17 +668,5 @@ public class TimeoutMapTest extends MapAbstractTest {
assertFalse(timeoutMap.containsKey("xyz"));
assertNull(timeoutMap.get("xyz"));
}
@Nested
public class TestTimeoutMapEntrySet extends TestMapEntrySet {
}
@Nested
public class TestTimeoutMapKeySet extends TestMapKeySet {
}
@Nested
public class TestTimeoutMapValues extends TestMapValues {
}
}
+1 -1
View File
@@ -21,7 +21,7 @@
</modules>
<properties>
<junit.jupiter.version>5.14.4</junit.jupiter.version>
<junit.jupiter.version>5.14.3</junit.jupiter.version>
</properties>
<dependencyManagement>
+1 -1
View File
@@ -14,7 +14,7 @@
</description>
<properties>
<junit.jupiter.version>5.14.4</junit.jupiter.version>
<junit.jupiter.version>5.14.3</junit.jupiter.version>
</properties>
+1 -1
View File
@@ -63,7 +63,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.22.0</version>
<version>2.21.0</version>
<scope>provided</scope>
</dependency>
+1 -1
View File
@@ -61,7 +61,7 @@
</modules>
<properties>
<junit.jupiter.version>5.14.4</junit.jupiter.version>
<junit.jupiter.version>5.14.3</junit.jupiter.version>
</properties>
<dependencies>
+1 -1
View File
@@ -15,7 +15,7 @@
</description>
<properties>
<junit.jupiter.version>5.14.4</junit.jupiter.version>
<junit.jupiter.version>5.14.3</junit.jupiter.version>
</properties>
<dependencies>