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.
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.
- duplicates
-
JDK-8010387 Javac crashes when diagnostic mentions anonymous inner class' type variables
- Closed