This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jtimer. See http://git.chorem.org/jtimer.git commit 5e5054ab951665c880b1f96518fc38f2d49de93c Author: Eric Chatellier <chatellier@codelutin.com> Date: Tue Feb 23 11:46:35 2016 +0100 refs #1322: Manage resources with auto-closeable --- .../org/chorem/jtimer/data/TimerDataManager.java | 2 +- .../chorem/jtimer/io/GTimerIncrementalSaver.java | 412 ++++++++++----------- .../java/org/chorem/jtimer/ui/TimerTaskEditor.java | 25 +- .../chorem/jtimer/ui/alert/AlertCellEditor.java | 4 +- .../chorem/jtimer/ui/alert/AlertCellRenderer.java | 4 +- 5 files changed, 222 insertions(+), 225 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/data/TimerDataManager.java b/src/main/java/org/chorem/jtimer/data/TimerDataManager.java index 673c7c2..014d1da 100644 --- a/src/main/java/org/chorem/jtimer/data/TimerDataManager.java +++ b/src/main/java/org/chorem/jtimer/data/TimerDataManager.java @@ -2,7 +2,7 @@ * #%L * jTimer * %% - * Copyright (C) 2007 - 2010 CodeLutin, Chatellier Eric + * Copyright (C) 2007 - 2016 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as diff --git a/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java b/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java index 88cd371..2240d8c 100644 --- a/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java +++ b/src/main/java/org/chorem/jtimer/io/GTimerIncrementalSaver.java @@ -2,7 +2,7 @@ * #%L * jTimer * %% - * Copyright (C) 2007 - 2012 CodeLutin, Chatellier Eric + * Copyright (C) 2007 - 2016 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -30,6 +30,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; +import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.RandomAccessFile; import java.io.Writer; @@ -47,11 +48,11 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Properties; import java.util.SortedMap; import java.util.Timer; import java.util.TreeMap; -import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.zip.ZipEntry; @@ -62,9 +63,9 @@ import org.apache.commons.logging.LogFactory; import org.chorem.jtimer.data.DataEventListener; import org.chorem.jtimer.data.DataViolationException; import org.chorem.jtimer.entities.TimerAlert; +import org.chorem.jtimer.entities.TimerAlert.Type; import org.chorem.jtimer.entities.TimerProject; import org.chorem.jtimer.entities.TimerTask; -import org.chorem.jtimer.entities.TimerAlert.Type; /** * Charge et sauve les fichiers au format gTimer. @@ -412,39 +413,44 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, protected TimerProject getProjectFromFile(File projectFile) throws IOException { - Properties prop = new Properties(); - prop.load(new BufferedInputStream(new FileInputStream(projectFile))); - - // log - if (log.isDebugEnabled()) { - log.debug("Load project (" + projectFile.getName() + ") : " - + prop.getProperty("Name")); - } - TimerProject p = null; - if (GTIMER_FILE_VERSION.equals(prop.get("Format"))) { - p = new TimerProject(); - p.setName(prop.getProperty("Name")); - // manage creation timestamp (conversion to long) - try { - String creationTimeStamp = prop.getProperty("Created"); - long timestampinms = Long.parseLong(creationTimeStamp) * 1000; - p.setCreationDate(new Date(timestampinms)); - } catch (NumberFormatException e) { + try (InputStream is = new BufferedInputStream(new FileInputStream(projectFile))) { + Properties prop = new Properties(); + prop.load(is); + + // log + if (log.isDebugEnabled()) { + log.debug("Load project (" + projectFile.getName() + ") : " + + prop.getProperty("Name")); + } + + + if (GTIMER_FILE_VERSION.equals(prop.get("Format"))) { + p = new TimerProject(); + p.setName(prop.getProperty("Name")); + + // manage creation timestamp (conversion to long) + try { + String creationTimeStamp = prop.getProperty("Created"); + long timestampinms = Long.parseLong(creationTimeStamp) * 1000; + p.setCreationDate(new Date(timestampinms)); + } catch (NumberFormatException e) { + if (log.isWarnEnabled()) { + log.warn("Invalid 'Created' timestamp", e); + } + p.setCreationDate(new Date(0)); + } + + p.setClosed(prop.getProperty("Options").equals("1")); + } else { if (log.isWarnEnabled()) { - log.warn("Invalid 'Created' timestamp", e); + log.warn("Invalid file format. Excepted " + GTIMER_FILE_VERSION + + ", found " + prop.get("Format")); } - p.setCreationDate(new Date(0)); - } - - p.setClosed(prop.getProperty("Options").equals("1")); - } else { - if (log.isWarnEnabled()) { - log.warn("Invalid file format. Excepted " + GTIMER_FILE_VERSION - + ", found " + prop.get("Format")); } } + return p; } @@ -465,96 +471,98 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, Pattern dataPattern = Pattern.compile("(\\d{4})(\\d{2})(\\d{2})"); - Properties prop = new Properties(); - prop.load(new BufferedInputStream(new FileInputStream(taskFile))); - - if (GTIMER_FILE_VERSION.equals(prop.get("Format"))) { - t = new TimerTask(); - - // manage creation timestamp (convertion to long) - try { - String creationTimeStamp = prop.getProperty("Created"); - long timestampinms = Long.parseLong(creationTimeStamp) * 1000; - t.setCreationDate(new Date(timestampinms)); - } catch (NumberFormatException e) { - if (log.isWarnEnabled()) { - log.warn("Invalid 'Created' timestamp for " + taskFile, e); + try (InputStream is = new BufferedInputStream(new FileInputStream(taskFile))) { + Properties prop = new Properties(); + prop.load(is); + + if (GTIMER_FILE_VERSION.equals(prop.get("Format"))) { + t = new TimerTask(); + + // manage creation timestamp (convertion to long) + try { + String creationTimeStamp = prop.getProperty("Created"); + long timestampinms = Long.parseLong(creationTimeStamp) * 1000; + t.setCreationDate(new Date(timestampinms)); + } catch (NumberFormatException e) { + if (log.isWarnEnabled()) { + log.warn("Invalid 'Created' timestamp for " + taskFile, e); + } + t.setCreationDate(new Date(0)); } - t.setCreationDate(new Date(0)); - } - - t.setClosed(prop.getProperty("Options").equals("1")); - - // name = task - // name = task/subtask1 - // name = task/subtask1/subsubtask1 - String gtimerTaskName = prop.getProperty("Name"); - t.setName(gtimerTaskName); - // yes put all names - // will be corrected later - - // log - if (log.isDebugEnabled()) { - log.debug("Load task (" + taskFile.getName() + ") : " - + gtimerTaskName); - } - - // analyse des donnees (temps) - for (Object key : prop.keySet()) { - String sKey = (String) key; - - // test if key format match - Matcher m = dataPattern.matcher(sKey); - if (m.find()) { - try { - Date keyDate = GTimerTimeUtil.yyyyMMdd2Date(sKey); - String timeString = (String) prop.get(sKey); - t.setTime(keyDate, Long.valueOf(timeString) * 1000); - } catch (NumberFormatException e) { - if (log.isErrorEnabled()) { - log.error("Can't convert " + prop.get(sKey) - + " into long"); + + t.setClosed(prop.getProperty("Options").equals("1")); + + // name = task + // name = task/subtask1 + // name = task/subtask1/subsubtask1 + String gtimerTaskName = prop.getProperty("Name"); + t.setName(gtimerTaskName); + // yes put all names + // will be corrected later + + // log + if (log.isDebugEnabled()) { + log.debug("Load task (" + taskFile.getName() + ") : " + + gtimerTaskName); + } + + // analyse des donnees (temps) + for (Object key : prop.keySet()) { + String sKey = (String) key; + + // test if key format match + Matcher m = dataPattern.matcher(sKey); + if (m.find()) { + try { + Date keyDate = GTimerTimeUtil.yyyyMMdd2Date(sKey); + String timeString = (String) prop.get(sKey); + t.setTime(keyDate, Long.valueOf(timeString) * 1000); + } catch (NumberFormatException e) { + if (log.isErrorEnabled()) { + log.error("Can't convert " + prop.get(sKey) + + " into long"); + } } } + // else not data entry } - // else not data entry - } - - // find associated project instance with number - String taskProjectNumber = (String) prop.get("Project"); - TimerProject associatedProject = mapNumberProject - .get(taskProjectNumber); - - // fix bug case task has no associated project - // can do that in gtimer - if (associatedProject == null && taskProjectNumber.equals("-1")) { - associatedProject = new TimerProject(); - associatedProject.setName(GTIMER_EMPTY_PROJECT_NAME); - mapNumberProject.put(taskProjectNumber, associatedProject); - } - - if (associatedProject != null) { - // used to correct bug #1636 : [jTimer] Bug du rechargement des - // sous taches - taskToManage.put(t, associatedProject); - - if (log.isDebugEnabled()) { - log.debug("Put " + t.getName() + ", " - + associatedProject.getName()); + + // find associated project instance with number + String taskProjectNumber = (String) prop.get("Project"); + TimerProject associatedProject = mapNumberProject + .get(taskProjectNumber); + + // fix bug case task has no associated project + // can do that in gtimer + if (associatedProject == null && taskProjectNumber.equals("-1")) { + associatedProject = new TimerProject(); + associatedProject.setName(GTIMER_EMPTY_PROJECT_NAME); + mapNumberProject.put(taskProjectNumber, associatedProject); } + + if (associatedProject != null) { + // used to correct bug #1636 : [jTimer] Bug du rechargement des + // sous taches + taskToManage.put(t, associatedProject); + + if (log.isDebugEnabled()) { + log.debug("Put " + t.getName() + ", " + + associatedProject.getName()); + } + } else { + if (log.isWarnEnabled()) { + log.warn("task " + t.getName() + + " is associated with a wrong project number " + + prop.get("Project")); + } + } + } else { if (log.isWarnEnabled()) { - log.warn("task " + t.getName() - + " is associated with a wrong project number " - + prop.get("Project")); + log.warn("Invalid file format. Excepted " + GTIMER_FILE_VERSION + + ", found " + prop.get("Format")); } } - - } else { - if (log.isWarnEnabled()) { - log.warn("Invalid file format. Excepted " + GTIMER_FILE_VERSION - + ", found " + prop.get("Format")); - } } return t; @@ -577,27 +585,28 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, log.debug("Annotations found for task " + task.getName()); } - Properties prop = new Properties(); - prop.load(new BufferedInputStream(new FileInputStream( - annotationsTaskFile))); - - // analyse des donnees (temps) - for (Object key : prop.keySet()) { - String sKey = (String) key; - - // test if key format match - try { - - // key of annotation is in seconds - long timestamp = Long.parseLong(sKey); - Date dateTS = new Date(timestamp * 1000); - - String annoText = (String) prop.get(sKey); - - task.addAnnotation(dateTS, annoText); - } catch (NumberFormatException e) { - if (log.isErrorEnabled()) { - log.error("Can't convert " + sKey + " into long"); + try (InputStream is = new BufferedInputStream(new FileInputStream(annotationsTaskFile))) { + Properties prop = new Properties(); + prop.load(is); + + // analyse des donnees (temps) + for (Object key : prop.keySet()) { + String sKey = (String) key; + + // test if key format match + try { + + // key of annotation is in seconds + long timestamp = Long.parseLong(sKey); + Date dateTS = new Date(timestamp * 1000); + + String annoText = (String) prop.get(sKey); + + task.addAnnotation(dateTS, annoText); + } catch (NumberFormatException e) { + if (log.isErrorEnabled()) { + log.error("Can't convert " + sKey + " into long"); + } } } } @@ -624,45 +633,43 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, log.debug("Alert found for task " + task.getName()); } - BufferedReader alertIn = new BufferedReader(new FileReader( - alertTaskFile)); - - // skip first line : "format: 1.2" - String line = alertIn.readLine(); - while ((line = alertIn.readLine()) != null) { - - line = line.trim(); - if (!line.isEmpty()) { - String alertType = line.substring(0, line.indexOf(' ')); - String alertDuration = line.substring( - line.indexOf(' ') + 1, line.length()); - - try { - if ("reachtotaltime".equals(alertType)) { - Long duration = Long.parseLong(alertDuration) * 1000; - TimerAlert alert = new TimerAlert( - TimerAlert.Type.REACH_TOTAL_TIME, duration); - task.addAlert(alert); - } else if ("reachdailytime".equals(alertType)) { - Long duration = Long.parseLong(alertDuration) * 1000; - TimerAlert alert = new TimerAlert( - TimerAlert.Type.REACH_DAILY_TIME, duration); - task.addAlert(alert); - } else { - if (log.isWarnEnabled()) { - log.warn("Unknow alert type " + alertType); + try (BufferedReader alertIn = new BufferedReader(new FileReader(alertTaskFile))) { + + // skip first line : "format: 1.2" + String line = alertIn.readLine(); + while ((line = alertIn.readLine()) != null) { + + line = line.trim(); + if (!line.isEmpty()) { + String alertType = line.substring(0, line.indexOf(' ')); + String alertDuration = line.substring( + line.indexOf(' ') + 1, line.length()); + + try { + if ("reachtotaltime".equals(alertType)) { + Long duration = Long.parseLong(alertDuration) * 1000; + TimerAlert alert = new TimerAlert( + TimerAlert.Type.REACH_TOTAL_TIME, duration); + task.addAlert(alert); + } else if ("reachdailytime".equals(alertType)) { + Long duration = Long.parseLong(alertDuration) * 1000; + TimerAlert alert = new TimerAlert( + TimerAlert.Type.REACH_DAILY_TIME, duration); + task.addAlert(alert); + } else { + if (log.isWarnEnabled()) { + log.warn("Unknow alert type " + alertType); + } + } + } catch (NumberFormatException e) { + if (log.isErrorEnabled()) { + log.error("Can't convert " + alertDuration + + " into long"); } - } - } catch (NumberFormatException e) { - if (log.isErrorEnabled()) { - log.error("Can't convert " + alertDuration - + " into long"); } } } } - - alertIn.close(); } } @@ -778,13 +785,11 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, } // - try { + try (ZipOutputStream outZip = new ZipOutputStream(new FileOutputStream(zipFileName))) { + // Create a buffer for reading the files byte[] buffer = new byte[1024]; - ZipOutputStream outZip = new ZipOutputStream(new FileOutputStream( - zipFileName)); - // add in this archive only gtimer files File gtimerdir = new File(saveDirectory); File[] filesInIt = gtimerdir.listFiles(); @@ -793,19 +798,18 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, String filename = fileInIt.getName(); if (isGTimerFile(filename)) { - FileInputStream inFileStream = new FileInputStream(fileInIt); - - outZip.putNextEntry(new ZipEntry(filename)); - - // Transfer bytes from the file to the ZIP file - int len; - while ((len = inFileStream.read(buffer)) > 0) { - outZip.write(buffer, 0, len); + try (FileInputStream inFileStream = new FileInputStream(fileInIt)) { + outZip.putNextEntry(new ZipEntry(filename)); + + // Transfer bytes from the file to the ZIP file + int len; + while ((len = inFileStream.read(buffer)) > 0) { + outZip.write(buffer, 0, len); + } + + // Complete the entry + outZip.closeEntry(); } - - // Complete the entry - outZip.closeEntry(); - inFileStream.close(); } } @@ -865,16 +869,14 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, } File backupfile = null; - try { - File projectfile = new File(filename); + File projectfile = new File(filename); + + // encode it to iso-8859-1, because props.load() use this encoding + try (Writer out = new OutputStreamWriter(new FileOutputStream(projectfile), "ISO-8859-1")) { // first try to make backup backupfile = makeBackupFile(projectfile); - // encode it to iso-8859-1, because props.load() use this encoding - Writer out = new OutputStreamWriter(new FileOutputStream( - projectfile), "ISO-8859-1"); - // get creation date long mscreatedtime = project.getCreationDate().getTime(); String createdTime = String.valueOf(mscreatedtime / 1000); @@ -885,13 +887,10 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, out.write("Created: " + createdTime + "\n"); out.write("Options: " + (project.isClosed() ? "1" : "0") + "\n"); - out.close(); - deleteBackupFile(backupfile); } catch (IOException e) { if (log.isDebugEnabled()) { - log.error("Can't save project information, restore backup file", - e); + log.error("Can't save project information, restore backup file", e); } // can be null if backup throw the exception @@ -967,15 +966,14 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, } File backupfile = null; - try { - File taskfile = new File(filename); + File taskfile = new File(filename); + + // encode it to iso-8859-1, because props.load() use this encoding + try (Writer out = new OutputStreamWriter(new FileOutputStream(taskfile), "ISO-8859-1")) { + // first make backup backupfile = makeBackupFile(taskfile); - // encode it to iso-8859-1, because props.load() use this encoding - Writer out = new OutputStreamWriter(new FileOutputStream(taskfile), - "ISO-8859-1"); - // Format: 1.2 // Name: Test Tache 1.2 // Created: 1180944724 @@ -1006,8 +1004,6 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, out.write(gtimerDate + " " + value + "\n"); } - out.close(); - deleteBackupFile(backupfile); } catch (IOException e) { if (log.isErrorEnabled()) { @@ -1037,13 +1033,11 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, && !task.getAllDaysAnnotations().isEmpty()) { File backupfile = null; - try { + try (Writer out = new OutputStreamWriter(new FileOutputStream(annotationTaskFile), "ISO-8859-1")) { + // first make backup backupfile = makeBackupFile(annotationTaskFile); - Writer out = new OutputStreamWriter(new FileOutputStream( - annotationTaskFile), "ISO-8859-1"); - // save time of each day for (Entry<Date, String> entry : task.getAllDaysAnnotations() .entrySet()) { @@ -1054,8 +1048,6 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, out.write(gtimerTS + " " + entry.getValue() + "\n"); } - out.close(); - deleteBackupFile(backupfile); } catch (IOException e) { if (log.isErrorEnabled()) { @@ -1088,13 +1080,11 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, if (task.getAlerts() != null && !task.getAlerts().isEmpty()) { File backupfile = null; - try { + try (Writer out = new OutputStreamWriter(new FileOutputStream(alertTaskFile), "ISO-8859-1")) { + // first make backup backupfile = makeBackupFile(alertTaskFile); - Writer out = new OutputStreamWriter(new FileOutputStream( - alertTaskFile), "ISO-8859-1"); - out.write("Format: " + GTIMER_FILE_VERSION + "\n"); // save each alert @@ -1113,8 +1103,6 @@ public class GTimerIncrementalSaver extends AbstractSaver implements Saver, } } - out.close(); - deleteBackupFile(backupfile); } catch (IOException e) { if (log.isErrorEnabled()) { diff --git a/src/main/java/org/chorem/jtimer/ui/TimerTaskEditor.java b/src/main/java/org/chorem/jtimer/ui/TimerTaskEditor.java index d474a65..44b9b41 100644 --- a/src/main/java/org/chorem/jtimer/ui/TimerTaskEditor.java +++ b/src/main/java/org/chorem/jtimer/ui/TimerTaskEditor.java @@ -2,7 +2,7 @@ * #%L * jTimer * %% - * Copyright (C) 2008 - 2011 CodeLutin, Chorlet Stéphane, Chatellier Eric, Chemit Tony + * Copyright (C) 2008 - 2016 CodeLutin, Chorlet Stéphane, Chatellier Eric, Chemit Tony * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -234,7 +234,9 @@ public class TimerTaskEditor extends JDialog implements ActionListener { } /** - * create command panel. + * Create command panel. + * + * @return command panel */ protected JPanel createCommandPanel() { // apply button @@ -276,7 +278,9 @@ public class TimerTaskEditor extends JDialog implements ActionListener { } /** - * create main content. + * Create main content. + * + * @return content panel */ protected JPanel createContentPanel() { JPanel panel = new JPanel(); @@ -297,7 +301,9 @@ public class TimerTaskEditor extends JDialog implements ActionListener { } /** - * create edition panel + * Create edition panel. + * + * @return edition panel */ protected JPanel createEditionPanel() { // timetask label @@ -363,7 +369,9 @@ public class TimerTaskEditor extends JDialog implements ActionListener { } /** - * create JXMonthView + * Create JXMonthView. + * + * @return month view component */ protected JXMonthView createJXMonthView() { monthView = new JXMonthView(); @@ -400,7 +408,9 @@ public class TimerTaskEditor extends JDialog implements ActionListener { } /** - * create three spinners panel + * Create three spinners panel. + * + * @return spinner panel */ protected JPanel createSpinnersPanel() { // hours spinner @@ -435,8 +445,7 @@ public class TimerTaskEditor extends JDialog implements ActionListener { } /** - * Listener on spinnerH, spinnerM and spinnerS - * + * Listener on spinnerH, spinnerM and spinnerS. */ protected class SpinnerListener implements ChangeListener { @Override diff --git a/src/main/java/org/chorem/jtimer/ui/alert/AlertCellEditor.java b/src/main/java/org/chorem/jtimer/ui/alert/AlertCellEditor.java index e66be7a..564afc5 100644 --- a/src/main/java/org/chorem/jtimer/ui/alert/AlertCellEditor.java +++ b/src/main/java/org/chorem/jtimer/ui/alert/AlertCellEditor.java @@ -2,7 +2,7 @@ * #%L * jTimer * %% - * Copyright (C) 2009 - 2011 CodeLutin, Chatellier Eric + * Copyright (C) 2009 - 2016 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -84,7 +84,7 @@ public class AlertCellEditor extends AbstractCellEditor implements TableCellEdit switch (column) { case 0: - JComboBox combo = new JComboBox(); + JComboBox<Type> combo = new JComboBox<>(); combo.addItem(Type.REACH_DAILY_TIME); combo.addItem(Type.REACH_TOTAL_TIME); combo.setSelectedItem(value); diff --git a/src/main/java/org/chorem/jtimer/ui/alert/AlertCellRenderer.java b/src/main/java/org/chorem/jtimer/ui/alert/AlertCellRenderer.java index 5d1b335..eab6541 100644 --- a/src/main/java/org/chorem/jtimer/ui/alert/AlertCellRenderer.java +++ b/src/main/java/org/chorem/jtimer/ui/alert/AlertCellRenderer.java @@ -2,7 +2,7 @@ * #%L * jTimer * %% - * Copyright (C) 2009 - 2011 CodeLutin, Chatellier Eric + * Copyright (C) 2009 - 2016 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -56,7 +56,7 @@ public class AlertCellRenderer extends DefaultTableCellRenderer { Component c = null; switch (column) { case 0: - JComboBox combo = new JComboBox(); + JComboBox<Type> combo = new JComboBox<>(); combo.addItem(Type.REACH_DAILY_TIME); combo.addItem(Type.REACH_TOTAL_TIME); combo.setSelectedItem(value); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.