Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8050221

Missing type variable in where clause

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 7u15
    • tools
    • windows_7

      FULL PRODUCT VERSION :
      java version " 1.7.0_15 "
      Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
      Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      The below code caused javac to crash:

          private final Notifier<Task<?>> notifier = null;
          
          private <R> Future<R> add(final Task<R> task) {

              ExecutorService service = Executors.newCachedThreadPool();

              return service.submit(new Callable<R>() {
                  @Override
                  public R call() throws Exception {
                      try {
                          R rtn = task.execute();
                          notifier.notifyRemove(TaskManager.this, this);
                          return rtn;
                      } catch (Exception e) {
                          String err = " Exception while executing task: " + task;
                          logger.log(Level.SEVERE, err, e);
                          throw new RuntimeException(err, e);
                      }
                  }
              });
          }

      Where Notifier is defined as such:
      public interface Notifier<T> {

          void notifyAdd(Object source, T... newObjects);

          void notifyUpdate(Object source, T... changedObjects);

          void notifyRemove(Object source, T... removedObjects);
      }


      REPRODUCIBILITY :
      This bug can be reproduced always.

            mcimadamore Maurizio Cimadamore
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: