Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java	(revision 6294)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java	(revision 6295)
@@ -128,5 +128,5 @@
     @Override
     public Command fixError(TestError testError) {
-        if (isFixable(testError)) {
+        if (testError instanceof PowerLineError && isFixable(testError)) {
             return new ChangePropertyCommand(
                     testError.getPrimitives().iterator().next(), 
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 6294)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 6295)
@@ -213,6 +213,9 @@
 
     @Override
-    public Collection<String> getPreferences(JPanel pnl) {
-        CodeSelectionPanel csPanel = (CodeSelectionPanel) pnl;
+    public Collection<String> getPreferences(JPanel panel) {
+        if (!(panel instanceof CodeSelectionPanel)) {
+            throw new IllegalArgumentException();
+        }
+        CodeSelectionPanel csPanel = (CodeSelectionPanel) panel;
         return Collections.singleton(csPanel.getCode());
     }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 6294)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 6295)
@@ -42,4 +42,7 @@
     private String pref;
 
+    /**
+     * Constructs a new {@code CustomProjectionChoice}.
+     */
     public CustomProjectionChoice() {
         super(tr("Custom Projection"), "core:custom");
@@ -156,4 +159,7 @@
     public static class ParameterInfoDialog extends ExtendedDialog {
 
+        /**
+         * Constructs a new {@code ParameterInfoDialog}.
+         */
         public ParameterInfoDialog() {
             super(null, tr("Parameter information"), new String[] { tr("Close") }, false);
@@ -225,4 +231,7 @@
     @Override
     public Collection<String> getPreferences(JPanel panel) {
+        if (!(panel instanceof PreferencePanel)) {
+            throw new IllegalArgumentException();
+        }
         PreferencePanel prefPanel = (PreferencePanel) panel;
         String pref = prefPanel.input.getText();
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java	(revision 6294)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java	(revision 6295)
@@ -11,4 +11,7 @@
     private static String[] zones = { "2", "3", "4", "5" };
 
+    /**
+     * Constructs a new {@code GaussKruegerProjectionChoice}.
+     */
     public GaussKruegerProjectionChoice() {
         super(tr("Gau\u00DF-Kr\u00FCger"), "core:gauss-krueger", zones, tr("GK Zone"));
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java	(revision 6294)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java	(revision 6295)
@@ -28,4 +28,7 @@
     };
 
+    /**
+     * Constructs a new {@code LambertCC9ZonesProjectionChoice}.
+     */
     public LambertCC9ZonesProjectionChoice() {
         super(tr("Lambert CC9 Zone (France)"), "core:lambertcc9", lambert9zones, tr("Lambert CC Zone"));
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 6294)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 6295)
@@ -105,4 +105,7 @@
     @Override
     public Collection<String> getPreferences(JPanel panel) {
+        if (!(panel instanceof CBPanel)) {
+            throw new IllegalArgumentException();
+        }
         CBPanel p = (CBPanel) panel;
         int index = p.prefcb.getSelectedIndex();
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/SwissGridProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/SwissGridProjectionChoice.java	(revision 6294)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/SwissGridProjectionChoice.java	(revision 6295)
@@ -15,4 +15,7 @@
 public class SwissGridProjectionChoice extends SingleProjectionChoice {
 
+    /**
+     * Constructs a new {@code SwissGridProjectionChoice}.
+     */
     public SwissGridProjectionChoice() {
         super(tr("Swiss Grid (Switzerland)"), "core:swissgrid", "EPSG:21781");
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java	(revision 6294)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java	(revision 6295)
@@ -33,4 +33,7 @@
     }
 
+    /**
+     * Constructs a new {@code UTMProjectionChoice}.
+     */
     public UTMProjectionChoice() {
         super(tr("UTM"), "core:utm", cbEntries.toArray(), tr("UTM Zone"));
@@ -96,4 +99,7 @@
     @Override
     public Collection<String> getPreferences(JPanel panel) {
+        if (!(panel instanceof UTMPanel)) {
+            throw new IllegalArgumentException();
+        }
         UTMPanel p = (UTMPanel) panel;
         int index = p.prefcb.getSelectedIndex();
@@ -133,5 +139,5 @@
         Hemisphere hemisphere = DEFAULT_HEMISPHERE;
 
-        if(args != null) {
+        if (args != null) {
             String[] array = args.toArray(new String[args.size()]);
 
@@ -155,4 +161,3 @@
         return defaultIndex;
     }
-
 }
Index: /trunk/src/org/openstreetmap/josm/tools/Diff.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Diff.java	(revision 6294)
+++ /trunk/src/org/openstreetmap/josm/tools/Diff.java	(revision 6295)
@@ -95,5 +95,5 @@
       an edit script, if desired.
      */
-    public Diff(Object[] a,Object[] b) {
+    public Diff(Object[] a, Object[] b) {
         Map<Object,Integer> h = new HashMap<Object,Integer>(a.length + b.length);
         filevec = new FileData[] { new FileData(a,h),new FileData(b,h) };
@@ -825,13 +825,13 @@
         }
 
-        FileData(int[] data) {
-            buffered_lines = data.length;
-            equivs = data;
+        FileData(int length) {
+            buffered_lines = length;
+            equivs = new int[length];
             undiscarded = new int[buffered_lines];
             realindexes = new int[buffered_lines];
         }
         
-        FileData(Object[] data,Map<Object,Integer> h) {
-            this(new int[data.length]);
+        FileData(Object[] data, Map<Object,Integer> h) {
+            this(data.length);
             // FIXME: diff 2.7 removes common prefix and common suffix
             for (int i = 0; i < data.length; ++i) {
