diff --git a/README.md b/README.md index 91cc6e1..68bbbf9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ICalAvailable Given one or more calendars in -[iCalendar format](http://en.wikipedia.org/wiki/ICalendar), +[iCalendar format](https://en.wikipedia.org/wiki/ICalendar), produces a textual summary of available times. This is useful for sending someone a list of acceptable times for a meeting, if you need to negotiate a meeting time via text rather than sharing a calendar. diff --git a/src/main/elisp/ical-available.el b/src/main/elisp/ical-available.el index e6172af..ac6ec38 100644 --- a/src/main/elisp/ical-available.el +++ b/src/main/elisp/ical-available.el @@ -42,7 +42,6 @@ With just C-u prefix argument, prompt for starting date and days." (append (list "-cp" (substitute-in-file-name "$HOME/java/plume-lib/icalavailable/build/libs/icalavailable-all.jar") "-Dical4j.parsing.relaxed=true" - "-Dical4j.parsing.relaxed=true" "org.plumelib.icalavailable.ICalAvailable") ical-args))) (if (or (= (char-before) 0) (= (char-before) 1) (= (char-before) 255)) diff --git a/src/main/java/org/plumelib/icalavailable/ICalAvailable.java b/src/main/java/org/plumelib/icalavailable/ICalAvailable.java index b9b7a75..48fd843 100644 --- a/src/main/java/org/plumelib/icalavailable/ICalAvailable.java +++ b/src/main/java/org/plumelib/icalavailable/ICalAvailable.java @@ -172,9 +172,9 @@ private ICalAvailable() { @EnsuresNonNull("tz1") static void processOptions(String[] args) { Options options = new Options("ICalAvailable [options]", ICalAvailable.class); - String[] remaining_args = options.parse(true, args); - if (remaining_args.length != 0) { - System.err.println("Unrecognized arguments: " + Arrays.toString(remaining_args)); + String[] remainingArgs = options.parse(true, args); + if (remainingArgs.length != 0) { + System.err.println("Unrecognized arguments: " + Arrays.toString(remainingArgs)); System.exit(1); } if (iCal_URL.isEmpty()) { @@ -220,9 +220,9 @@ static void processOptions(String[] args) { start_date.setTimeZone(tz1); start_date.setMinutes((start_date.getMinutes() / 15) * 15); - for (String URL : iCal_URL) { + for (String iCalUrl : iCal_URL) { try { - URL url = new URL(URL); + URL url = new URL(iCalUrl); CalendarBuilder builder = new CalendarBuilder(); Calendar c; try (InputStream urlStream = url.openStream()) { @@ -233,15 +233,14 @@ static void processOptions(String[] args) { System.out.println(); System.out.println("It is possible that the calendar has moved."); // Debugging: write the URL contents to standard output - URL url2 = new URL(URL); - try (InputStream url_is = url2.openStream()) { - System.out.printf("URL: %s%n", url2); + try (InputStream contentStream = url.openStream()) { + System.out.printf("URL: %s%n", url); System.out.println("Contents:"); byte[] buffer = new byte[1024]; - int len = url_is.read(buffer); + int len = contentStream.read(buffer); while (len != -1) { System.out.write(buffer, 0, len); - len = url_is.read(buffer); + len = contentStream.read(buffer); } System.out.println(); } @@ -252,7 +251,7 @@ static void processOptions(String[] args) { calendars.add(c); } catch (Exception e) { e.printStackTrace(System.err); - System.err.println("Could not read calendar from " + URL); + System.err.println("Could not read calendar from " + iCalUrl); System.exit(1); } } @@ -584,10 +583,10 @@ static java.util.Date parseDate(String strDate) throws ParseException { int year = new Date().getYear() + 1900; strDate = strDate + "/" + year; } - for (DateFormat this_df : dateFormats) { - this_df.setLenient(false); + for (DateFormat dateFormat : dateFormats) { + dateFormat.setLenient(false); try { - java.util.Date result = this_df.parse(strDate); + java.util.Date result = dateFormat.parse(strDate); return result; } catch (ParseException e) { // Try the next format in the list.