Browse Source

Replaced calls to system class loader with calls to parent class loader. Calls to system class loader

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@3039 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 15 years ago
parent
commit
490ec9b49e
  1. 2
      prism/src/prism/SBML2Prism.java
  2. 2
      prism/src/simulator/networking/SimulatorNetworkHandler.java
  3. 2
      prism/src/userinterface/GUIPrism.java
  4. 2
      prism/src/userinterface/GUIPrismSplash.java
  5. 3
      prism/src/userinterface/graph/Graph.java
  6. 2
      prism/src/userinterface/model/computation/LoadGraphicModelThread.java

2
prism/src/prism/SBML2Prism.java

@ -147,7 +147,7 @@ public class SBML2Prism implements EntityResolver
if (systemId.endsWith("dtd")) if (systemId.endsWith("dtd"))
{ {
// get appropriate dtd from classpath // get appropriate dtd from classpath
InputStream inputStream = ClassLoader.getSystemResourceAsStream("dtds/sbml.dtd");
InputStream inputStream = this.getClass().getResourceAsStream("dtds/sbml.dtd");
if (inputStream != null) inputSource = new InputSource(inputStream); if (inputStream != null) inputSource = new InputSource(inputStream);
} }

2
prism/src/simulator/networking/SimulatorNetworkHandler.java

@ -673,7 +673,7 @@ public class SimulatorNetworkHandler extends Observable implements EntityResolve
if (systemId.endsWith("dtd")) if (systemId.endsWith("dtd"))
{ {
// get appropriate dtd from classpath // get appropriate dtd from classpath
InputStream inputStream = ClassLoader.getSystemResourceAsStream("dtds/prismnetwork.dtd");
InputStream inputStream = SimulatorNetworkHandler.class.getClassLoader().getResourceAsStream("dtds/prismnetwork.dtd");
if (inputStream != null) inputSource = new InputSource(inputStream); if (inputStream != null) inputSource = new InputSource(inputStream);
} }

2
prism/src/userinterface/GUIPrism.java

@ -470,7 +470,7 @@ public class GUIPrism extends JFrame
*/ */
public static ImageIcon getIconFromImage(String file) public static ImageIcon getIconFromImage(String file)
{ {
URL url = ClassLoader.getSystemResource("images/" + file);
URL url = GUIPrism.class.getClassLoader().getResource("images/" + file);
if (url == null) if (url == null)
{ {
System.out.println("Warning: Failed to load icon file \"" + file + "\""); System.out.println("Warning: Failed to load icon file \"" + file + "\"");

2
prism/src/userinterface/GUIPrismSplash.java

@ -44,7 +44,7 @@ public class GUIPrismSplash extends Frame
{ {
mt = new MediaTracker(this); mt = new MediaTracker(this);
URL imageURL = ClassLoader.getSystemResource(filename);
URL imageURL = GUIPrismSplash.class.getClassLoader().getResource(filename);
if (imageURL == null) if (imageURL == null)
{ {
System.out.println("Warning: Failed to load icon file \"" + filename + "\""); System.out.println("Warning: Failed to load icon file \"" + filename + "\"");

3
prism/src/userinterface/graph/Graph.java

@ -861,8 +861,7 @@ public class Graph extends ChartPanel implements SettingOwner, EntityResolver, O
// override the resolve method for the dtd // override the resolve method for the dtd
if (systemId.endsWith("dtd")) { if (systemId.endsWith("dtd")) {
// get appropriate dtd from classpath // get appropriate dtd from classpath
InputStream inputStream = ClassLoader
.getSystemResourceAsStream("dtds/chartformat.dtd");
InputStream inputStream = Graph.class.getClassLoader().getResourceAsStream("dtds/chartformat.dtd");
if (inputStream != null) if (inputStream != null)
inputSource = new InputSource(inputStream); inputSource = new InputSource(inputStream);
} }

2
prism/src/userinterface/model/computation/LoadGraphicModelThread.java

@ -658,7 +658,7 @@ public class LoadGraphicModelThread extends Thread implements EntityResolver
// override the resolve method for the dtd // override the resolve method for the dtd
if (systemId.endsWith("dtd")) { if (systemId.endsWith("dtd")) {
// get appropriate dtd from classpath // get appropriate dtd from classpath
InputStream inputStream = ClassLoader.getSystemResourceAsStream("dtds/gmo.dtd");
InputStream inputStream = LoadGraphicModelThread.class.getClassLoader().getResourceAsStream("dtds/gmo.dtd");
if (inputStream != null) inputSource = new InputSource(inputStream); if (inputStream != null) inputSource = new InputSource(inputStream);
} }

Loading…
Cancel
Save