Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-17623: Simple ordered map should implement map #3048

Merged
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c7f9cb3
SOLR-17623: implementing java.util.Map interface on SimpleOrderedMap
renatoh Jan 19, 2025
4b884fb
Merge branch 'apache:main' into SOLR-17623-SimpleOrderedMap-should-im…
renatoh Jan 20, 2025
aeca5f9
SOLR-17623: adding unit test to cover all methods
renatoh Jan 20, 2025
eb9792c
SOLR-17623: fix case for contains(null)
renatoh Jan 20, 2025
5691fae
SOLR-17623:Implementing method keySet, values, entrySet with Abstract…
renatoh Jan 22, 2025
b7d979e
SOLR-17623:adding java doc
renatoh Jan 23, 2025
dc052dd
SOLR-17623:tidy up java doc
renatoh Jan 23, 2025
4bbdac5
SOLR-17623: return itself on asShalloMap in case the instance is of S…
renatoh Jan 25, 2025
8e1601e
SOLR-17623: reimplement containns-method; refine javadoc
renatoh Jan 25, 2025
8a8d177
SOLR-17623: tidy up source code
renatoh Jan 25, 2025
86f4b0c
SOLR-17623: fixing dependency
renatoh Jan 27, 2025
2e8f902
Update solr/solrj/build.gradle
cpoerschke Jan 28, 2025
217a357
SOLR-17623: implementing performance optimization for putAll
renatoh Jan 29, 2025
d5a7172
SOLR-17623: small improvements on test
renatoh Jan 29, 2025
6516fc4
SOLR-17623: return SimpleOrderedMap for asShallowMap; making NamedLis…
renatoh Jan 29, 2025
7f53e8c
SOLR-17623: add override annotation
renatoh Jan 29, 2025
bb62299
SOLR-17623: fixing dependency
renatoh Jan 29, 2025
26f6043
Tweaks
dsmiley Jan 30, 2025
d270551
Merge branch 'main' into SOLR-17623-SimpleOrderedMap-should-implement…
renatoh Jan 30, 2025
6ac4be0
SOLR-17623: adding header to test-class
renatoh Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
SOLR-17623:tidy up java doc
renatoh committed Jan 23, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit dc052dd7b7c7a0c3b31dabfe698665025e317108
Original file line number Diff line number Diff line change
@@ -107,6 +107,7 @@ public boolean containsValue(final Object value) {

/**
* Has linear lookup time O(N)
*
* @see NamedList#get(String)
*/
@Override
@@ -115,13 +116,14 @@ public T get(final Object key) {
}

/**
* Associates the specified value with the specified key in this map
* If the map previously contained a mapping for the key, the old value is replaced by the specified value.
* Associates the specified value with the specified key in this map If the map previously
* contained a mapping for the key, the old value is replaced by the specified value.
*
* @param key key with which the specified value is to be associated value – value to be associated with the specified key
* @param value to be associated with the specified key
* @return the previous value associated with key, or null if there was no mapping for key.
* (A null return can also indicate that the map previously associated null with key)
* @param key key with which the specified value is to be associated value – value to be
* associated with the specified key
* @param value to be associated with the specified key
* @return the previous value associated with key, or null if there was no mapping for key. (A
* null return can also indicate that the map previously associated null with key)
*/
@Override
public T put(String key, T value) {
@@ -145,9 +147,8 @@ public T remove(final Object key) {
}

/**
* Copies all of the mappings from the specified map to this map.
* These mappings will replace any mappings that this map had for
* any of the keys currently in the specified map.
* Copies all of the mappings from the specified map to this map. These mappings will replace any
* mappings that this map had for any of the keys currently in the specified map.
*
* @param m mappings to be stored in this map
* @throws NullPointerException if the specified map is null
@@ -158,8 +159,9 @@ public void putAll(final Map<? extends String, ? extends T> m) {
}

/**
* return a {@link Set} of all keys in the map.
* @return {@link Set} of all keys in the map
* return a {@link Set} of all keys in the map.
*
* @return {@link Set} of all keys in the map
*/
@Override
public Set<String> keySet() {
@@ -168,6 +170,7 @@ public Set<String> keySet() {

/**
* return a {@link Collection} of all values in the map.
*
* @return {@link Collection} of all values in the map
*/
@Override
@@ -176,8 +179,9 @@ public Collection<T> values() {
}

/**
* Returns a {@link Set} view of the mappings contained in this map.
* @return {@link Set} view of mappings
* Returns a {@link Set} view of the mappings contained in this map.
*
* @return {@link Set} view of mappings
*/
@Override
public Set<Entry<String, T>> entrySet() {
@@ -212,7 +216,7 @@ public static <T> SimpleOrderedMap<T> of(String name, T val) {
public static SimpleOrderedMap<Object> of() {
return EMPTY;
}

private class InnerMap extends AbstractMap<String, T> {
@Override
public Set<Entry<String, T>> entrySet() {
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ public void testPutReturnOldValue() {

assertEquals(oldValue, oldValue);
}

public void testPutReturnNullForNullValue() {
Integer oldValue = map.put("one", null);