From: Frank W. <fwi...@us...> - 2005-07-31 01:05:19
|
Update of /cvsroot/jython/jython/org/python/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25377 Modified Files: CachedJarsPackageManager.java CollectionProxy2.java JavaAccessibility.java PackageManager.java PyJavaClass.java PyLong.java PySystemState.java SyspathArchive.java Log Message: Removed some jdk 1.1 specific workarounds, since jdk 1.1 is no longer supported. Index: CachedJarsPackageManager.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/CachedJarsPackageManager.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CachedJarsPackageManager.java 3 Jun 2005 03:23:14 -0000 1.12 --- CachedJarsPackageManager.java 31 Jul 2005 01:05:09 -0000 1.13 *************** *** 204,208 **** if(jarconn.getURL().getProtocol().equals("file")) { // ??pending: need to use java2 URLDecoder.decode? - // but under 1.1 this is absent and should be simulated. String jarfilename = jarurl.getFile(); jarfilename = jarfilename.replace('/',File.separatorChar); --- 204,207 ---- Index: CollectionProxy2.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/CollectionProxy2.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -d -r2.4 -r2.5 *** CollectionProxy2.java 28 Oct 2001 17:13:42 -0000 2.4 --- CollectionProxy2.java 31 Jul 2005 01:05:09 -0000 2.5 *************** *** 2,8 **** /* Support for java-1.2 collections ! This will only compile with jdk-1.2 or later. ! The rest of JPython works just fine with out it, so feel free to ! just leave this uncompiled if you're using jdk-1.1. */ --- 2,7 ---- /* Support for java-1.2 collections ! * XXX: Is this used? Or does the new collections integration ! * (starting at 2.2a1) make it obsolete? */ Index: JavaAccessibility.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/JavaAccessibility.java,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -d -r2.4 -r2.5 *** JavaAccessibility.java 25 Feb 2001 16:39:28 -0000 2.4 --- JavaAccessibility.java 31 Jul 2005 01:05:09 -0000 2.5 *************** *** 4,13 **** /** * Provides a means of using the Java 2 ! * {Field|Method|Constructor}.setAccessibility() methods that can be ! * compiled with Java 1 or Java 2. * ! * When compiling with Java 2, Java2Accessibility.java must also be ! * compiled. If compiled Java 1, or if the Java2Accessibility class cannot ! * be found, then the methods here have no effect. */ --- 4,11 ---- /** * Provides a means of using the Java 2 ! * {Field|Method|Constructor}.setAccessibility() methods. * ! * This class was formerly necessary for Java 1 compattibility. ! * In the future, this class may be removed. */ *************** *** 17,33 **** static void initialize() { ! // If we can find it, and the registry option // python.security.respectJavaAccessibility is set, then we set the // access object to an instance of the subclass Java2Accessibility if (Options.respectJavaAccessibility) return; ! try { ! Class c = Class.forName("org.python.core.Java2Accessibility"); ! Class.forName("java.lang.reflect.AccessibleObject"); ! access = (JavaAccessibility)c.newInstance(); ! } ! catch (InstantiationException e) {} ! catch (IllegalAccessException e) {} ! catch (ClassNotFoundException e) {} } --- 15,24 ---- static void initialize() { ! // If registry option // python.security.respectJavaAccessibility is set, then we set the // access object to an instance of the subclass Java2Accessibility if (Options.respectJavaAccessibility) return; ! access = new Java2Accessibility(); } Index: PackageManager.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PackageManager.java,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -d -r2.13 -r2.14 *** PackageManager.java 3 Jun 2005 04:19:26 -0000 2.13 --- PackageManager.java 31 Jul 2005 01:05:09 -0000 2.14 *************** *** 188,195 **** //System.out.println("utf: "+istream.readUTF()+";"); int slength = istream.readUnsignedShort(); - while (slength > MAXSKIP) { // workaround to java1.1 bug - istream.skipBytes(MAXSKIP); - slength -= MAXSKIP; - } istream.skipBytes(slength); break; --- 188,191 ---- Index: PyJavaClass.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyJavaClass.java,v retrieving revision 2.44 retrieving revision 2.45 diff -C2 -d -r2.44 -r2.45 *** PyJavaClass.java 24 Jun 2005 00:40:08 -0000 2.44 --- PyJavaClass.java 31 Jul 2005 01:05:09 -0000 2.45 *************** *** 252,256 **** /** * Return the list of all accessible fields for a class. This will ! * only the public fields unless Options.respectJavaAccessibility is * false, in which case all fields are returned. */ --- 252,256 ---- /** * Return the list of all accessible fields for a class. This will ! * only be the public fields unless Options.respectJavaAccessibility is * false, in which case all fields are returned. */ *************** *** 259,268 **** // returns just the public fields return c.getFields(); ! // from here on out we know we must be using at least Java 1.2. ! // Note that an ArrayList would be better here because we don't ! // need access to be synchronized, but that would prevent this file ! // from being compiled on Java 1.1 (as opposed to being compilable, ! // but not having the feature available). ! java.util.Vector fields = new java.util.Vector(); while (c != null) { // get all declared fields for this class, mutate their --- 259,263 ---- // returns just the public fields return c.getFields(); ! java.util.ArrayList fields = new java.util.ArrayList(); while (c != null) { // get all declared fields for this class, mutate their *************** *** 273,277 **** // way to restore the original accessibility flag? JavaAccessibility.setAccessible(declared[i], true); ! fields.addElement(declared[i]); } // walk down superclass chain. no need to deal specially with --- 268,272 ---- // way to restore the original accessibility flag? JavaAccessibility.setAccessible(declared[i], true); ! fields.add(declared[i]); } // walk down superclass chain. no need to deal specially with *************** *** 281,285 **** // return (Field[])fields.toArray(new Field[fields.size()]); Field[] ret = new Field[fields.size()]; ! fields.copyInto(ret); return ret; } --- 276,280 ---- // return (Field[])fields.toArray(new Field[fields.size()]); Field[] ret = new Field[fields.size()]; ! ret = (Field[])fields.toArray(ret); return ret; } Index: PyLong.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyLong.java,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -d -r2.27 -r2.28 *** PyLong.java 24 Jul 2005 17:42:12 -0000 2.27 --- PyLong.java 31 Jul 2005 01:05:09 -0000 2.28 *************** *** 1637,1640 **** --- 1637,1641 ---- //return __pow__(right).__mod__(modulo); } else { + // XXX: 1.1 no longer supported so review this. // This is buggy in SUN's jdk1.1.5 // Extra __mod__ improves things slightly Index: PySystemState.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PySystemState.java,v retrieving revision 2.88 retrieving revision 2.89 diff -C2 -d -r2.88 -r2.89 *** PySystemState.java 4 Jul 2005 20:31:38 -0000 2.88 --- PySystemState.java 31 Jul 2005 01:05:09 -0000 2.89 *************** *** 287,292 **** version = version.substring(3, version.length()); } - if (version.equals("11")) - version = "1.1"; if (version.equals("12")) version = "1.2"; --- 287,290 ---- Index: SyspathArchive.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/SyspathArchive.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SyspathArchive.java 24 Jun 2005 01:10:25 -0000 1.5 --- SyspathArchive.java 31 Jul 2005 01:05:09 -0000 1.6 *************** *** 67,70 **** --- 67,72 ---- // EOFException("Unexpected end of ZLIB input stream"), not a // -1 return value. + // XXX: Since 1.1 is no longer supported, we should review the usefulness + // of this workaround. // As a workaround we read the file fully here, but only getSize() // bytes. |