Index: /applications/editors/josm/plugins/OpeningHoursEditor/build.xml
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/build.xml	(revision 36182)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/build.xml	(revision 36183)
@@ -16,7 +16,7 @@
     <import file="../build-common.xml"/>
 	
-	<property name="parser.dir" location="${plugin.src.dir}/org/openstreetmap/josm/plugins/ohe/parser"/>
+    <property name="parser.dir" location="${plugin.src.dir}/org/openstreetmap/josm/plugins/ohe/parser"/>
 	
-    <target name="javacc" depends="init" unless="javacc.notRequired">
+    <target name="javacc" depends="resolve-tools" unless="javacc.notRequired">
         <ivy:cachepath file="${core.tools.ivy}" pathid="javacc.classpath" conf="javacc"/>
         <java classname="javacc" fork="true" failonerror="true">
@@ -30,19 +30,6 @@
     </target>
 
-	<!--
-    **********************************************************
-    ** compile - compiles the source tree
-    **********************************************************
-    -->
-    <target name="compile" depends="init, javacc">
-        <echo message="compiling sources for ${plugin.jar} ... "/>
-        <javac srcdir="src" debug="true" destdir="${plugin.build.dir}" includeAntRuntime="false" encoding="UTF-8">
-            <classpath>
-                <pathelement path="${plugin.build.dir}"/>
-                <pathelement location="${josm}"/>
-            </classpath>
-            <compilerarg value="-Xlint:deprecation"/>
-            <compilerarg value="-Xlint:unchecked"/>
-        </javac>
+    <target name="pre-compile" depends="javacc">
+      <!-- ensure that we build the javacc classes -->
     </target>
 
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/ClockSystem.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/ClockSystem.java	(revision 36182)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/ClockSystem.java	(revision 36183)
@@ -29,6 +29,6 @@
         try {
             midnight = localeFormat.format(stdFormat.parse("12:00 AM"));
-        } catch (ParseException ignore) {
-            Logging.trace(ignore);
+        } catch (ParseException parseException) {
+            Logging.trace(parseException);
         }
         if (midnight.contains("12"))
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java	(revision 36182)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java	(revision 36183)
@@ -7,4 +7,5 @@
 import java.awt.Component;
 import java.awt.Font;
+import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
@@ -32,4 +33,5 @@
 import javax.swing.JTable;
 import javax.swing.ListSelectionModel;
+import javax.swing.ScrollPaneConstants;
 import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.DefaultTableModel;
@@ -61,5 +63,5 @@
      * {key, value, key-to-edit} key and value can contain regular expressions
      */
