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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
From: Markus Koschany <apo@debian.org>
Date: Fri, 25 May 2018 13:32:45 +0200
Subject: no Jython support
Jython is optional at runtime but required at build time. Disable it because we
don't want to support it.
Bug-Debian: https://bugs.debian.org/884536
---
.../batik/script/jpython/JPythonInterpreter.java | 105 ---------------------
.../script/jpython/JPythonInterpreterFactory.java | 4 +-
2 files changed, 2 insertions(+), 107 deletions(-)
delete mode 100644 batik-script/src/main/java/org/apache/batik/script/jpython/JPythonInterpreter.java
diff --git a/batik-script/src/main/java/org/apache/batik/script/jpython/JPythonInterpreter.java b/batik-script/src/main/java/org/apache/batik/script/jpython/JPythonInterpreter.java
deleted file mode 100644
index 7065386..0000000
--- a/batik-script/src/main/java/org/apache/batik/script/jpython/JPythonInterpreter.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-package org.apache.batik.script.jpython;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.Locale;
-
-import org.apache.batik.script.InterpreterException;
-import org.python.util.PythonInterpreter;
-
-/**
- * A simple implementation of <code>Interpreter</code> interface to use
- * JPython python parser.
- * @author <a href="mailto:cjolif@ilog.fr">Christophe Jolif</a>
- * @version $Id: JPythonInterpreter.java 1733416 2016-03-03 07:07:13Z gadams $
- */
-public class JPythonInterpreter implements org.apache.batik.script.Interpreter {
- private PythonInterpreter interpreter = null;
-
- public JPythonInterpreter() {
- interpreter = new PythonInterpreter();
- }
-
- // org.apache.batik.script.Intepreter implementation
-
- /**
- * Returns the content types of the scripting languages this interpreter
- * handles.
- */
- public String[] getMimeTypes() {
- return JPythonInterpreterFactory.JPYTHON_MIMETYPES;
- }
-
- public Object evaluate(Reader scriptreader)
- throws IOException {
- return evaluate(scriptreader, "");
- }
-
- public Object evaluate(Reader scriptreader, String description)
- throws IOException {
-
- // oups jpython doesn't accept reader in its eval method :-(
- StringBuffer sbuffer = new StringBuffer();
- char[] buffer = new char[1024];
- int val = 0;
- while ((val = scriptreader.read(buffer)) != -1) {
- sbuffer.append(buffer,0, val);
- }
- String str = sbuffer.toString();
- return evaluate(str);
- }
-
- public Object evaluate(String script) {
- try {
- interpreter.exec(script);
- } catch (org.python.core.PyException e) {
- throw new InterpreterException(e, e.getMessage(), -1, -1);
- } catch (RuntimeException re) {
- throw new InterpreterException(re, re.getMessage(), -1, -1);
- }
- return null;
- }
-
- public void dispose() {
- }
-
- public void bindObject(String name, Object object) {
- interpreter.set(name, object);
- }
-
- public void setOut(Writer out) {
- interpreter.setOut(out);
- }
-
- // org.apache.batik.i18n.Localizable implementation
-
- public Locale getLocale() {
- return null;
- }
-
- public void setLocale(Locale locale) {
- }
-
- public String formatMessage(String key, Object[] args) {
- return null;
- }
-}
diff --git a/batik-script/src/main/java/org/apache/batik/script/jpython/JPythonInterpreterFactory.java b/batik-script/src/main/java/org/apache/batik/script/jpython/JPythonInterpreterFactory.java
index 3004921..a80c7a8 100644
--- a/batik-script/src/main/java/org/apache/batik/script/jpython/JPythonInterpreterFactory.java
+++ b/batik-script/src/main/java/org/apache/batik/script/jpython/JPythonInterpreterFactory.java
@@ -56,7 +56,7 @@ public class JPythonInterpreterFactory implements InterpreterFactory {
* @param svg12 whether the document is an SVG 1.2 document
*/
public Interpreter createInterpreter(URL documentURL, boolean svg12) {
- return new JPythonInterpreter();
+ return null;
}
/**
@@ -69,6 +69,6 @@ public class JPythonInterpreterFactory implements InterpreterFactory {
*/
public Interpreter createInterpreter(URL documentURL, boolean svg12,
ImportInfo imports) {
- return new JPythonInterpreter();
+ return null;
}
}
|