Index: trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java	(revision 7864)
@@ -15,4 +15,5 @@
 import org.openstreetmap.josm.gui.Notification;
 import org.openstreetmap.josm.gui.dialogs.NotesDialog;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -34,7 +35,5 @@
             tr("Add note mode"),
             mapFrame, ImageProvider.getCursor("crosshair", "create_note"));
-        if (data == null) {
-            throw new IllegalArgumentException("Note data must not be null");
-        }
+        CheckParameterUtil.ensureParameterNotNull(data, "data");
         noteData = data;
     }
Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java	(revision 7864)
@@ -47,12 +47,19 @@
             if (type.getAPIName().equals(typeName)) return type;
         }
-        throw new IllegalArgumentException(MessageFormat.format("Parameter ''{0}'' is not a valid type name. Got ''{1}''.", "typeName", typeName));
+        throw new IllegalArgumentException(MessageFormat.format(
+                "Parameter ''{0}'' is not a valid type name. Got ''{1}''.", "typeName", typeName));
     }
 
+    /**
+     * Determines the OSM primitive type of the given object.
+     * @param obj the S object to inspect
+     * @return the OSM primitive type of {@code obj}
+     * @throws IllegalArgumentException if {@code obj} is null or of unknown type
+     */
     public static OsmPrimitiveType from(IPrimitive obj) {
         if (obj instanceof INode) return NODE;
         if (obj instanceof IWay) return WAY;
         if (obj instanceof IRelation) return RELATION;
-        throw new IllegalArgumentException();
+        throw new IllegalArgumentException("Unknown type: "+obj);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/RelationMember.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/RelationMember.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/data/osm/RelationMember.java	(revision 7864)
@@ -3,4 +3,6 @@
 
 import java.util.Arrays;
+
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 
 /**
@@ -128,10 +130,9 @@
      * @throws IllegalArgumentException thrown if member is <code>null</code>
      */
-    public RelationMember(String role, OsmPrimitive member) throws IllegalArgumentException{
+    public RelationMember(String role, OsmPrimitive member) {
+        CheckParameterUtil.ensureParameterNotNull(member, "member");
         if (role == null) {
             role = "";
         }
-        if (member == null)
-            throw new IllegalArgumentException("Relation member cannot be null");
         this.role = role;
         this.member = member;
Index: trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 7864)
@@ -527,5 +527,5 @@
     public ExtendedDialog toggleEnable(String togglePref) {
         if (!modal) {
-            throw new IllegalArgumentException();
+            throw new IllegalStateException();
         }
         this.toggleable = true;
Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 7864)
@@ -266,5 +266,5 @@
                 values.add(g.getOptarg());
             } else
-                throw new IllegalArgumentException();
+                throw new IllegalArgumentException("Invalid option: "+c);
         }
         // positional arguments are a shortcut for the --download ... option
Index: trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java	(revision 7864)
@@ -372,5 +372,5 @@
     private void copy(ListRole sourceRole, int[] rows, int position) {
         if (position < 0 || position > getMergedEntriesSize())
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("Position must be between 0 and "+getMergedEntriesSize()+" but is "+position);
         List<T> newItems = new ArrayList<>(rows.length);
         List<T> source = entries.get(sourceRole);
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java	(revision 7864)
@@ -10,9 +10,10 @@
 import javax.swing.JSplitPane;
 
-import org.openstreetmap.josm.gui.widgets.MultiSplitPane;
 import org.openstreetmap.josm.gui.widgets.MultiSplitLayout.Divider;
 import org.openstreetmap.josm.gui.widgets.MultiSplitLayout.Leaf;
 import org.openstreetmap.josm.gui.widgets.MultiSplitLayout.Node;
 import org.openstreetmap.josm.gui.widgets.MultiSplitLayout.Split;
+import org.openstreetmap.josm.gui.widgets.MultiSplitPane;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Destroyable;
 
@@ -161,6 +162,5 @@
             }
         } else {
-            if (triggeredBy == null)
-                throw new IllegalArgumentException();
+            CheckParameterUtil.ensureParameterNotNull(triggeredBy, "triggeredBy");
 
             int sumP = 0;   // sum of preferred heights of dialogs in default view (without the triggering dialog)
Index: trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 7864)
@@ -81,4 +81,5 @@
 import org.openstreetmap.josm.io.OsmTransferException;
 import org.openstreetmap.josm.io.UTFInputStreamReader;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.InputSource;
