Revision: 20519 http://sourceforge.net/p/jmol/code/20519 Author: hansonr Date: 2015-05-26 04:46:49 +0000 (Tue, 26 May 2015) Log Message: -----------
Modified Paths: -------------- branches/v14_2/Jmol/srcjs/java/net/URL.java branches/v14_2/Jmol/srcjs/java/util/Arrays.js branches/v14_2/Jmol/srcjs/java/util/Collections.js branches/v14_2/Jmol/srcjs/java/util/Random.js branches/v14_2/Jmol/srcjs/js/package.js Added Paths: ----------- branches/v14_2/Jmol/srcjs/java/net/UnknownServiceException.java Removed Paths: ------------- branches/v14_2/Jmol/srcjs/java/lang/Throwable.js Deleted: branches/v14_2/Jmol/srcjs/java/lang/Throwable.js =================================================================== --- branches/v14_2/Jmol/srcjs/java/lang/Throwable.js 2015-05-26 04:45:41 UTC (rev 20518) +++ branches/v14_2/Jmol/srcjs/java/lang/Throwable.js 2015-05-26 04:46:49 UTC (rev 20519) @@ -1,144 +0,0 @@ -// BH added check for annoying NullPointerException to show stack trace during file checking - -c$=Clazz.decorateAsClass(function(){ -this.detailMessage=null; -this.cause=null; -this.stackTrace=null; -Clazz.instantialize(this,arguments); -},java.lang,"Throwable",null,java.io.Serializable); -Clazz.prepareFields(c$,function(){ -this.cause=this; -}); -Clazz.makeConstructor(c$, -function(){ -if(Clazz._checkFiles && this.__CLASS_NAME__ == "java.lang.NullPointerException") - System.out.println(Clazz.getStackTrace()); -this.fillInStackTrace(); -}); -Clazz.makeConstructor(c$, -function(message){ -this.fillInStackTrace(); -this.detailMessage=message; -},"~S"); -Clazz.makeConstructor(c$, -function(message,cause){ -this.fillInStackTrace(); -this.detailMessage=message; -this.cause=cause; -},"~S,Throwable"); -Clazz.makeConstructor(c$, -function(cause){ -this.fillInStackTrace(); -this.detailMessage=(cause==null?null:cause.toString()); -this.cause=cause; -},"Throwable"); -Clazz.defineMethod(c$,"getMessage", -function(){ -{ -if(typeof this.message!="undefined"){ -return this.message; -} -}return this.detailMessage; -}); -Clazz.defineMethod(c$,"getLocalizedMessage", -function(){ -return this.getMessage(); -}); -Clazz.defineMethod(c$,"getCause", -function(){ -return(this.cause===this?null:this.cause); -}); -Clazz.defineMethod(c$,"initCause", -function(cause){ -if(this.cause!==this)throw new IllegalStateException("Can't overwrite cause"); -if(cause===this)throw new IllegalArgumentException("Self-causation not permitted"); -this.cause=cause; -return this; -},"Throwable"); -Clazz.overrideMethod(c$,"toString", -function(){ -var s=this.getClass().getName(); -var message=this.getLocalizedMessage(); -return(message!=null)?(s+": "+message):s; -}); -Clazz.defineMethod(c$,"printStackTrace", -function(){ -System.err.println(this); -for(var i=0;i<this.stackTrace.length;i++){ -var t=this.stackTrace[i]; -var x=t.methodName.indexOf("("); -var n=t.methodName.substring(0,x).replace(/\s+/g,""); -if(n!="construct"||t.nativeClazz==null -||Clazz.getInheritedLevel(t.nativeClazz,Throwable)<0){ -System.err.println(t); -} -} -}); -Clazz.defineMethod(c$,"printStackTrace", -function(s){ -this.printStackTrace(); -},"java.io.PrintStream"); -Clazz.defineMethod(c$,"printStackTrace", -function(s){ -this.printStackTrace(); -},"java.io.PrintWriter"); -Clazz.defineMethod(c$,"fillInStackTrace", -function(){ -this.stackTrace=new Array(); -var caller=arguments.callee.caller; -var superCaller=null; -var callerList=new Array(); -var index=Clazz.callingStackTraces.length-1; -var noLooping=true; -while(index>-1||caller!=null){ -var clazzName=null; -var nativeClazz=null; -if(!noLooping||caller==Clazz.tryToSearchAndExecute||caller==Clazz.superCall||caller==null){ -if(index<0){ -break; -} -noLooping=true; -superCaller=Clazz.callingStackTraces[index].caller; -nativeClazz=Clazz.callingStackTraces[index].owner; -index--; -}else{ -superCaller=caller; -if(superCaller.claxxOwner!=null){ -nativeClazz=superCaller.claxxOwner; -}else if(superCaller.exClazz!=null){ -nativeClazz=superCaller.exClazz; -} -} -var st=new StackTraceElement( -((nativeClazz!=null&&nativeClazz.__CLASS_NAME__.length!=0)? -nativeClazz.__CLASS_NAME__:"anonymous"), -((superCaller.exName==null)?"anonymous":superCaller.exName) -+" ("+Clazz.getParamsType(superCaller.arguments)+")", -null,-1); -st.nativeClazz=nativeClazz; -this.stackTrace[this.stackTrace.length]=st; -for(var i=0;i<callerList.length;i++){ -if(callerList[i]==superCaller){ - -var st=new StackTraceElement("lost","missing",null,-3); -st.nativeClazz=null; -this.stackTrace[this.stackTrace.length]=st; -noLooping=false; - -} -} -if(superCaller!=null){ -callerList[callerList.length]=superCaller; -} -caller=superCaller.arguments.callee.caller; -} -Clazz.initializingException=false; -return this; -}); -Clazz.defineMethod(c$,"setStackTrace", -function(stackTrace){ -var defensiveCopy=stackTrace.clone(); -for(var i=0;i<defensiveCopy.length;i++)if(defensiveCopy[i]==null)throw new NullPointerException("stackTrace["+i+"]"); - -this.stackTrace=defensiveCopy; -},"~A"); Modified: branches/v14_2/Jmol/srcjs/java/net/URL.java =================================================================== --- branches/v14_2/Jmol/srcjs/java/net/URL.java 2015-05-26 04:45:41 UTC (rev 20518) +++ branches/v14_2/Jmol/srcjs/java/net/URL.java 2015-05-26 04:46:49 UTC (rev 20519) @@ -503,15 +503,38 @@ public URL(URL context, String spec, URLStreamHandler handler) throws MalformedURLException { +// public URL(String spec) +// public URL(URL context, String spec) +// public URL(URL context, String spec, URLStreamHandler handler) +// +// public URL(String protocol, String host, String file) +// public URL(String protocol, String host, int port, String file) +// public URL(String protocol, String host, int port, String file, URLStreamHandler handler) + /** + * key is that we want to have only one constructor + * + * subtle J2S bug here in that passing (URL)null does not actually pass a value that == null + * * @j2sNative * - * if (arguments.length == 1) { + * switch (arguments.length) { + * case 1: * spec = context;context = handler = null; + * break; + * case 2: + * handler = null; + * break; + * case 3: + * if (context == null || Clazz.instanceOf(context, java.net.URL)) + * break; + * default: + * alert("java.net.URL constructor format not supported"); + * break; * } + * * context && context.valueOf && context.valueOf() == null && (context = null); * - * */ {} String original = spec; @@ -521,13 +544,13 @@ boolean aRef=false; boolean isRelative = false; - // Check for permission to specify a handler - if (handler != null) { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - checkSpecifyHandler(sm); - } - } +// // Check for permission to specify a handler +// if (handler != null) { +// SecurityManager sm = System.getSecurityManager(); +// if (sm != null) { +// checkSpecifyHandler(sm); +// } +// } try { limit = spec.length(); Added: branches/v14_2/Jmol/srcjs/java/net/UnknownServiceException.java =================================================================== --- branches/v14_2/Jmol/srcjs/java/net/UnknownServiceException.java (rev 0) +++ branches/v14_2/Jmol/srcjs/java/net/UnknownServiceException.java 2015-05-26 04:46:49 UTC (rev 20519) @@ -0,0 +1,56 @@ +/* + * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.net; + +import java.io.IOException; + +/** + * Thrown to indicate that an unknown service exception has + * occurred. Either the MIME type returned by a URL connection does + * not make sense, or the application is attempting to write to a + * read-only URL connection. + * + * @author unascribed + * @since JDK1.0 + */ +public class UnknownServiceException extends IOException { + /** + * Constructs a new <code>UnknownServiceException</code> with no + * detail message. + */ + public UnknownServiceException() { + } + + /** + * Constructs a new <code>UnknownServiceException</code> with the + * specified detail message. + * + * @param msg the detail message. + */ + public UnknownServiceException(String msg) { + super(msg); + } +} Property changes on: branches/v14_2/Jmol/srcjs/java/net/UnknownServiceException.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Modified: branches/v14_2/Jmol/srcjs/java/util/Arrays.js =================================================================== --- branches/v14_2/Jmol/srcjs/java/util/Arrays.js 2015-05-26 04:45:41 UTC (rev 20518) +++ branches/v14_2/Jmol/srcjs/java/util/Arrays.js 2015-05-26 04:46:49 UTC (rev 20519) @@ -1,8 +1,23 @@ // BH adjusted to have only one sort method. +// BH -- added Java 6 copyOfRange Clazz.load(["java.util.AbstractList","$.RandomAccess"],"java.util.Arrays",["java.lang.ArrayIndexOutOfBoundsException","$.IllegalArgumentException","$.NullPointerException"],function(){ c$=Clazz.declareType(java.util,"Arrays"); +c$.copyOfRange = Clazz.defineMethod (c$, "copyOfRange", +function (original, from, to) { +to = Math.min(original.length, to); +var newLength = to - from; +if (newLength < 0) throw new IllegalArgumentException (from + " > " + to); +if (original.slice) + return original.slice(from, to); + // MSIE and Chrome do not have Int32Array.slice() +var c = Clazz.newIntArray(newLength, 0); +for (var i = 0; i < newLength; i++) + c[i] = original[from++]; +return c; +}, "~A,~N,~N"); + c$.sort=Clazz.overrideMethod(c$,"sort", function(a,c,d,e){ switch (arguments.length) { @@ -147,7 +162,7 @@ c$.asList=Clazz.defineMethod(c$,"asList", function(a){ -return new java.util.Arrays.ArrayList(a); +return new java.util.Arrays.ArrayList(arguments.length == 1 && Clazz.getClassName(a) == "Array" ? a : arguments); // BH must be T... },"~A"); Clazz.pu$h(); c$=Clazz.decorateAsClass(function(){ Modified: branches/v14_2/Jmol/srcjs/java/util/Collections.js =================================================================== --- branches/v14_2/Jmol/srcjs/java/util/Collections.js 2015-05-26 04:45:41 UTC (rev 20518) +++ branches/v14_2/Jmol/srcjs/java/util/Collections.js 2015-05-26 04:46:49 UTC (rev 20519) @@ -1,3 +1,5 @@ +//BH note: a declared static superclass must come before a static class referencing it + Clazz.load(["java.util.AbstractList","$.AbstractMap","$.AbstractSet","$.Collection","$.Iterator","$.List","$.ListIterator","$.Map","$.RandomAccess","$.Set","$.SortedMap","$.SortedSet","java.lang.NullPointerException","$.UnsupportedOperationException","java.lang.reflect.Array"],"java.util.Collections",["java.lang.ArrayIndexOutOfBoundsException","$.ClassCastException","$.IllegalArgumentException","$.IndexOutOfBoundsException","java.util.ArrayList","$.Arrays","$.Enumeration","java.util.Map.Entry","java.util.NoSuchElementException","$.Random"],function(){ c$=Clazz.declareType(java.util,"Collections"); c$.binarySearch=Clazz.defineMethod(c$,"binarySearch", @@ -924,15 +926,9 @@ return this.c.toArray(a); }},"~A"); c$=Clazz.p0p(); + + Clazz.pu$h(self.c$); -c$=Clazz.declareType(java.util.Collections,"SynchronizedRandomAccessList",java.util.Collections.SynchronizedList,java.util.RandomAccess); -Clazz.overrideMethod(c$,"subList", -function(a,b){ -{ -return new java.util.Collections.SynchronizedRandomAccessList(this.list.subList(a,b),this.mutex); -}},"~N,~N"); -c$=Clazz.p0p(); -Clazz.pu$h(self.c$); c$=Clazz.decorateAsClass(function(){ this.list=null; Clazz.instantialize(this,arguments); @@ -1009,7 +1005,22 @@ return new java.util.Collections.SynchronizedList(this.list.subList(a,b),this.mutex); }},"~N,~N"); c$=Clazz.p0p(); + + + Clazz.pu$h(self.c$); +c$=Clazz.declareType(java.util.Collections,"SynchronizedRandomAccessList",java.util.Collections.SynchronizedList,java.util.RandomAccess); +Clazz.overrideMethod(c$,"subList", +function(a,b){ +{ +return new java.util.Collections.SynchronizedRandomAccessList(this.list.subList(a,b),this.mutex); +}},"~N,~N"); +c$=Clazz.p0p(); + + + + +Clazz.pu$h(self.c$); c$=Clazz.decorateAsClass(function(){ this.m=null; this.mutex=null; @@ -1296,14 +1307,10 @@ c$=Clazz.p0p(); }; c$=Clazz.p0p(); + +//BH note: a declared static superclass must come before a static class referencing it + Clazz.pu$h(self.c$); -c$=Clazz.declareType(java.util.Collections,"UnmodifiableRandomAccessList",java.util.Collections.UnmodifiableList,java.util.RandomAccess); -Clazz.overrideMethod(c$,"subList", -function(a,b){ -return new java.util.Collections.UnmodifiableRandomAccessList(this.list.subList(a,b)); -},"~N,~N"); -c$=Clazz.p0p(); -Clazz.pu$h(self.c$); c$=Clazz.decorateAsClass(function(){ this.list=null; Clazz.instantialize(this,arguments); @@ -1411,7 +1418,33 @@ c$=Clazz.p0p(); }; c$=Clazz.p0p(); + + + + Clazz.pu$h(self.c$); +c$=Clazz.declareType(java.util.Collections,"UnmodifiableRandomAccessList",java.util.Collections.UnmodifiableList,java.util.RandomAccess); +Clazz.overrideMethod(c$,"subList", +function(a,b){ +return new java.util.Collections.UnmodifiableRandomAccessList(this.list.subList(a,b)); +},"~N,~N"); +c$=Clazz.p0p(); + + +Clazz.pu$h(self.c$); +c$=Clazz.declareType(java.util.Collections,"UnmodifiableSet",java.util.Collections.UnmodifiableCollection,java.util.Set); +Clazz.overrideMethod(c$,"equals", +function(a){ +return this.c.equals(a); +},"~O"); +Clazz.overrideMethod(c$,"hashCode", +function(){ +return this.c.hashCode(); +}); +c$=Clazz.p0p(); + + +Clazz.pu$h(self.c$); c$=Clazz.decorateAsClass(function(){ this.m=null; Clazz.instantialize(this,arguments); @@ -1480,6 +1513,13 @@ function(){ return this.m.toString(); }); + + + + + + + Clazz.pu$h(self.c$); c$=Clazz.declareType(java.util.Collections.UnmodifiableMap,"UnmodifiableEntrySet",java.util.Collections.UnmodifiableSet); Clazz.overrideMethod(c$,"iterator", @@ -1571,18 +1611,10 @@ c$=Clazz.p0p(); c$=Clazz.p0p(); c$=Clazz.p0p(); + + + Clazz.pu$h(self.c$); -c$=Clazz.declareType(java.util.Collections,"UnmodifiableSet",java.util.Collections.UnmodifiableCollection,java.util.Set); -Clazz.overrideMethod(c$,"equals", -function(a){ -return this.c.equals(a); -},"~O"); -Clazz.overrideMethod(c$,"hashCode", -function(){ -return this.c.hashCode(); -}); -c$=Clazz.p0p(); -Clazz.pu$h(self.c$); c$=Clazz.decorateAsClass(function(){ this.sm=null; Clazz.instantialize(this,arguments); Modified: branches/v14_2/Jmol/srcjs/java/util/Random.js =================================================================== --- branches/v14_2/Jmol/srcjs/java/util/Random.js 2015-05-26 04:45:41 UTC (rev 20518) +++ branches/v14_2/Jmol/srcjs/java/util/Random.js 2015-05-26 04:46:49 UTC (rev 20519) @@ -61,6 +61,10 @@ Clazz.defineMethod(c$,"nextInt", function(n){ if(n>0){ +n = Math.min(n, 31); +return Math.floor((2 << (n - 1)) * Math.random()) + +/* if((n&-n)==n){ return((n*this.next(31))>>31); }var bits; @@ -69,8 +73,13 @@ bits=this.next(31); val=bits%n; }while(bits-val+(n-1)<0); + + return val; -}throw new IllegalArgumentException(); + +*/ +} +throw new IllegalArgumentException(); },"~N"); Clazz.defineMethod(c$,"nextLong", function(){ Modified: branches/v14_2/Jmol/srcjs/js/package.js =================================================================== --- branches/v14_2/Jmol/srcjs/js/package.js 2015-05-26 04:45:41 UTC (rev 20518) +++ branches/v14_2/Jmol/srcjs/js/package.js 2015-05-26 04:46:49 UTC (rev 20519) @@ -143,7 +143,7 @@ "J.adapter.readers.pdb.PdbReader", "J.adapter.smarter.Structure", "J.api.JmolBioResolver", - "JMB.Resolver", + "JM.Resolver", "$.BioModel" ]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits