Navigation Menu

Skip to content

Commit

Permalink
Fix generics on Multimap.forEachKeyValue().
Browse files Browse the repository at this point in the history
  • Loading branch information
motlin committed Apr 22, 2016
1 parent 95455be commit bc9500b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 Goldman Sachs.
* Copyright (c) 2016 Goldman Sachs.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
Expand Down Expand Up @@ -101,8 +101,9 @@ public interface Multimap<K, V>
* The given procedure would be invoked with the parameters:
* <p>
* {@code [ ["key1", "val1"], ["key1", "val2"], ["key1", "val2"], ["key2", "val3"] ]}
* @param procedure
*/
void forEachKeyValue(Procedure2<K, V> procedure);
void forEachKeyValue(Procedure2<? super K, ? super V> procedure);

/**
* Calls the {@code procedure} with each <em>key-Iterable[value]</em>.
Expand Down Expand Up @@ -221,13 +222,15 @@ public interface Multimap<K, V>
* <p>
* Any two empty Multimaps are equal, because they both have empty {@link #toMap} views.
*/
@Override
boolean equals(Object obj);

/**
* Returns the hash code for this Multimap.
* <p>
* The hash code of a Multimap is defined as the hash code of the map view, as returned by {@link #toMap}.
*/
@Override
int hashCode();

/**
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 Goldman Sachs.
* Copyright (c) 2016 Goldman Sachs.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
Expand Down Expand Up @@ -207,7 +207,7 @@ public void forEachKey(Procedure<? super K> procedure)
this.getMap().forEachKey(procedure);
}

public void forEachKeyValue(final Procedure2<K, V> procedure)
public void forEachKeyValue(final Procedure2<? super K, ? super V> procedure)
{
final Procedure2<V, K> innerProcedure = new Procedure2<V, K>()
{
Expand Down

0 comments on commit bc9500b

Please sign in to comment.