Hal Mirsky on the user list.
Hello,
Iââ¬â¢ve been experimenting with JLayeredMapPane and believe Iââ¬â¢ve uncovered an issue in StreamingRenderer tied to Java 7. I observed LabelCacheImpl.paintLabels throwing InvalidState exceptions and traced it to StreamingRenderer.paint() use of localThreadPool.shutdown() to wait for render processing to complete. In Java 7, shutdown() behavior has changed from Java 6 as follows:
ââ¬Å“This method does not wait for previously submitted tasks to complete execution. Use awaitTermination to do that.ââ¬Â
After changing StreamingRenderer.paint() to use awaitTermination instead of shutdown the exceptions do not occur.
I am using geotools 12.2. Here is a snippit from StreamingRenderer.paint() showing the modification I made:
(localPool) {
{
localThreadPool.awaitTermination(100, TimeUnit.MILLISECONDS);
}
(Exception e) {
fireErrorEvent(e);
}
}
This fix seems to be brittle partly because of the timeout value. A rendering ââ¬Ëhintââ¬â¢ could be used to make the timeout a tunable parameter. Any suggestions?
Hal