@@ -111,5 +112,5 @@
     public static final IntegerProperty PROP_TMS_JOBS = new IntegerProperty("tmsloader.maxjobs", 25);
     public static final StringProperty PROP_TILECACHE_DIR;
-    
+
     private static final boolean newcache = Main.pref.getBoolean("tms.newcache");
 
@@ -401,20 +402,23 @@
     }
 
-    public static void checkUrl(String url) throws IllegalArgumentException {
-        if (url == null) {
-            throw new IllegalArgumentException();
-        } else {
-            Matcher m = Pattern.compile("\\{[^}]*\\}").matcher(url);
-            while (m.find()) {
-                boolean isSupportedPattern = false;
-                for (String pattern : TemplatedTMSTileSource.ALL_PATTERNS) {
-                    if (m.group().matches(pattern)) {
-                        isSupportedPattern = true;
-                        break;
-                    }
-                }
-                if (!isSupportedPattern) {
-                    throw new IllegalArgumentException(tr("{0} is not a valid TMS argument. Please check this server URL:\n{1}", m.group(), url));
-                }
+    /**
+     * Checks validity of given URL.
+     * @param url URL to check
+     * @throws IllegalArgumentException if url is null or invalid
+     */
+    public static void checkUrl(String url) {
+        CheckParameterUtil.ensureParameterNotNull(url, "url");
+        Matcher m = Pattern.compile("\\{[^}]*\\}").matcher(url);
+        while (m.find()) {
+            boolean isSupportedPattern = false;
+            for (String pattern : TemplatedTMSTileSource.ALL_PATTERNS) {
+                if (m.group().matches(pattern)) {
+                    isSupportedPattern = true;
+                    break;
+                }
+            }
+            if (!isSupportedPattern) {
+                throw new IllegalArgumentException(
+                        tr("{0} is not a valid TMS argument. Please check this server URL:\n{1}", m.group(), url));
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java	(revision 7864)
@@ -42,5 +42,5 @@
     public <T> T get(String key, T def, Class<T> klass, boolean suppressWarnings) {
         if (def != null && !klass.isInstance(def))
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException(def+" is not an instance of "+klass);
         Object o = prop.get(key);
         if (o == null)
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 7864)
@@ -45,7 +45,7 @@
         public Symbol(SymbolShape symbol, int size, Stroke stroke, Color strokeColor, Color fillColor) {
             if (stroke != null && strokeColor == null)
-                throw new IllegalArgumentException();
+                throw new IllegalArgumentException("Stroke given without color");
             if (stroke == null && fillColor == null)
-                throw new IllegalArgumentException();
+                throw new IllegalArgumentException("Either a stroke or a fill color must be given");
             this.symbol = symbol;
             this.size = size;
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/Range.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/Range.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/Range.java	(revision 7864)
@@ -13,7 +13,13 @@
     public static final Range ZERO_TO_INFINITY = new Range(0.0, Double.POSITIVE_INFINITY);
 
+    /**
+     * Constructs a new {@code Range}.
+     * @param lower Lower bound. Must be positive or zero
+     * @param upper Upper bound
+     * @throws IllegalArgumentException if the range is invalid ({@code lower < 0 || lower >= upper})
+     */
     public Range(double lower, double upper) {
         if (lower < 0 || lower >= upper)
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("Invalid range: "+lower+"-"+upper);
         this.lower = lower;
         this.upper = upper;
@@ -29,5 +35,5 @@
     public static Range cut(Range a, Range b) {
         if (b.lower >= a.upper || b.upper <= a.lower)
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("Ranges do not overlap: "+a+" - "+b);
         return new Range(Math.max(a.lower, b.lower), Math.min(a.upper, b.upper));
     }
@@ -49,7 +55,7 @@
     public Range reduceAround(double x, Range other) {
         if (!contains(x))
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException(x+" is not inside "+this);
         if (other.contains(x))
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException(x+" is inside "+other);
 
         if (x < other.lower && other.lower < upper)
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java	(revision 7864)
@@ -105,5 +105,5 @@
     public StyleList get(double scale) {
         if (scale <= 0)
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("scale must be <= 0 but is "+scale);
         for (int i=0; i<data.size(); ++i) {
             if (bd.get(i) < scale && scale <= bd.get(i+1)) {
@@ -120,5 +120,5 @@
     public Pair<StyleList, Range> getWithRange(double scale) {
         if (scale <= 0)
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("scale must be <= 0 but is "+scale);
         for (int i=0; i<data.size(); ++i) {
             if (bd.get(i) < scale && scale <= bd.get(i+1)) {
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 7864)
@@ -592,5 +592,5 @@
         public static double level2scale(int lvl) {
             if (lvl < 0)
-                throw new IllegalArgumentException();
+                throw new IllegalArgumentException("lvl must be >= 0 but is "+lvl);
             // preliminary formula - map such that mapnik imagery tiles of the same
             // or similar level are displayed at the given scale
@@ -600,5 +600,5 @@
         public static int scale2level(double scale) {
             if (scale < 0)
-                throw new IllegalArgumentException();
+                throw new IllegalArgumentException("scale must be >= 0 but is "+scale);
             return (int) Math.floor(Math.log(2 * Math.PI * R / 2.56 / scale) / Math.log(2));
         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/AbstractProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/AbstractProjectionChoice.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/AbstractProjectionChoice.java	(revision 7864)
@@ -35,5 +35,5 @@
     public AbstractProjectionChoice(String name, String id) {
         this(name, id, null);
-        if (!id.startsWith("core:")) throw new IllegalArgumentException();
+        if (!id.startsWith("core:")) throw new IllegalArgumentException(id+" does not start with core:");
         this.cacheDir = id.substring(5);
     }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 7864)
@@ -215,5 +215,5 @@
     public Collection<String> getPreferences(JPanel panel) {
         if (!(panel instanceof CodeSelectionPanel)) {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("Unsupported panel: "+panel);
         }
         CodeSelectionPanel csPanel = (CodeSelectionPanel) panel;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 7864)
@@ -232,5 +232,5 @@
     public Collection<String> getPreferences(JPanel panel) {
         if (!(panel instanceof PreferencePanel)) {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("Unsupported panel: "+panel);
         }
         PreferencePanel prefPanel = (PreferencePanel) panel;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 7864)
@@ -106,5 +106,5 @@
     public Collection<String> getPreferences(JPanel panel) {
         if (!(panel instanceof CBPanel)) {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("Unsupported panel: "+panel);
         }
         CBPanel p = (CBPanel) panel;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java	(revision 7864)
@@ -106,5 +106,5 @@
     public Collection<String> getPreferences(JPanel panel) {
         if (!(panel instanceof UTMPanel)) {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("Unsupported panel: "+panel);
         }
         UTMPanel p = (UTMPanel) panel;
Index: trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 7864)
@@ -176,6 +176,5 @@
      */
     public void add(TagModel tag) {
-        if (tag == null)
-            throw new IllegalArgumentException("argument 'tag' must not be null");
+        CheckParameterUtil.ensureParameterNotNull(tag, "tag");
         tags.add(tag);
         setDirty(true);
@@ -184,6 +183,5 @@
 
     public void prepend(TagModel tag) {
-        if (tag == null)
-            throw new IllegalArgumentException("argument 'tag' must not be null");
+        CheckParameterUtil.ensureParameterNotNull(tag, "tag");
         tags.add(0, tag);
         setDirty(true);
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java	(revision 7864)
@@ -223,5 +223,5 @@
             cbEditor.setItem(((AutoCompletionListItem)item).getValue());
         } else
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("Unsupported item: "+item);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java	(revision 7864)
@@ -11,4 +11,6 @@
 import javax.swing.JTable;
 import javax.swing.table.AbstractTableModel;
+
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 
 /**
@@ -58,6 +60,5 @@
      */
     public void applyFilter(String filter) {
-        if (filter == null)
-            throw new IllegalArgumentException("argument 'filter' must not be null");
+        CheckParameterUtil.ensureParameterNotNull(filter, "filter");
         this.filter = filter;
         filter();
@@ -102,6 +103,5 @@
      */
     public void add(AutoCompletionList other) {
-        if (other == null)
-            throw new IllegalArgumentException("argument 'other' must not be null");
+        CheckParameterUtil.ensureParameterNotNull(other, "other");
         for (AutoCompletionListItem item : other.list) {
             appendOrUpdatePriority(item);
@@ -119,6 +119,5 @@
      */
     public void add(List<AutoCompletionListItem> other) {
-        if (other == null)
-            throw new IllegalArgumentException("argument 'other' must not be null");
+        CheckParameterUtil.ensureParameterNotNull(other, "other");
         for (AutoCompletionListItem toadd : other) {
             appendOrUpdatePriority(toadd);
@@ -148,5 +147,5 @@
         filter();
     }
-    
+
     public void addUserInput(Collection<String> values) {
         if (values == null) return;
Index: trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java	(revision 7864)
@@ -43,4 +43,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -828,6 +829,5 @@
      */
     public List<Divider> dividersThatOverlap(Rectangle r) {
-        if (r == null)
-            throw new IllegalArgumentException("null Rectangle");
+        CheckParameterUtil.ensureParameterNotNull(r, "r");
         return dividersThatOverlap(getModel(), r);
     }
@@ -886,6 +886,5 @@
          */
         public void setBounds(Rectangle bounds) {
-            if (bounds == null)
-                throw new IllegalArgumentException("null bounds");
+            CheckParameterUtil.ensureParameterNotNull(bounds, "bounds");
             this.bounds = new Rectangle(bounds);
         }
@@ -1077,6 +1076,5 @@
          */
         public Leaf(String name) {
-            if (name == null)
-                throw new IllegalArgumentException("name is null");
+            CheckParameterUtil.ensureParameterNotNull(name, "name");
             this.name = name;
         }
@@ -1097,6 +1095,5 @@
          */
         public void setName(String name) {
-            if (name == null)
-                throw new IllegalArgumentException("name is null");
+            CheckParameterUtil.ensureParameterNotNull(name, "name");
             this.name = name;
         }
Index: trunk/src/org/openstreetmap/josm/tools/ExifReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ExifReader.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/tools/ExifReader.java	(revision 7864)
@@ -175,5 +175,5 @@
 
             if (Double.isNaN(deg) && Double.isNaN(min) && Double.isNaN(sec))
-                throw new IllegalArgumentException();
+                throw new IllegalArgumentException("deg, min and sec are NaN");
 
             value = (Double.isNaN(deg) ? 0 : deg + (Double.isNaN(min) ? 0 : (min / 60)) + (Double.isNaN(sec) ? 0 : (sec / 3600)));
Index: trunk/src/org/openstreetmap/josm/tools/Geometry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 7864)
@@ -329,5 +329,5 @@
         CheckParameterUtil.ensureValidCoordinates(p4, "p4");
 
-        if (!p1.isValid()) throw new IllegalArgumentException();
+        if (!p1.isValid()) throw new IllegalArgumentException(p1+" is invalid");
 
         // Basically, the formula from wikipedia is used:
Index: trunk/src/org/openstreetmap/josm/tools/ImageResource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageResource.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/tools/ImageResource.java	(revision 7864)
@@ -81,5 +81,5 @@
     public ImageIcon getImageIcon(Dimension dim) {
         if (dim.width < -1 || dim.width == 0 || dim.height < -1 || dim.height == 0)
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException(dim+" is invalid");
         Image img = imgCache.get(dim);
         if (img != null) {
@@ -123,5 +123,5 @@
     public ImageIcon getImageIconBounded(Dimension maxSize) {
         if (maxSize.width < -1 || maxSize.width == 0 || maxSize.height < -1 || maxSize.height == 0)
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException(maxSize+" is invalid");
         float realWidth;
         float realHeight;
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 7863)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 7864)
@@ -189,5 +189,5 @@
     public static int mod(int a, int n) {
         if (n <= 0)
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("n must be <= 0 but is "+n);
         int res = a % n;
         if (res < 0) {
@@ -206,6 +206,5 @@
      */
     public static String join(String sep, Collection<?> values) {
-        if (sep == null)
-            throw new IllegalArgumentException();
+        CheckParameterUtil.ensureParameterNotNull(sep, "sep");
         if (values == null)
             return null;
