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()�s use of localThreadPool.shutdown() to wait for render processing to complete. In Java 7, shutdown�s 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�m using geotools 12.2. Here�s a snippit from StreamingRenderer.paint() showing the modification I made:
if(localPool) {
try {
localThreadPool.awaitTermination(100, TimeUnit.MILLISECONDS);
}
catch (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