title: Agenda code compilation via maven error: AgendaSample1Impl.java:[47,81] error: diamond operator is not supported in -source 1.5
body: <p>I'm trying to compile a JFXtras project, the sample one given in the default JFXtras Agenda project, via maven, but I get the above error:</p>
  
  <pre><code>AgendaSample1Impl.java:[47,81] error: diamond operator is not supported in -source 1.5
  </code></pre>
  
  <p>The XML is as follows:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;Agenda&lt;/groupId&gt;
    &lt;artifactId&gt;Agenda&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;Agenda&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;3.8.1&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.jfxtras&lt;/groupId&gt;
        &lt;artifactId&gt;jfxtras-labs&lt;/artifactId&gt;
        &lt;version&gt;8.0-r1&lt;/version&gt;
      &lt;/dependency&gt;
  
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>The java/ maven versions are as follows:</p>
  
  <pre><code>Apache Maven 2.2.1 (rdebian-14)
  Java version: 1.8.0_05
  Java home: /usr/lib/jvm/java-8-oracle/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: "linux" version: "3.13.0-24-generic" arch: "i386" Family: "unix"
  </code></pre>
  
  <p>The said JFXtras code looks like so:</p>
  
  <pre><code>package agenda;
  
  import java.io.IOException;
  import javafx.application.Application;
  import javafx.fxml.FXML;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.scene.layout.StackPane;
  import javafx.stage.Stage;
  
  public class AgendaSample1 extends Application {
  
      @FXML
      public static StackPane rootAgenda;
  
      @Override
      public void start(Stage primaryStage) throws IOException {
  
          Parent root = FXMLLoader.load(getClass().getResource("AgendaSample1.fxml"));
  
          rootAgenda.getChildren().add(new AgendaSample1Impl().lAgenda);
  
          Scene scene = new Scene(root, 490, 490);
  
          primaryStage.setTitle("Hello World!");
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  
  }
  
  
  package agenda;
  
  import java.text.DateFormat;
  import java.text.SimpleDateFormat;
  import java.util.Calendar;
  import java.util.Collection;
  import java.util.GregorianCalendar;
  import java.util.HashMap;
  import java.util.Locale;
  import java.util.Map;
  import java.util.Random;
  import java.util.concurrent.atomic.AtomicBoolean;
  import javafx.beans.binding.Bindings;
  import javafx.beans.value.ChangeListener;
  import javafx.beans.value.ObservableValue;
  import javafx.collections.FXCollections;
  import javafx.collections.ListChangeListener;
  import javafx.collections.ObservableList;
  import javafx.scene.control.ListCell;
  import javafx.scene.control.ListView;
  import javafx.scene.layout.GridPane;
  import javafx.scene.paint.Color;
  import javafx.scene.shape.Rectangle;
  import javafx.util.Callback;
  import jfxtras.labs.scene.control.Agenda;
  import jfxtras.labs.scene.control.Agenda.Appointment;
  
  public class AgendaSample1Impl {
  
      final Agenda lAgenda;
  
      public AgendaSample1Impl() {
  
          GridPane lGridPane = new GridPane();
          lGridPane.setMaxSize(Integer.MAX_VALUE, Integer.MAX_VALUE);
          AgendaSample1.rootAgenda.getChildren().add(lGridPane);
          int lRowIdx = 0;
  
          {
              lAgenda = new Agenda();
              lAgenda.setPrefSize(600, 600);
              lAgenda.setMaxSize(Integer.MAX_VALUE, Integer.MAX_VALUE);
              lGridPane.add(lAgenda, 0, lRowIdx, 2, 1);
              lRowIdx++;
  
              // setup appointment groups
              final Map&lt;String, Agenda.AppointmentGroup&gt; lAppointmentGroupMap = new HashMap&lt;&gt;();
              lAppointmentGroupMap.put("group0", new Agenda.AppointmentGroupImpl().withStyleClass("group0"));
              lAppointmentGroupMap.put("group1", new Agenda.AppointmentGroupImpl().withStyleClass("group1"));
              lAppointmentGroupMap.put("group2", new Agenda.AppointmentGroupImpl().withStyleClass("group2"));
              lAppointmentGroupMap.put("group3", new Agenda.AppointmentGroupImpl().withStyleClass("group3"));
              lAppointmentGroupMap.put("group4", new Agenda.AppointmentGroupImpl().withStyleClass("group4"));
              lAppointmentGroupMap.put("group5", new Agenda.AppointmentGroupImpl().withStyleClass("group5"));
              lAppointmentGroupMap.put("group6", new Agenda.AppointmentGroupImpl().withStyleClass("group6"));
              lAppointmentGroupMap.put("group7", new Agenda.AppointmentGroupImpl().withStyleClass("group7"));
              lAppointmentGroupMap.put("group8", new Agenda.AppointmentGroupImpl().withStyleClass("group8"));
              lAppointmentGroupMap.put("group9", new Agenda.AppointmentGroupImpl().withStyleClass("group9"));
              lAppointmentGroupMap.put("group10", new Agenda.AppointmentGroupImpl().withStyleClass("group10"));
              lAppointmentGroupMap.put("group11", new Agenda.AppointmentGroupImpl().withStyleClass("group11"));
              lAppointmentGroupMap.put("group12", new Agenda.AppointmentGroupImpl().withStyleClass("group12"));
              lAppointmentGroupMap.put("group13", new Agenda.AppointmentGroupImpl().withStyleClass("group13"));
              lAppointmentGroupMap.put("group14", new Agenda.AppointmentGroupImpl().withStyleClass("group14"));
              lAppointmentGroupMap.put("group15", new Agenda.AppointmentGroupImpl().withStyleClass("group15"));
              lAppointmentGroupMap.put("group16", new Agenda.AppointmentGroupImpl().withStyleClass("group16"));
              lAppointmentGroupMap.put("group17", new Agenda.AppointmentGroupImpl().withStyleClass("group17"));
              lAppointmentGroupMap.put("group18", new Agenda.AppointmentGroupImpl().withStyleClass("group18"));
              lAppointmentGroupMap.put("group19", new Agenda.AppointmentGroupImpl().withStyleClass("group19"));
              lAppointmentGroupMap.put("group0", new Agenda.AppointmentGroupImpl().withStyleClass("group20"));
              lAppointmentGroupMap.put("group1", new Agenda.AppointmentGroupImpl().withStyleClass("group21"));
              lAppointmentGroupMap.put("group2", new Agenda.AppointmentGroupImpl().withStyleClass("group22"));
              lAppointmentGroupMap.put("group3", new Agenda.AppointmentGroupImpl().withStyleClass("group23"));
              for (String lId : lAppointmentGroupMap.keySet()) {
                  Agenda.AppointmentGroup lAppointmentGroup = lAppointmentGroupMap.get(lId);
                  lAppointmentGroup.setDescription(lId);
                  lAgenda.appointmentGroups().add(lAppointmentGroup);
              }
  
  // accept new appointments
              lAgenda.createAppointmentCallbackProperty().set(new Callback&lt;Agenda.CalendarRange, Agenda.Appointment&gt;() {
                  public Agenda.Appointment call(Agenda.CalendarRange calendarRange) {
                      return new Agenda.AppointmentImpl()
                          .withStartTime(calendarRange.getStartCalendar())
                          .withEndTime(calendarRange.getEndCalendar())
                          .withSummary("new")
                          .withDescription("new")
                          .withAppointmentGroup(lAppointmentGroupMap.get("group1"));
                  }
              });
  
              lAgenda.selectedAppointments().addListener(new ListChangeListener&lt;Appointment&gt;() {
                  @Override
                  public void onChanged(Change&lt;? extends Appointment&gt; c) {
                      Collection&lt;Appointment&gt; selectedAppointments = lAgenda.selectedAppointments();
                      ObservableList&lt;Appointment&gt; observableList = FXCollections.observableArrayList();
                      Bindings.bindContent(observableList, lAgenda.selectedAppointments());
                      ListView&lt;Appointment&gt; listView = new ListView&lt;&gt;(lAgenda.selectedAppointments());
  
                      listView.getSelectionModel().selectedItemProperty().addListener(
                          new ChangeListener&lt;Appointment&gt;() {
                              public void changed(ObservableValue&lt;? extends Appointment&gt; ov,
                                  Appointment old_val, Appointment new_val) {
                                  System.out.println(new_val);
                              }
                          });
  
                  }
              });
  
  // initial set
              Calendar lFirstDayOfWeekCalendar = getFirstDayOfWeekCalendar(lAgenda.getLocale(), lAgenda.getDisplayedCalendar());
              int lYear = lFirstDayOfWeekCalendar.get(Calendar.YEAR);
              int lMonth = lFirstDayOfWeekCalendar.get(Calendar.MONTH);
              int lDay = lFirstDayOfWeekCalendar.get(Calendar.DATE);
              lAgenda.appointments().addAll(
                  new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay, 8, 00))
                  .withEndTime(new GregorianCalendar(lYear, lMonth, lDay, 11, 30))
                  .withSummary("A")
                  .withDescription("A much longer test description")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group7")), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay, 8, 30))
                  .withEndTime(new GregorianCalendar(lYear, lMonth, lDay, 10, 00))
                  .withSummary("B")
                  .withDescription("A description 2")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group8")), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay, 8, 30))
                  .withEndTime(new GregorianCalendar(lYear, lMonth, lDay, 9, 30))
                  .withSummary("C")
                  .withDescription("A description 3")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group9")), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay, 9, 00))
                  .withEndTime(new GregorianCalendar(lYear, lMonth, lDay, 13, 30))
                  .withSummary("D")
                  .withDescription("A description 4")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group7")), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay, 10, 30))
                  .withEndTime(new GregorianCalendar(lYear, lMonth, lDay, 11, 00))
                  .withSummary("E")
                  .withDescription("A description 4")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group7")), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay, 12, 30))
                  .withEndTime(new GregorianCalendar(lYear, lMonth, lDay, 13, 30))
                  .withSummary("F")
                  .withDescription("A description 4")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group7")), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay, 13, 00))
                  .withEndTime(new GregorianCalendar(lYear, lMonth, lDay, 13, 30))
                  .withSummary("H")
                  .withDescription("A description 4")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group7")), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay, 14, 00))
                  .withEndTime(new GregorianCalendar(lYear, lMonth, lDay, 14, 45))
                  .withSummary("G")
                  .withDescription("A description 4")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group7")), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay, 15, 00))
                  .withEndTime(new GregorianCalendar(lYear, lMonth, lDay, 16, 00))
                  .withSummary("I")
                  .withDescription("A description 4")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group7")), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay, 15, 30))
                  .withEndTime(new GregorianCalendar(lYear, lMonth, lDay, 16, 00))
                  .withSummary("J")
                  .withDescription("A description 4")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group7")) // -----
                  , new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay))
                  .withSummary("all day1")
                  .withDescription("A description")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group7"))
                  .withWholeDay(true), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay))
                  .withSummary("all day2")
                  .withDescription("A description")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group8"))
                  .withWholeDay(true), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay))
                  .withSummary("all day3")
                  .withDescription("A description3")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group9"))
                  .withWholeDay(true), new Agenda.AppointmentImpl()
                  .withStartTime(new GregorianCalendar(lYear, lMonth, lDay + 1))
                  .withSummary("all day")
                  .withDescription("A description3")
                  .withAppointmentGroup(lAppointmentGroupMap.get("group3"))
                  .withWholeDay(true)
              );
              final String lIpsum = "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus";
  // day spanner
              {
                  Calendar lStart = (Calendar) lFirstDayOfWeekCalendar.clone();
                  lStart.add(Calendar.SECOND, 5);
                  lStart.add(Calendar.DATE, 1);
                  Calendar lEnd = (Calendar) lStart.clone();
                  lEnd.add(Calendar.DATE, 2);
  
                  Agenda.Appointment lAppointment = new Agenda.AppointmentImpl()
                      .withStartTime(lStart)
                      .withEndTime(lEnd)
                      .withSummary(lIpsum.substring(0, new Random().nextInt(50)))
                      .withDescription(lIpsum.substring(0, 10 + new Random().nextInt(lIpsum.length() - 10)))
                      .withAppointmentGroup(lAppointmentGroupMap.get("group" + (new Random().nextInt(3) + 1)));
  
                  lAgenda.appointments().add(lAppointment);
              }
  
  // update range
              final AtomicBoolean lSkippedFirstRangeChange = new AtomicBoolean(false);
              lAgenda.calendarRangeCallbackProperty().set(new Callback&lt;Agenda.CalendarRange, Void&gt;() {
                  public Void call(Agenda.CalendarRange arg0) {
  // the first change should not be processed, because it is set above
                      if (lSkippedFirstRangeChange.get() == false) {
                          lSkippedFirstRangeChange.set(true);
                          return null;
                      }
  
  // add a whole bunch of random appointments
                      for (int i = 0; i &lt; 20; i++) {
                          Calendar lFirstDayOfWeekCalendar = getFirstDayOfWeekCalendar(lAgenda.getLocale(), lAgenda.getDisplayedCalendar());
  
                          Calendar lStart = (Calendar) lFirstDayOfWeekCalendar.clone();
                          lStart.add(Calendar.DATE, new Random().nextInt(7));
                          lStart.add(Calendar.HOUR_OF_DAY, new Random().nextInt(24));
                          lStart.add(Calendar.MINUTE, new Random().nextInt(60));
  
                          Calendar lEnd = (Calendar) lStart.clone();
                          lEnd.add(Calendar.MINUTE, 15 + new Random().nextInt(24 * 60));
  
                          Agenda.Appointment lAppointment = new Agenda.AppointmentImpl()
                              .withStartTime(lStart)
                              .withEndTime(lEnd)
                              .withWholeDay(new Random().nextInt(50) &gt; 40)
                              .withSummary(lIpsum.substring(0, new Random().nextInt(50)))
                              .withDescription(lIpsum.substring(0, new Random().nextInt(lIpsum.length())))
                              .withAppointmentGroup(lAppointmentGroupMap.get("group" + (new Random().nextInt(24))));
                          lAgenda.appointments().add(lAppointment);
                      }
                      return null;
                  }
              });
  
              lAgenda.selectedAppointments().addListener(new ListChangeListener&lt; Appointment&gt;() {
                  public void onChanged(ListChangeListener.Change&lt;? extends Appointment&gt; c) {
                      while (c.next()) {
                          if (c.wasPermutated()) {
                              for (int i = c.getFrom(); i &lt; c.getTo(); ++i) {
                                  //permutate
                              }
                          } else if (c.wasUpdated()) {
                              //update item
                          } else {
                              for (Appointment a : c.getRemoved()) {
                              }
                              for (Appointment a : c.getAddedSubList()) {
                                  printAppointment(a);
                              }
                          }
                      }
                  }
              });
  
  // ComboBox&lt;String&gt; lComboBox = new ComboBox&lt;String&gt;(FXCollections.observableArrayList("Single", "Range", "Multiple"));
  // lComboBox.valueProperty().addListener(new ChangeListener&lt;String&gt;()
  // {
  // @Override
  // public void changed(ObservableValue&lt;? extends String&gt; observableValue, String oldValue, String newValue)
  // {
  // if (newValue.startsWith("S")) lAgenda.setMode(Agenda.Mode.SINGLE);
  // if (newValue.startsWith("R")) lAgenda.setMode(Agenda.Mode.RANGE);
  // if (newValue.startsWith("M")) lAgenda.setMode(Agenda.Mode.MULTIPLE);
  // }
  // });
  // lComboBox.setValue("Single");
  // lComboBox.setPrefWidth(200);
  // lGridPane.add(new Label("Mode:"), 0, lRowIdx);
  // lGridPane.add(lComboBox, 1, lRowIdx);
  // lRowIdx++;
          }
      }
  
      /**
       * get the calendar for the first day of the week
       */
      static private Calendar getFirstDayOfWeekCalendar(Locale locale, Calendar c) {
          // result
          int lFirstDayOfWeek = Calendar.getInstance(locale).getFirstDayOfWeek();
          int lCurrentDayOfWeek = c.get(Calendar.DAY_OF_WEEK);
          int lDelta = 0;
          if (lFirstDayOfWeek &lt;= lCurrentDayOfWeek) {
              lDelta = -lCurrentDayOfWeek + lFirstDayOfWeek;
          } else {
              lDelta = -lCurrentDayOfWeek - (7 - lFirstDayOfWeek);
          }
          c = ((Calendar) c.clone());
          c.add(Calendar.DATE, lDelta);
          return c;
      }
  
      static class ColorRectCell extends ListCell&lt;String&gt; {
  
          @Override
          public void updateItem(String item, boolean empty) {
              super.updateItem(item, empty);
              Rectangle rect = new Rectangle(100, 20);
              if (item != null) {
                  rect.setFill(Color.web(item));
                  setGraphic(rect);
              }
          }
      }
  
      void printAppointment(Appointment a) {
          System.out.println(a.getSummary());
          System.out.println(a.getDescription());
  
          DateFormat formatter = new SimpleDateFormat("yyyy. MMM EEE.d h:mma");
          System.out.println(formatter.format(a.getStartTime().getTime()));
          System.out.println(formatter.format(a.getEndTime().getTime()));
          System.out.println(a.getAppointmentGroup());
          System.out.println(a.getLocation());
          this.daysBetween(a.getStartTime().getTimeInMillis(), a.getEndTime().getTimeInMillis());
  
      }
  
      private void daysBetween(long t1, long t2) {
          int diff = (int) (t2 - t1);
  
          long diffSeconds = diff / 1000;
          long diffMinutes = diff / (60 * 1000);
          long diffHours = diff / (60 * 60 * 1000);
          long diffDays = diff / (24 * 60 * 60 * 1000);
  
          System.out.println("diffSeconds difference = " + diffSeconds);
          System.out.println("diffMinutes difference = " + diffMinutes);
          System.out.println("diffHours difference = " + diffHours);
          System.out.println("diffDays difference = " + diffDays);
      }
  }
  </code></pre>