summaryrefslogtreecommitdiff
blob: d94dc66bbac597010392719633a34e0f3fdf8608 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
diff -urN tuprolog-2.9.0.orig/src/alice/tuprolog/LibraryManager.java tuprolog-2.9.0/src/alice/tuprolog/LibraryManager.java
--- tuprolog-2.9.0.orig/src/alice/tuprolog/LibraryManager.java	2014-09-29 18:14:21.000000000 +0200
+++ tuprolog-2.9.0/src/alice/tuprolog/LibraryManager.java	2015-01-11 14:48:57.000000000 +0100
@@ -9,11 +9,11 @@
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.*;
-import cli.System.Reflection.Assembly;
+//import cli.System.Reflection.Assembly;
 
 import alice.tuprolog.event.LibraryEvent;
 import alice.tuprolog.event.WarningEvent;
-import alice.util.AssemblyCustomClassLoader;
+//import alice.util.AssemblyCustomClassLoader;
 
 /**
  * @author Alex Benini
@@ -179,31 +179,7 @@
 				} else
 				// .NET
 				{
-					Assembly asm = null;
-					boolean classFound = false;
-					className = "cli."
-							+ className.substring(0, className.indexOf(","))
-									.trim();
-					for (int i = 0; i < paths.length; i++)
-					{
-						try
-						{
-							asm = Assembly.LoadFrom(paths[i]);
-							loader = new AssemblyCustomClassLoader(asm, urls);
-							lib = (Library) Class.forName(className, true, loader).newInstance();
-							if (lib != null)
-							{
-								classFound = true;
-								break;
-							}
-						} catch (Exception e)
-						{
-							e.printStackTrace();
-							continue;
-						}
-					}
-					if (!classFound)
-						throw new InvalidLibraryException(className, -1, -1);
+					throw new InvalidLibraryException(className, -1, -1);
 				}
 			}
 
@@ -462,4 +438,4 @@
 		return optimizedDirectory;
 	}
 
-}
\ No newline at end of file
+}
diff -urN tuprolog-2.9.0.orig/src/alice/tuprologx/ide/LibraryManager.java tuprolog-2.9.0/src/alice/tuprologx/ide/LibraryManager.java
--- tuprolog-2.9.0.orig/src/alice/tuprologx/ide/LibraryManager.java	2014-09-29 18:14:21.000000000 +0200
+++ tuprolog-2.9.0/src/alice/tuprologx/ide/LibraryManager.java	2015-01-11 14:46:23.000000000 +0100
@@ -18,7 +18,7 @@
 package alice.tuprologx.ide;
 
 import alice.tuprolog.*;
-import alice.util.AssemblyCustomClassLoader;
+//import alice.util.AssemblyCustomClassLoader;
 
 import java.io.File;
 import java.net.URL;
@@ -26,7 +26,7 @@
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.StringTokenizer;
-import cli.System.Reflection.Assembly;
+//import cli.System.Reflection.Assembly;
 
 /**
  * A dynamic manager for tuProlog libraries.
@@ -155,10 +155,7 @@
 	        	// .NET
 	        	if(System.getProperty("java.vm.name").equals("IKVM.NET"))
 	        	{
-	        		Assembly asm = Assembly.LoadFrom(file.getPath());
-	        		loader = new AssemblyCustomClassLoader(asm, new URL[]{url});
-	        		libraryClassname = "cli." + libraryClassname.substring(0, 
-	        				libraryClassname.indexOf(",")).trim();
+	        		throw new InvalidLibraryException(libraryClassname,-1,-1);
 	        	}
 	        	// JVM
 	        	else
diff -urN tuprolog-2.9.0.orig/src/alice/util/AssemblyCustomClassLoader.java tuprolog-2.9.0/src/alice/util/AssemblyCustomClassLoader.java
--- tuprolog-2.9.0.orig/src/alice/util/AssemblyCustomClassLoader.java	2014-09-29 18:14:21.000000000 +0200
+++ tuprolog-2.9.0/src/alice/util/AssemblyCustomClassLoader.java	1970-01-01 01:00:00.000000000 +0100
@@ -1,21 +0,0 @@
-package alice.util;
-
-import java.net.URL;
-
-public class AssemblyCustomClassLoader extends java.net.URLClassLoader
-{
-  public AssemblyCustomClassLoader(cli.System.Reflection.Assembly asm, URL[] urls)
-  {
-    super(new java.net.URL[0], new ikvm.runtime.AssemblyClassLoader(asm));
-    // explicitly calling addURL() is safer than passing it to the super constructor,
-    // because this class loader instance may be used during the URL construction.
-    for (URL url : urls) {
-    	addURL(url);
-	}    
-  }
-  
-  public void addUrl(URL url)
-  {
-	  addURL(url);
-  }
-}
\ No newline at end of file