[Debichem-devel] Bug#875585: FTBFS with Java 9: AWT api changes

Emmanuel Bourg ebourg at apache.org
Mon Mar 12 09:54:26 UTC 2018


Control: tag -1 + patch

Here is a patch fixing this issue. Besides the JSpecView error caused by
changes to DefaultMutableTreeNode in Java 9 there is an error caused by
the use of sun.audio.* classes (replaced by equivalent classes in
javax.sound.sampled in the patch), and another one during the generation
of the javadoc caused by the use of a debug method named '_()' (fixed by
setting the source level to 1.7).
-------------- next part --------------
--- a/JSpecViewLib/src/jspecview/api/JSVTreeNode.java
+++ b/JSpecViewLib/src/jspecview/api/JSVTreeNode.java
@@ -17,7 +17,7 @@
 
 	PanelNode getPanelNode();
 
-	Enumeration<JSVTreeNode> children();
+	Enumeration children();
 
 	int getIndex();
 
--- a/Jmol/src/org/openscience/jmol/app/jmolpanel/StatusListener.java
+++ b/Jmol/src/org/openscience/jmol/app/jmolpanel/StatusListener.java
@@ -46,9 +46,7 @@
 import org.openscience.jmol.app.jmolpanel.console.AppConsole;
 import org.openscience.jmol.app.webexport.WebExport;
 
-import sun.audio.AudioData;
-import sun.audio.AudioDataStream;
-import sun.audio.AudioPlayer;
+import javax.sound.sampled.*;
 
 class StatusListener implements JmolStatusListener, JmolSyncInterface, JSVInterface {
 
@@ -268,7 +266,9 @@
       if (ret == null || ret instanceof String) {
         return;
       }
-      AudioPlayer.player.start(new AudioDataStream(new AudioData((byte[]) ret)));
+      Clip clip = AudioSystem.getClip();
+      clip.open(AudioSystem.getAudioInputStream(new java.io.ByteArrayInputStream((byte[]) ret)));
+      clip.start();
     } catch (Exception e) {
       Logger.info(e.getMessage());
     }
--- a/Jmol/build.xml
+++ b/Jmol/build.xml
@@ -1506,6 +1506,7 @@
           description="Generation of Javadoc">
     <mkdir dir="${javadoc.dir}"/>
     <javadoc destdir="${javadoc.dir}" sourcepath="src"
+             source="1.7"
              private="true" encoding="UTF8"
              packagenames="org.openscience.*,org.jmol.*"
              excludepackagenames="org.jmol.jcamp.*">


More information about the Debichem-devel mailing list