[Jython-checkins] jython: Avoid some deprecation warnings. Remaining ones should still nag us.
jeff.allen
jython-checkins at python.org
Sat May 4 12:26:00 EDT 2019
https://hg.python.org/jython/rev/87a5f7e8245b
changeset: 8242:87a5f7e8245b
user: Jeff Allen <ja.py at farowl.co.uk>
date: Sat May 04 16:25:47 2019 +0100
summary:
Avoid some deprecation warnings. Remaining ones should still nag us.
files:
src/org/python/core/PyObject.java | 4 +---
src/org/python/core/imp.java | 2 +-
src/org/python/modules/_py_compile.java | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/org/python/core/PyObject.java b/src/org/python/core/PyObject.java
--- a/src/org/python/core/PyObject.java
+++ b/src/org/python/core/PyObject.java
@@ -123,19 +123,17 @@
}
/**
- * <p>
* From Jython 2.7 on, {@code PyObject}s must not have finalizers directly. If a finalizer,
* a.k.a. {@code __del__} is needed, follow the instructions in the documentation of
* {@link org.python.core.finalization.FinalizablePyObject}.
- * </p>
* <p>
* Note that this empty finalizer implementation is optimized away by the JVM. (See <a
* href=http://www.javaspecialists.eu/archive/Issue170.html}>Discovering Objects with
* Non-trivial Finalizers</a>). So {@code PyObject}s are not expensively treated as finalizable
* objects by the Java-GC. Its single intention is to prevent subclasses from having Java-style
* finalizers.
- * </p>
*/
+ @SuppressWarnings("deprecation") // See the Javadoc
@Override
protected final void finalize() throws Throwable {}
diff --git a/src/org/python/core/imp.java b/src/org/python/core/imp.java
--- a/src/org/python/core/imp.java
+++ b/src/org/python/core/imp.java
@@ -441,7 +441,7 @@
* @param sourceFilename explicit source file name (or {@code null} to use that in source)
* @param compiledFilename ignored (huh?)
* @return Java byte code as array
- * @deprecated Use {@link #compileSource(String, File, String, String)} instead.
+ * @deprecated Use {@link #compileSource(String, File, String)} instead.
*/
@Deprecated
public static byte[] compileSource(String name, File source, String sourceFilename,
diff --git a/src/org/python/modules/_py_compile.java b/src/org/python/modules/_py_compile.java
--- a/src/org/python/modules/_py_compile.java
+++ b/src/org/python/modules/_py_compile.java
@@ -34,7 +34,7 @@
// Convert file in which to put the byte code and display name (each may be null)
String c = (compiledName == null) ? null : sys.getPath(Py.fileSystemDecode(compiledName));
String d = (displayName == null) ? null : Py.fileSystemDecode(displayName);
- byte[] bytes = org.python.core.imp.compileSource(getModuleName(f), f, d, c);
+ byte[] bytes = org.python.core.imp.compileSource(getModuleName(f), f, d);
org.python.core.imp.cacheCompiledSource(file, c, bytes);
return bytes.length > 0;
}
--
Repository URL: https://hg.python.org/jython
More information about the Jython-checkins
mailing list