Details
Description
A user has reported the following issue:
We came across an architectural problem in IcePDF. As you can see from the stack below and the corresponding coding there are UI manipulations done from a custom thread. Java defines Swing not to be thread safe. Therefore doing so might cause problems.
...
org.icepdf.ri.common.SwingViewBuilder.buildAnnotationPanel(SwingViewBuilder.java:1574)
org.icepdf.ri.common.SwingViewBuilder.buildUtilityTabbedPane(SwingViewBuilder.java:1541)
org.icepdf.ri.common.SwingViewBuilder.buildUtilityAndDocumentSplitPane(SwingViewBuilder.java:1501)
org.icepdf.ri.common.SwingViewBuilder.buildContents(SwingViewBuilder.java:499)
org.icepdf.ri.common.SwingViewBuilder.buildViewerPanel(SwingViewBuilder.java:482)
ice.pilots.pdf.ThePilot.createComponent(ThePilot.java:149)
ice.storm.Viewport.setPilot(VCDO)
ice.storm.StormBase.append(VCDO)
ice.storm.StormBase.do_clear_content(VCDO)
ice.storm.StormBase.do_render_content(VCDO)
ice.storm.Viewport.runAsynchronousLoad(VCDO)
ice.storm.LoadThread.run(VCDO)
We came across an architectural problem in IcePDF. As you can see from the stack below and the corresponding coding there are UI manipulations done from a custom thread. Java defines Swing not to be thread safe. Therefore doing so might cause problems.
...
org.icepdf.ri.common.SwingViewBuilder.buildAnnotationPanel(SwingViewBuilder.java:1574)
org.icepdf.ri.common.SwingViewBuilder.buildUtilityTabbedPane(SwingViewBuilder.java:1541)
org.icepdf.ri.common.SwingViewBuilder.buildUtilityAndDocumentSplitPane(SwingViewBuilder.java:1501)
org.icepdf.ri.common.SwingViewBuilder.buildContents(SwingViewBuilder.java:499)
org.icepdf.ri.common.SwingViewBuilder.buildViewerPanel(SwingViewBuilder.java:482)
ice.pilots.pdf.ThePilot.createComponent(ThePilot.java:149)
ice.storm.Viewport.setPilot(VCDO)
ice.storm.StormBase.append(VCDO)
ice.storm.StormBase.do_clear_content(VCDO)
ice.storm.StormBase.do_render_content(VCDO)
ice.storm.Viewport.runAsynchronousLoad(VCDO)
ice.storm.LoadThread.run(VCDO)
We could change ice.pilots.pdf.ThePilot so that it uses SwingUtilities.invokeAndWait(Runnable) or possibly SwingUtilities.invokeLater(Runnable), so that Swing is accessed in a thread-safe manner.
Mark