Small fixes.

-Fixed: SynchronizedList.addElements was calling itself.
-Fixed: UnmodifiableSet was missing implementations that were causing fails.
This commit is contained in:
Speiger 2022-06-02 00:47:05 +02:00
parent 0baf141e4b
commit 9eb220194f
3 changed files with 33 additions and 14 deletions

View File

@ -18,7 +18,7 @@ repositories {
} }
archivesBaseName = 'Primitive Collections' archivesBaseName = 'Primitive Collections'
version = '0.6.2.1-SNAPSHOT'; version = '0.6.2.6-SNAPSHOT';
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaVersion.current(); sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaVersion.current();

View File

@ -356,7 +356,7 @@ public class LISTS
#endif #endif
@Override @Override
public void addElements(int from, KEY_TYPE[] a, int offset, int length) { synchronized(mutex) { addElements(from, a, offset, length); } } public void addElements(int from, KEY_TYPE[] a, int offset, int length) { synchronized(mutex) { l.addElements(from, a, offset, length); } }
@Override @Override
public KEY_TYPE[] getElements(int from, KEY_TYPE[] a, int offset, int length) { synchronized(mutex) { return l.getElements(from, a, offset, length); } } public KEY_TYPE[] getElements(int from, KEY_TYPE[] a, int offset, int length) { synchronized(mutex) { return l.getElements(from, a, offset, length); } }

View File

@ -259,25 +259,38 @@ public class SETS
#if !TYPE_OBJECT #if !TYPE_OBJECT
@Override @Override
public boolean contains(KEY_TYPE o) { return n.contains(o); } public boolean contains(KEY_TYPE o) { return n.contains(o); }
@Override
@SuppressWarnings("deprecation")
public CLASS_TYPE lower(CLASS_TYPE e) { return n.lower(e); }
@Override
@SuppressWarnings("deprecation")
public CLASS_TYPE floor(CLASS_TYPE e) { return n.floor(e); }
@Override
@SuppressWarnings("deprecation")
public CLASS_TYPE ceiling(CLASS_TYPE e) { return n.ceiling(e); }
@Override
@SuppressWarnings("deprecation")
public CLASS_TYPE higher(CLASS_TYPE e) { return n.higher(e); }
#endif #endif
@Override @Override
@Deprecated @Deprecated
public boolean contains(Object o) { return n.contains(o); } public boolean contains(Object o) { return n.contains(o); }
@Override @Override
public KEY_TYPE lower(KEY_TYPE e) { return n.lower(e); } public KEY_TYPE lower(KEY_TYPE e) { return n.lower(e); }
@Override @Override
public KEY_TYPE floor(KEY_TYPE e) { return n.floor(e); } public KEY_TYPE floor(KEY_TYPE e) { return n.floor(e); }
@Override @Override
public KEY_TYPE ceiling(KEY_TYPE e) { return n.ceiling(e); } public KEY_TYPE ceiling(KEY_TYPE e) { return n.ceiling(e); }
@Override @Override
public KEY_TYPE higher(KEY_TYPE e) { return n.higher(e); } public KEY_TYPE higher(KEY_TYPE e) { return n.higher(e); }
#if !TYPE_OBJECT #if !TYPE_OBJECT
@Override
public CLASS_TYPE pollFirst() { throw new UnsupportedOperationException(); }
@Override
public CLASS_TYPE pollLast() { throw new UnsupportedOperationException(); }
@Override @Override
public void setDefaultMaxValue(KEY_TYPE e) { throw new UnsupportedOperationException(); } public void setDefaultMaxValue(KEY_TYPE e) { throw new UnsupportedOperationException(); }
@ -292,7 +305,7 @@ public class SETS
#endif #endif
@Override @Override
public NAVIGABLE_SET KEY_GENERIC_TYPE copy() { throw new UnsupportedOperationException(); } public NAVIGABLE_SET KEY_GENERIC_TYPE copy() { return n.copy(); }
@Override @Override
public NAVIGABLE_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, boolean fromInclusive, KEY_TYPE toElement, boolean toInclusive) { return SETS.unmodifiable(n.subSet(fromElement, fromInclusive, toElement, toInclusive)); } public NAVIGABLE_SET KEY_GENERIC_TYPE subSet(KEY_TYPE fromElement, boolean fromInclusive, KEY_TYPE toElement, boolean toInclusive) { return SETS.unmodifiable(n.subSet(fromElement, fromInclusive, toElement, toInclusive)); }
@ -455,27 +468,33 @@ public class SETS
#if !TYPE_OBJECT #if !TYPE_OBJECT
@Override @Override
public boolean contains(KEY_TYPE o) { synchronized(mutex) { return n.contains(o); } } public boolean contains(KEY_TYPE o) { synchronized(mutex) { return n.contains(o); } }
@Override
@SuppressWarnings("deprecation")
public CLASS_TYPE lower(CLASS_TYPE e) { synchronized(mutex) { return n.lower(e); } }
@Override
@SuppressWarnings("deprecation")
public CLASS_TYPE floor(CLASS_TYPE e) { synchronized(mutex) { return n.floor(e); } }
@Override
@SuppressWarnings("deprecation")
public CLASS_TYPE ceiling(CLASS_TYPE e) { synchronized(mutex) { return n.ceiling(e); } }
@Override
@SuppressWarnings("deprecation")
public CLASS_TYPE higher(CLASS_TYPE e) { synchronized(mutex) { return n.higher(e); } }
#endif #endif
@Override @Override
public KEY_TYPE lower(KEY_TYPE e) { synchronized(mutex) { return n.lower(e); } } public KEY_TYPE lower(KEY_TYPE e) { synchronized(mutex) { return n.lower(e); } }
@Override @Override
public KEY_TYPE floor(KEY_TYPE e) { synchronized(mutex) { return n.floor(e); } } public KEY_TYPE floor(KEY_TYPE e) { synchronized(mutex) { return n.floor(e); } }
@Override @Override
public KEY_TYPE ceiling(KEY_TYPE e) { synchronized(mutex) { return n.ceiling(e); } } public KEY_TYPE ceiling(KEY_TYPE e) { synchronized(mutex) { return n.ceiling(e); } }
@Override @Override
public KEY_TYPE higher(KEY_TYPE e) { synchronized(mutex) { return n.higher(e); } } public KEY_TYPE higher(KEY_TYPE e) { synchronized(mutex) { return n.higher(e); } }
#if !TYPE_OBJECT #if !TYPE_OBJECT
@Override @Override
public void setDefaultMaxValue(KEY_TYPE e) { synchronized(mutex) { n.setDefaultMaxValue(e); } } public void setDefaultMaxValue(KEY_TYPE e) { synchronized(mutex) { n.setDefaultMaxValue(e); } }
@Override @Override
public KEY_TYPE getDefaultMaxValue() { synchronized(mutex) { return n.getDefaultMaxValue(); } } public KEY_TYPE getDefaultMaxValue() { synchronized(mutex) { return n.getDefaultMaxValue(); } }
@Override @Override
public void setDefaultMinValue(KEY_TYPE e) { synchronized(mutex) { n.setDefaultMinValue(e); } } public void setDefaultMinValue(KEY_TYPE e) { synchronized(mutex) { n.setDefaultMinValue(e); } }