harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r618259 - /harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/AppletInfo.java
Date Mon, 04 Feb 2008 12:49:42 GMT
Author: apetrenko
Date: Mon Feb  4 04:49:41 2008
New Revision: 618259

URL: http://svn.apache.org/viewvc?rev=618259&view=rev
Log:
Patch for HARMONY-5450 "[jdktools][appletviewer] appletviewer throws 
java.lang.ClassNotFoundException while applet class placed in jar 
archive"

Modified:
    harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/AppletInfo.java

Modified: harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/AppletInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/AppletInfo.java?rev=618259&r1=618258&r2=618259&view=diff
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/AppletInfo.java
(original)
+++ harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/AppletInfo.java
Mon Feb  4 04:49:41 2008
@@ -30,6 +30,7 @@
     private URL documentBase;
     private URL codeBase;
     private URL archive;
+    private String archiveStr;
     private String code;
     private String tagName;
     private int width;
@@ -62,6 +63,12 @@
     }
 
     public URL getArchive() {
+        if (archive == null && archiveStr != null) {
+            try {
+                archive = new URL(getCodeBase(), archiveStr);
+            } catch (MalformedURLException _) {                
+            }
+        }
         return archive;
     }
 
@@ -69,8 +76,8 @@
         this.archive = archive;
     }
 
-    public void setArchive(String archive) throws MalformedURLException {
-        this.archive = (archive == null)?null:new URL(this.documentBase, archive);
+    public void setArchive(String archive) {
+        this.archiveStr = archive;
     }
 
     public String getParameter(String name) {
@@ -123,10 +130,10 @@
     }
     
     public URL []getClassLoaderURLs() {
-    	URL []res = (archive == null)?new URL[1]:new URL[2];
+    	URL []res = (archive == null && archiveStr == null)?new URL[1]:new URL[2];
     	switch (res.length) {
-    		case 2: res[1] = archive;
-    		case 1: res[0] = codeBase;
+    		case 2: res[1] = getArchive();
+    		case 1: res[0] = getCodeBase();
     	}
     	return res;
     }



Mime
View raw message