You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2015/06/07 10:30:57 UTC
svn commit: r1684002 -
/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/ReadOnlyDictionary.java
Author: cziegeler
Date: Sun Jun 7 08:30:56 2015
New Revision: 1684002
URL: http://svn.apache.org/r1684002
Log:
FELIX-4632 : [RFC212] Make properties map passed to event methods comparable
Modified:
felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/ReadOnlyDictionary.java
Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/ReadOnlyDictionary.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/ReadOnlyDictionary.java?rev=1684002&r1=1684001&r2=1684002&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/ReadOnlyDictionary.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/ReadOnlyDictionary.java Sun Jun 7 08:30:56 2015
@@ -32,8 +32,8 @@ import org.osgi.framework.ServiceReferen
/**
* The <code>ReadOnlyDictionary</code> is both a <code>Dictionary</code> and
- * a <code>Map</code> whose modificaiton methods (like {@link #put(Object, Object)},
- * {@link #remove(Object)}, etc.) have no effect.
+ * a <code>Map</code> whose modification methods (like {@link #put(Object, Object)},
+ * {@link #remove(Object)}, etc.) throw an {@link UnsupportedOperationException}.
*/
public class ReadOnlyDictionary<S, T> extends Dictionary<S, T>
implements Map<S, T>, Comparable<ReadOnlyDictionary<S, T>>
@@ -122,7 +122,7 @@ public class ReadOnlyDictionary<S, T> ex
@Override
public T put( final S key, final T value )
{
- return null;
+ throw new UnsupportedOperationException();
}
@@ -133,7 +133,7 @@ public class ReadOnlyDictionary<S, T> ex
@Override
public T remove( final Object key )
{
- return null;
+ throw new UnsupportedOperationException();
}
@@ -155,7 +155,7 @@ public class ReadOnlyDictionary<S, T> ex
public void clear()
{
- // nop, this map is read only
+ throw new UnsupportedOperationException();
}
@@ -185,7 +185,7 @@ public class ReadOnlyDictionary<S, T> ex
public void putAll( Map<? extends S, ? extends T> m )
{
- // nop, this map is read only
+ throw new UnsupportedOperationException();
}
@@ -195,7 +195,7 @@ public class ReadOnlyDictionary<S, T> ex
}
- public int compareTo(ReadOnlyDictionary<S, T> o)
+ public int compareTo(final ReadOnlyDictionary<S, T> o)
{
if ( m_serviceReference == null )
{