-    private final String[][] TAG_EDIT_STRINGS = new String[][] {
+    private static final String[][] TAG_EDIT_STRINGS = new String[][] {
             {"opening_hours", ".*", "opening_hours"},
             {"opening_hours:kitchen", ".*", "opening_hours:kitchen"},
@@ -195,6 +197,6 @@
             // showing the tags in a dialog
             propertyTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-            JScrollPane sp = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
-                    JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+            JScrollPane sp = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
+                    ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
             sp.setViewportView(propertyTable);
 
@@ -269,9 +271,9 @@
 
             JPanel dlgPanel = new JPanel(new GridBagLayout());
-            dlgPanel.add(editButton, GBC.std().anchor(GBC.WEST));
-            dlgPanel.add(sp, GBC.eol().fill(GBC.BOTH));
-            dlgPanel.add(newButton, GBC.std().anchor(GBC.WEST));
-            dlgPanel.add(newTagField, GBC.eol().fill(GBC.HORIZONTAL));
-            dlgPanel.add(useTwelveHourClock, GBC.eol().fill(GBC.HORIZONTAL).insets(0, 5, 0, 5));
+            dlgPanel.add(editButton, GBC.std().anchor(GridBagConstraints.WEST));
+            dlgPanel.add(sp, GBC.eol().fill(GridBagConstraints.BOTH));
+            dlgPanel.add(newButton, GBC.std().anchor(GridBagConstraints.WEST));
+            dlgPanel.add(newTagField, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
+            dlgPanel.add(useTwelveHourClock, GBC.eol().fill(GridBagConstraints.HORIZONTAL).insets(0, 5, 0, 5));
 
             JOptionPane optionPane = new JOptionPane(dlgPanel, JOptionPane.QUESTION_MESSAGE,
@@ -286,5 +288,5 @@
             Object valuesToEdit = "";
             if (answer != null && answer != JOptionPane.UNINITIALIZED_VALUE
-                    && (answer instanceof Integer && (Integer) answer == JOptionPane.OK_OPTION))
+                    && (answer instanceof Integer && (Integer) answer == JOptionPane.OK_OPTION)) {
                 if (editButton.isSelected() && propertyTable.getSelectedRow() != -1) {
                     keyToEdit = (String) propertyData.getValueAt(propertyTable.getSelectedRow(), 0);
@@ -293,4 +295,5 @@
                     keyToEdit = newTagField.getSelectedItem().toString();
                 }
+            }
             if (keyToEdit == null)
                 return;
@@ -300,5 +303,5 @@
                     : ClockSystem.TWENTYFOUR_HOURS).toString());
 
-            OheDialogPanel panel = new OheDialogPanel(OhePlugin.this, keyToEdit, valuesToEdit,
+            OheDialogPanel panel = new OheDialogPanel(keyToEdit, valuesToEdit,
                     useTwelveHourClock.isSelected() ? ClockSystem.TWELVE_HOURS : ClockSystem.TWENTYFOUR_HOURS);
 
@@ -320,8 +323,8 @@
             String value = changedKeyValuePair[2].trim();
 
-            if (value.equals("")) {
+            if ("".equals(value)) {
                 value = null; // delete the key
             }
-            if (newkey.equals("")) {
+            if ("".equals(newkey)) {
                 newkey = key;
                 value = null; // delete the key instead
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java	(revision 36182)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java	(revision 36183)
@@ -3,4 +3,5 @@
 
 import java.util.ArrayList;
+import java.util.List;
 
 import org.openstreetmap.josm.plugins.ohe.gui.TimeRect;
@@ -19,5 +20,5 @@
      * Implements the subtraction of daytimes in spans of days when a day in the list occurs direct afterwards 
      */
-    public static ArrayList<int[]> convert(ArrayList<DateTime> dateTimes) {
+    public static List<int[]> convert(List<DateTime> dateTimes) {
         ArrayList<int[]> ret = new ArrayList<>(); // the list which is
         // returned
@@ -29,13 +30,13 @@
             if (dateTime.daySpans.size() == 1 && dateTime.daySpans.get(0).isSpan()) {
                 ArrayList<DaySpan> partDaySpans = new ArrayList<>();
-                int start_day = dateTime.daySpans.get(0).startDay;
+                int startDay = dateTime.daySpans.get(0).startDay;
 
                 // look in every entry behind
                 while (i + 1 < dateTimes.size()) {
-                    ArrayList<DaySpan> following = dateTimes.get(i + 1).daySpans;
+                    List<DaySpan> following = dateTimes.get(i + 1).daySpans;
                     if (following.size() == 1 && following.get(0).startDay > dateTime.daySpans.get(0).startDay
                             && following.get(0).endDay < dateTime.daySpans.get(0).endDay) {
-                        partDaySpans.add(new DaySpan(start_day, following.get(0).startDay - 1));
-                        start_day = following.get(0).endDay + 1;
+                        partDaySpans.add(new DaySpan(startDay, following.get(0).startDay - 1));
+                        startDay = following.get(0).endDay + 1;
                         newDateTimes.add(dateTimes.get(i + 1));
                         i++;
@@ -45,5 +46,5 @@
                 }
 
-                partDaySpans.add(new DaySpan(start_day, dateTime.daySpans.get(0).endDay));
+                partDaySpans.add(new DaySpan(startDay, dateTime.daySpans.get(0).endDay));
                 newDateTimes.add(new DateTime(partDaySpans, dateTime.daytimeSpans));
             }
@@ -53,11 +54,10 @@
 
             // create the int-array
-            for (int j = 0; j < newDateTimes.size(); ++j) {
-                DateTime dateTime2 = newDateTimes.get(j);
+            for (DateTime dateTime2 : newDateTimes) {
                 for (DaySpan dayspan : dateTime2.daySpans) {
                     for (DaytimeSpan timespan : dateTime2.daytimeSpans) {
                         if (!timespan.isOff()) {
-                            ret.add(new int[] {dayspan.startDay, dayspan.endDay, timespan.startMinute,
-                                    timespan.endMinute });
+                            ret.add(new int[]{dayspan.startDay, dayspan.endDay, timespan.startMinute,
+                                    timespan.endMinute});
                         }
                     }
@@ -68,8 +68,18 @@
     }
 
+    /**
+     * The span of days
+     */
     public static class DaySpan {
-        public int startDay;
-        public int endDay;
-
+        /** The start day */
+        public final int startDay;
+        /** The end day */
+        public final int endDay;
+
+        /**
+         * Create a new day span
+         * @param startDay The weekday start
+         * @param endDay The weekday end
+         */
         public DaySpan(int startDay, int endDay) {
             this.startDay = startDay;
@@ -86,8 +96,18 @@
     }
 
+    /**
+     * A span of time within a day
+     */
     public static class DaytimeSpan {
-        public int startMinute;
-        public int endMinute;
-
+        /** The start minute of the time span */
+        public final int startMinute;
+        /** The end minute of the time span */
+        public final int endMinute;
+
+        /**
+         * Create a new time span
+         * @param startMinute The start minute
+         * @param endMinute The end minute
+         */
         public DaytimeSpan(int startMinute, int endMinute) {
             this.startMinute = startMinute;
@@ -104,9 +124,19 @@
     }
 
+    /**
+     * A collection of days and time spans
+     */
     public static class DateTime {
-        public ArrayList<DaySpan> daySpans;
-        public ArrayList<DaytimeSpan> daytimeSpans;
-
-        public DateTime(ArrayList<DaySpan> daySpans, ArrayList<DaytimeSpan> daytimeSpans) {
+        /** The weekday spans */
+        public final List<DaySpan> daySpans;
+        /** The time spans */
+        public final List<DaytimeSpan> daytimeSpans;
+
+        /**
+         * Create a new collection of time spans
+         * @param daySpans The weekday spans
+         * @param daytimeSpans The times for the weekday spans
+         */
+        public DateTime(List<DaySpan> daySpans, List<DaytimeSpan> daytimeSpans) {
             this.daySpans = daySpans;
             this.daytimeSpans = daytimeSpans;
@@ -117,5 +147,5 @@
      * Returns a String (e.g "Mo-Sa 10:00-20:00; Tu off") representing the TimeRects
      */
-    public static String makeStringFromRects(ArrayList<TimeRect> givenTimeRects) {
+    public static String makeStringFromRects(List<TimeRect> givenTimeRects) {
         // create an array of booleans representing every minute on all the days in a week
         boolean[][] minuteArray = new boolean[7][24 * 60 + 2];
@@ -133,5 +163,5 @@
         }
 
-        String ret = "";
+        StringBuilder ret = new StringBuilder();
         int[] days = new int[7]; // an array representing the status of the days
         // 0 means nothing done with this day yet
@@ -179,11 +209,11 @@
 
             if (!add.isEmpty()) {
-                if (!ret.isEmpty()) {
-                    ret += "; ";
-                }
-                ret += add;
-            }
-        }
-        return ret;
+                if (ret.length() != 0) {
+                    ret.append("; ");
+                }
+                ret.append(add);
+            }
+        }
+        return ret.toString();
     }
 
@@ -192,5 +222,5 @@
      */
     private static String makeStringFromMinuteArray(boolean[] minutes) {
-        String ret = "";
+        StringBuilder ret = new StringBuilder();
         for (int i = 0; i < minutes.length; ++i) {
             if (minutes[i]) {
@@ -205,17 +235,28 @@
                     addString += "-" + timeString(i - 1);
                 }
-                if (!ret.isEmpty()) {
-                    ret += ",";
-                }
-                ret += addString;
-            }
-        }
-        return ret;
-    }
-
+                if (ret.length() != 0) {
+                    ret.append(',');
+                }
+                ret.append(addString);
+            }
+        }
+        return ret.toString();
+    }
+
+    /**
+     * Convert minutes to a string
+     * @param minutes integer in range from 0 and 24*60 inclusive
+     * @return a formatted string of the time (for example "01:45 PM" or "13:45")
+     */
     public static String timeString(int minutes) {
         return timeString(minutes, ClockSystem.TWENTYFOUR_HOURS);
     }
 
+    /**
+     * Convert minutes to a string
+     * @param minutes integer in range from 0 and 24*60 inclusive
+     * @param hourMode 12 or 24 hour clock
+     * @return a formatted string of the time (for example "01:45 PM" or "13:45")
+     */
     public static String timeString(int minutes, ClockSystem hourMode) {
         return timeString(minutes, hourMode, false);
@@ -223,5 +264,5 @@
 
     /**
-     * 
+     * Convert minutes to a string
      * @param minutes integer in range from 0 and 24*60 inclusive
      * @param hourMode 12 or 24 hour clock
@@ -250,6 +291,6 @@
 
     private static boolean isArrayEmpty(boolean[] bs) {
-        for (int i = 0; i < bs.length; i++) {
-            if (bs[i])
+        for (boolean b : bs) {
+            if (b)
                 return false;
         }
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java	(revision 36182)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java	(revision 36183)
@@ -5,8 +5,7 @@
 
 import java.awt.Dimension;
+import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
@@ -19,5 +18,4 @@
 
 import org.openstreetmap.josm.plugins.ohe.ClockSystem;
-import org.openstreetmap.josm.plugins.ohe.OhePlugin;
 import org.openstreetmap.josm.plugins.ohe.OpeningTimeUtils;
 import org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler;
@@ -28,32 +26,38 @@
 import org.openstreetmap.josm.tools.Logging;
 
+/** The dialog panel for editing opening hourse */
 public class OheDialogPanel extends JPanel {
 
+    /** The key we are modifying */
     private final JTextField keyField;
 
-    // The Component for showing the Time as a Text
+    /** The Component for showing the Time as a Text */
     private final JTextField valueField;
 
-    private final JButton twentyfourSevenButton;
-    private final JLabel actualPostionLabel;
-
-    // The important Panel for showing/editing the Time graphical
+    /** The position of the mouse pointer*/
+    private final JLabel actualPositionLabel;
+
+    /** The important Panel for showing/editing the Time graphical */
     private final OheEditor editorPanel;
 
-    private final String oldkey;
-
-    private ClockSystem clockSystem;
+    /** The original key for the initial timespan */
+    private final String oldKey;
+
+    /** The ClockSystem that the user wants us to use */
+    private final ClockSystem clockSystem;
 
     /**
      * The Panel for editing the time-values.
-     * 
+     *
+     * @param key The key to edit
      * @param valuesToEdit
      *            can be a String or a Map&lt;String, Integer&gt; which contains
      *            multiple values and their number of occurences
-     */
-    public OheDialogPanel(OhePlugin plugin, String key, Object valuesToEdit, ClockSystem clockSystem) {
+     * @param clockSystem The clocksystem to use
+     */
+    public OheDialogPanel(String key, Object valuesToEdit, ClockSystem clockSystem) {
         this.clockSystem = clockSystem;
 
-        oldkey = key;
+        oldKey = key;
         keyField = new JTextField(key);
 
@@ -69,8 +73,8 @@
                 // TODO let the user choose which value he wants to edit (e.g. with a combobox)
                 int mostOccurences = 0;
-                for (String v : valuesMap.keySet()) {
-                    if (valuesMap.get(v) > mostOccurences) {
-                        value = v;
-                        mostOccurences = valuesMap.get(v);
+                for (Map.Entry<String, Integer> entry : valuesMap.entrySet()) {
+                    if (entry.getValue() > mostOccurences) {
+                        value = entry.getKey();
+                        mostOccurences = entry.getValue();
                     }
                 }
@@ -78,28 +82,22 @@
         }
         valueField = new JTextField(value);
-        valueField.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent evt) {
-                // on every action in the textfield the timeRects are reloaded
-                editorPanel.initTimeRects();
-            }
-        });
-
-        twentyfourSevenButton = new JButton(tr("apply {0}", "24/7"));
-        twentyfourSevenButton.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent arg0) {
-                valueField.setText("24/7");
-                editorPanel.initTimeRects();
-            }
-        });
-
-        actualPostionLabel = new JLabel("-");
+
+        JButton twentyfourSevenButton = new JButton(tr("apply {0}", "24/7"));
+
+        actualPositionLabel = new JLabel("-");
         JPanel toolsPanel = new JPanel(new GridBagLayout());
         toolsPanel.add(twentyfourSevenButton, GBC.std());
-        toolsPanel.add(Box.createGlue(), GBC.std().fill(GBC.HORIZONTAL));
-        toolsPanel.add(actualPostionLabel, GBC.eop());
+        toolsPanel.add(Box.createGlue(), GBC.std().fill(GridBagConstraints.HORIZONTAL));
+        toolsPanel.add(actualPositionLabel, GBC.eop());
         
         editorPanel = new OheEditor(this);
+
+        // on every action in the textfield the timeRects are reloaded
+        valueField.addActionListener(evt -> editorPanel.initTimeRects());
+
+        twentyfourSevenButton.addActionListener(arg0 -> {
+            valueField.setText("24/7");
+            editorPanel.initTimeRects();
+        });
 
         // adding all Components in a Gridbaglayout
@@ -107,9 +105,9 @@
         add(new JLabel(tr("Key")), GBC.std());
         add(Box.createHorizontalStrut(10), GBC.std());
-        add(keyField, GBC.eol().fill(GBC.HORIZONTAL));
+        add(keyField, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
         add(new JLabel(tr("Value")), GBC.std());
         add(Box.createHorizontalStrut(10), GBC.std());
-        add(valueField, GBC.eop().fill(GBC.HORIZONTAL));
-        add(toolsPanel, GBC.eol().fill(GBC.HORIZONTAL));
+        add(valueField, GBC.eop().fill(GridBagConstraints.HORIZONTAL));
+        add(toolsPanel, GBC.eol().fill(GridBagConstraints.HORIZONTAL));
         add(editorPanel, GBC.eol().fill());
 
@@ -118,5 +116,5 @@
 
     public String[] getChangedKeyValuePair() {
-        return new String[] {oldkey, keyField.getText(), valueField.getText()};
+        return new String[] {oldKey, keyField.getText(), valueField.getText()};
     }
 
@@ -124,13 +122,14 @@
      * Returns the compiled Time from the valueField.
      * @return the compiled Time from the valueField
-     */
-    public ArrayList<int[]> getTime() throws Exception {
+     * @throws OheException if the time value could not be parsed
+     */
+    public List<int[]> getTime() throws OheException {
         String value = valueField.getText();
-        ArrayList<int[]> time = null;
+        List<int[]> time = null;
         if (value.length() > 0) {
             OpeningTimeCompiler compiler = new OpeningTimeCompiler(value);
             try {
                 time = OpeningTimeUtils.convert(compiler.startCompile());
-            } catch (Exception | TokenMgrError t) {
+            } catch (ParseException | SyntaxException | TokenMgrError t) {
                 Logging.warn(t);
                 
@@ -152,7 +151,5 @@
                             tColumns = new int[] {col - 1, col + 1};
                         }
-                    } catch (IndexOutOfBoundsException e) {
-                        Logging.warn(e);
-                    } catch (NumberFormatException e) {
+                    } catch (IndexOutOfBoundsException | NumberFormatException e) {
                         Logging.warn(e);
                     }
@@ -183,5 +180,5 @@
                 }
 
-                throw new Exception("Error in the TimeValue", t);
+                throw new OheException("Error in the TimeValue", t);
             }
         }
@@ -191,13 +188,18 @@
 
     /**
-     * Updates the valueField with the given timeRects.
-     */
-    public void updateValueField(ArrayList<TimeRect> timeRects) {
+     * Updates the valueField with the given {@link TimeRect}s.
+     * @param timeRects The time rectangles to set the value from
+     */
+    void updateValueField(List<TimeRect> timeRects) {
         if (valueField != null && timeRects != null)
             valueField.setText(OpeningTimeUtils.makeStringFromRects(timeRects));
     }
 
-    public void setMousePositionText(String positionText) {
-        actualPostionLabel.setText(positionText);
+    /**
+     * Set the position text for the mouse
+     * @param positionText The text to use
+     */
+    void setMousePositionText(String positionText) {
+        actualPositionLabel.setText(positionText);
     }
 
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java	(revision 36182)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java	(revision 36183)
@@ -12,7 +12,9 @@
 import java.awt.event.MouseMotionListener;
 import java.util.ArrayList;
+import java.util.List;
 
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
+import javax.swing.ScrollPaneConstants;
 
 import org.openstreetmap.josm.plugins.ohe.ClockSystem;
@@ -21,5 +23,9 @@
 import org.openstreetmap.josm.tools.Logging;
 
+/**
+ * The editor for opening hours
+ */
 public class OheEditor extends JPanel implements MouseListener, MouseMotionListener {
+    /** A panel for the {@link TimeRect}s */
     private final class OhePanel extends JPanel {
         @Override
@@ -64,5 +70,5 @@
                     int minute2 = Math.min(minute0, minute1);
                     int minute3 = Math.max(minute0, minute1);
-                    Rectangle bounds = getPanelBoundsForTimeinterval(day2, day3 + 1, minute2, minute3);
+                    Rectangle bounds = getPanelBoundsForTimeInterval(day2, day3 + 1, minute2, minute3);
                     TimeRect.drawTimeRect(g2D, bounds, minute2 == minute3, false);
                 }
@@ -76,12 +82,18 @@
     final OheDialogPanel dialog;
 
-    private final JScrollPane scrollPane;
     final JPanel contentPanel;
 
-    ArrayList<TimeRect> timeRects;
-
-    private final int dayAxisHeight = 20;
-    private final int timeAxisWidth = 45;
-
+    /** The time rectangles for this dialog */
+    List<TimeRect> timeRects;
+
+    /** The height for the cells */
+    private static final int DAY_AXIS_HEIGHT = 20;
+    /** The width for the cells */
+    private static final int TIME_AXIS_WIDTH = 45;
+
+    /**
+     * Create a new editor component
+     * @param oheDialogPanel The dialog with settings for this editor
+     */
     public OheEditor(OheDialogPanel oheDialogPanel) {
         dialog = oheDialogPanel;
@@ -96,6 +108,6 @@
         initTimeRects();
 
-        scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
-                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        JScrollPane scrollPane = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
+                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
         scrollPane.setViewportView(contentPanel);
 
@@ -104,5 +116,5 @@
             @Override
             public Dimension getPreferredSize() {
-                return new Dimension(contentPanel.getWidth(), dayAxisHeight);
+                return new Dimension(contentPanel.getWidth(), DAY_AXIS_HEIGHT);
             }
 
@@ -120,5 +132,5 @@
                     String text = OpeningTimeCompiler.WEEKDAYS[i];
                     g.drawString(text, (int) (getDayPosition(i + 0.5) - g.getFontMetrics().stringWidth(text) * 0.5),
-                            (int) (dayAxisHeight * 0.5 + g.getFontMetrics().getHeight() * 0.35));
+                            (int) (DAY_AXIS_HEIGHT * 0.5 + g.getFontMetrics().getHeight() * 0.35));
                 }
             }
@@ -129,5 +141,5 @@
             @Override
             public Dimension getPreferredSize() {
-                return new Dimension(timeAxisWidth, contentPanel.getHeight());
+                return new Dimension(TIME_AXIS_WIDTH, contentPanel.getHeight());
             }
 
@@ -148,5 +160,5 @@
                         if (i % 24 != 0) {
                             String text = OpeningTimeUtils.timeString(i * 60, dialog.getHourMode(), false);
-                            g.drawString(text, (timeAxisWidth - g.getFontMetrics().stringWidth(text)) / 2,
+                            g.drawString(text, (TIME_AXIS_WIDTH - g.getFontMetrics().stringWidth(text)) / 2,
                                     getMinutePosition(i * 60) + (int) (g.getFontMetrics().getHeight() * 0.35));
                         }
@@ -160,12 +172,12 @@
                 g.setColor(Color.BLACK);
                 String text = OpeningTimeUtils.timeString(0, dialog.getHourMode(), false);
-                g.drawString(text, (timeAxisWidth - g.getFontMetrics().stringWidth(text)) / 2, getMinutePosition(0)
+                g.drawString(text, (TIME_AXIS_WIDTH - g.getFontMetrics().stringWidth(text)) / 2, getMinutePosition(0)
                         + (int) (g.getFontMetrics().getHeight() * 1.0));
                 if (dialog.getHourMode() == ClockSystem.TWELVE_HOURS) {
                     text = "AM";
-                    g.drawString(text, (timeAxisWidth - g.getFontMetrics().stringWidth(text)) / 2, getMinutePosition(0)
+                    g.drawString(text, (TIME_AXIS_WIDTH - g.getFontMetrics().stringWidth(text)) / 2, getMinutePosition(0)
                             + (int) (g.getFontMetrics().getHeight() * 1.85));
                     text = "PM";
-                    g.drawString(text, (timeAxisWidth - g.getFontMetrics().stringWidth(text)) / 2,
+                    g.drawString(text, (TIME_AXIS_WIDTH - g.getFontMetrics().stringWidth(text)) / 2,
                             getMinutePosition(12 * 60) + (int) (g.getFontMetrics().getHeight() * 1.2));
                 }
@@ -183,5 +195,5 @@
         contentPanel.removeAll();
 
-        ArrayList<int[]> time;
+        List<int[]> time;
         try {
             time = dialog.getTime();
@@ -196,9 +208,9 @@
         if (time != null) {
             for (int[] timeRectValues : time) {
-                int day0 = timeRectValues[0];
-                int day1 = timeRectValues[1];
-                int minute0 = timeRectValues[2];
-                int minute1 = timeRectValues[3];
-                TimeRect timeRect = new TimeRect(OheEditor.this, day0, day1, minute0, minute1);
+                int tDay0 = timeRectValues[0];
+                int tDay1 = timeRectValues[1];
+                int tMinute0 = timeRectValues[2];
+                int tMinute1 = timeRectValues[3];
+                TimeRect timeRect = new TimeRect(OheEditor.this, tDay0, tDay1, tMinute0, tMinute1);
                 timeRects.add(timeRect);
                 contentPanel.add(timeRect);
@@ -218,6 +230,14 @@
     }
 
-    // returns the physical Borders of the TimeRect on the mainPanel
-    public Rectangle getPanelBoundsForTimeinterval(int dayStart, int dayEnd, int minutesStart, int minutesEnd) {
+    /**
+     * returns the physical Borders of the TimeRect on the mainPanel
+     *
+     * @param dayStart The starting weekday for the opening hours
+     * @param dayEnd The ending weekday for the opening hours
+     * @param minutesStart The starting time for the opening hours
+     * @param minutesEnd The ending time for the opening hours
+     * @return The borders for the time rectangle
+     */
+    public Rectangle getPanelBoundsForTimeInterval(int dayStart, int dayEnd, int minutesStart, int minutesEnd) {
         int x = getDayPosition(dayStart);
         int y = getMinutePosition(minutesStart);
@@ -226,30 +246,49 @@
 
         if (minutesStart == minutesEnd)
-            return new Rectangle(x, y - 2 - TimeRect.verticalNonDrawedPixels, width, height + 5 + 2
-                    * TimeRect.verticalNonDrawedPixels);
+            return new Rectangle(x, y - 2 - TimeRect.VERTICAL_NON_DRAWN_PIXELS, width, height + 5 + 2
+                    * TimeRect.VERTICAL_NON_DRAWN_PIXELS);
 
         return new Rectangle(x, y, width, height + 1);
     }
 
-    public double getDayWidth() {
+    /**
+     * Get the width for a time cell
+     * @return The width in pixels
+     */
+    double getDayWidth() {
         return (contentPanel.getWidth() - 1) / 7.0;
     }
 
-    public int getDayPosition(double d) {
+    /**
+     * Get the position for a day
+     * @param d The weekday
+     * @return The starting pixel position for the day
+     */
+    int getDayPosition(double d) {
         return (int) (d * getDayWidth());
     }
 
-    public double getMinuteHeight() {
+    /**
+     * Get the height for a hour
+     * @return The height of an hour in pixels
+     */
+    double getMinuteHeight() {
         return (contentPanel.getHeight() - 1) / (24.0 * 60);
     }
 
-    public int getMinutePosition(int minute) {
+    /**
+     * Get the position for a minute in pixels
+     * @param minute The minute to get the position for
+     * @return The pixel location for the minute
+     */
+    int getMinutePosition(int minute) {
         return (int) (minute * getMinuteHeight());
     }
 
     /**
-     * Removes the given timerect from the panel and from the arraylist
-     */
-    public void removeTimeRect(TimeRect timeRectToRemove) {
+     * Removes the given {@link TimeRect} from the panel and from the arraylist
+     * @param timeRectToRemove The rectangle to remove
+     */
+    void removeTimeRect(TimeRect timeRectToRemove) {
         timeRects.remove(timeRectToRemove);
         contentPanel.remove(timeRectToRemove);
@@ -259,13 +298,20 @@
 
     // drawing a new Rect
+    /** The first day of the time slot. -1 is for new rectangles. */
     private int day0 = -1;
+    /** THe first minute of the time slot */
     private int minute0;
+    /** The last day of the time slot */
     private int day1;
+    /** The last minute of the time slot */
     private int minute1;
+    /** The x location of the mouse click */
     private int xDragStart;
+    /** The y location of the mouse click */
     private int yDragStart;
 
     @Override
     public void mouseClicked(MouseEvent evt) {
+        // Do nothing
     }
 
@@ -292,6 +338,6 @@
         }
         day0 = (int) Math.floor(evt.getX() / getDayWidth());
-        minute0 = (int) Math.floor(evt.getY() / (getMinuteHeight() * TimeRect.minuteResterize))
-        * TimeRect.minuteResterize;
+        minute0 = (int) Math.floor(evt.getY() / (getMinuteHeight() * TimeRect.MINUTE_RASTERIZE))
+        * TimeRect.MINUTE_RASTERIZE;
         day1 = day0;
         minute1 = minute0;
@@ -332,6 +378,6 @@
             xDragStart = -1;
             day1 = (int) Math.floor(evt.getX() / getDayWidth());
-            minute1 = (int) Math.floor(evt.getY() / (getMinuteHeight() * TimeRect.minuteResterize))
-                    * TimeRect.minuteResterize;
+            minute1 = (int) Math.floor(evt.getY() / (getMinuteHeight() * TimeRect.MINUTE_RASTERIZE))
+                    * TimeRect.MINUTE_RASTERIZE;
 
             // ensure that the new time is in a valid range
@@ -354,9 +400,15 @@
     }
 
-    public void mousePositionChanged(int x, int y, boolean mouseInside) {
+    /**
+     * Called when the mouse position moves
+     * @param x The mouse x position
+     * @param y The mouse y position
+     * @param mouseInside {@code true} if the mouse is inside the component for time cells
+     */
+    void mousePositionChanged(int x, int y, boolean mouseInside) {
         if (mouseInside) {
             int actualDay = (int) Math.floor(x / getDayWidth());
-            int minutes = (int) Math.floor(y / (getMinuteHeight() * TimeRect.minuteResterize))
-                    * TimeRect.minuteResterize;
+            int minutes = (int) Math.floor(y / (getMinuteHeight() * TimeRect.MINUTE_RASTERIZE))
+                    * TimeRect.MINUTE_RASTERIZE;
             actualDay = Math.max(0, Math.min(6, actualDay));
             minutes = Math.max(0, Math.min(24 * 60, minutes));
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheException.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheException.java	(revision 36183)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheException.java	(revision 36183)
@@ -0,0 +1,39 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.ohe.gui;
+
+/**
+ * An exception for Opening Hourse
+ */
+public class OheException extends Exception {
+    /**
+     * See {@link super#Exception()}
+     */
+    public OheException() {
+        super();
+    }
+
+    /**
+     * See {@link super#Exception(String)}
+     * @param message the message
+     */
+    public OheException(String message) {
+        super(message);
+    }
+
+    /**
+     * See {@link super#Exception(String, Throwable)}
+     * @param message the message
+     * @param cause the cause
+     */
+    public OheException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * See {@link super#Exception(Throwable)}
+     * @param cause the cause
+     */
+    public OheException(Throwable cause) {
+        super(cause);
+    }
+}
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/TimeRect.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/TimeRect.java	(revision 36182)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/TimeRect.java	(revision 36183)
@@ -10,6 +10,4 @@
 import java.awt.Graphics2D;
 import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
@@ -22,7 +20,10 @@
 import org.openstreetmap.josm.plugins.ohe.OpeningTimeUtils;
 
+/**
+ * Rectangles for a time block
+ */
 public class TimeRect extends JPanel implements MouseListener, MouseMotionListener {
     
-    public static final int[] transformCursorTypes = new int[] {
+    static final int[] transformCursorTypes = new int[] {
             Cursor.MOVE_CURSOR, Cursor.N_RESIZE_CURSOR,
             Cursor.NE_RESIZE_CURSOR, Cursor.E_RESIZE_CURSOR,
@@ -31,8 +32,8 @@
             Cursor.NW_RESIZE_CURSOR };
 
-    public static final int minuteResterize = 15;
-    public static final int verticalNonDrawedPixels = 5;
-
-    public static final boolean[][] transformDirections = new boolean[][] {
+    static final int MINUTE_RASTERIZE = 15;
+    static final int VERTICAL_NON_DRAWN_PIXELS = 5;
+
+    static final boolean[][] transformDirections = new boolean[][] {
             {true, true, true, true}, // Drag
             {true, false, false, false}, // N
@@ -46,5 +47,5 @@
     };
 
-    public static final int roundCornerSize = 8;
+    static final int roundCornerSize = 8;
     private final int clickAreaSize = 16;
 
@@ -101,5 +102,5 @@
 
     public void reposition() {
-        setBounds(editor.getPanelBoundsForTimeinterval(dayStart, dayEnd + 1, minuteStart, minuteEnd));
+        setBounds(editor.getPanelBoundsForTimeInterval(dayStart, dayEnd + 1, minuteStart, minuteEnd));
         editor.contentPanel.repaint();
     }
@@ -145,5 +146,5 @@
             innerColor = new Color(135, 234, 135);
             tmpRoundCornerSize = 0;
-            verticalNonFilledBorder = verticalNonDrawedPixels;
+            verticalNonFilledBorder = VERTICAL_NON_DRAWN_PIXELS;
         }
 
@@ -205,12 +206,9 @@
         final JCheckBoxMenuItem cbMenuItem = new JCheckBoxMenuItem(tr("open end"), isOpenEndInterval());
         menu.add(cbMenuItem);
-        cbMenuItem.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (cbMenuItem.isSelected())
-                    updateTimeInterval(dayStart, dayEnd, minuteStart, 24 * 60 + 1);
-                else
-                    updateTimeInterval(dayStart, dayEnd, minuteStart, 24 * 60);
-            }
+        cbMenuItem.addActionListener(e -> {
+            if (cbMenuItem.isSelected())
+                updateTimeInterval(dayStart, dayEnd, minuteStart, 24 * 60 + 1);
+            else
+                updateTimeInterval(dayStart, dayEnd, minuteStart, 24 * 60);
         });
         menu.show(this, evt.getX(), evt.getY());
@@ -219,8 +217,10 @@
     @Override
     public void mouseClicked(MouseEvent evt) {
+        // Do nothing
     }
 
     @Override
     public void mouseEntered(MouseEvent evt) {
+        // Do nothing
     }
 
@@ -263,6 +263,6 @@
                     - actualDayDrag;
             yDiff = (int) Math.round(yDiff
-                    / (editor.getMinuteHeight() * minuteResterize))
-                    * minuteResterize - actualMinuteDrag;
+                    / (editor.getMinuteHeight() * MINUTE_RASTERIZE))
+                    * MINUTE_RASTERIZE - actualMinuteDrag;
 
             if (xDiff != 0) {
