Przeglądaj źródła

fix #2571 remove depreated

Shinsuke Sugaya 4 lat temu
rodzic
commit
5819374a2a

+ 0 - 10
src/main/java/org/codelibs/fess/crawler/transformer/FessTransformer.java

@@ -136,11 +136,6 @@ public interface FessTransformer {
         }
     }
 
-    @Deprecated
-    default void putResultDataWithTemplate(final Map<String, Object> dataMap, final String key, final Object value, final String template) {
-        putResultDataWithTemplate(dataMap, key, value, template, Constants.DEFAULT_SCRIPT);
-    }
-
     default void putResultDataWithTemplate(final Map<String, Object> dataMap, final String key, final Object value, final String template,
             final String scriptType) {
         Object target = value;
@@ -158,11 +153,6 @@ public interface FessTransformer {
         }
     }
 
-    @Deprecated
-    default Object evaluateValue(String template, final Map<String, Object> paramMap) {
-        return evaluateValue(Constants.DEFAULT_SCRIPT, template, paramMap);
-    }
-
     default Object evaluateValue(final String scriptType, String template, final Map<String, Object> paramMap) {
         if (StringUtil.isEmpty(template)) {
             return StringUtil.EMPTY;

+ 0 - 5
src/main/java/org/codelibs/fess/ds/AbstractDataStore.java

@@ -120,11 +120,6 @@ public abstract class AbstractDataStore implements DataStore {
 
     }
 
-    @Deprecated
-    protected Object convertValue(final String template, final Map<String, Object> paramMap) {
-        return convertValue(ComponentUtil.getFessConfig().getCrawlerDefaultScript(), template, paramMap);
-    }
-
     protected Object convertValue(final String scriptType, final String template, final Map<String, Object> paramMap) {
         if (StringUtil.isEmpty(template)) {
             return StringUtil.EMPTY;

+ 0 - 10
src/main/java/org/codelibs/fess/helper/ViewHelper.java

@@ -312,11 +312,6 @@ public class ViewHelper {
         }).orElse(new HighlightInfo());
     }
 
-    @Deprecated
-    protected void updateHighlisthInfo(final HighlightInfo highlightInfo, final int width) {
-        updateHighlightInfo(highlightInfo, width);
-    }
-
     protected void updateHighlightInfo(final HighlightInfo highlightInfo, final int width) {
         if (width < TABLET_WIDTH) {
             float ratio = ((float) width) / ((float) TABLET_WIDTH);
@@ -479,11 +474,6 @@ public class ViewHelper {
         return url;
     }
 
-    @Deprecated
-    protected String appendPDFSearchWord(final String url) {
-        return appendPDFSearchWord(null, url);
-    }
-
     protected String appendPDFSearchWord(final Map<String, Object> document, final String url) {
         final String queries = (String) LaRequestUtil.getRequest().getAttribute(Constants.REQUEST_QUERIES);
         if (queries != null) {

+ 0 - 5
src/main/java/org/codelibs/fess/job/JobExecutor.java

@@ -20,11 +20,6 @@ import org.codelibs.fess.Constants;
 public abstract class JobExecutor {
     protected ShutdownListener shutdownListener;
 
-    @Deprecated
-    public Object execute(String script) {
-        return execute(Constants.DEFAULT_SCRIPT, script);
-    }
-
     public abstract Object execute(String scriptType, String script);
 
     public void shutdown() {

+ 0 - 35
src/main/java/org/codelibs/fess/job/impl/GroovyExecutor.java

@@ -1,35 +0,0 @@
-/*
- * Copyright 2012-2021 CodeLibs Project and the Others.
- *
- * Licensed 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.codelibs.fess.job.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.codelibs.fess.job.JobExecutor;
-import org.codelibs.fess.util.ComponentUtil;
-
-@Deprecated
-public class GroovyExecutor extends JobExecutor {
-
-    @Override
-    public Object execute(final String scriptType, final String script) {
-        final Map<String, Object> params = new HashMap<>();
-        params.put("executor", this);
-
-        return ComponentUtil.getScriptEngineFactory().getScriptEngine(scriptType).evaluate(script, params);
-    }
-
-}

+ 0 - 32
src/main/java/org/codelibs/fess/util/GroovyUtil.java

@@ -1,32 +0,0 @@
-/*
- * Copyright 2012-2021 CodeLibs Project and the Others.
- *
- * Licensed 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.codelibs.fess.util;
-
-import java.util.Map;
-
-import org.codelibs.fess.Constants;
-
-@Deprecated
-public final class GroovyUtil {
-
-    private GroovyUtil() {
-        // nothing
-    }
-
-    public static Object evaluate(final String template, final Map<String, Object> paramMap) {
-        return ComponentUtil.getScriptEngineFactory().getScriptEngine(Constants.DEFAULT_SCRIPT).evaluate(template, paramMap);
-    }
-}

+ 7 - 7
src/test/java/org/codelibs/fess/ds/AbstractDataStoreTest.java

@@ -87,24 +87,24 @@ public class AbstractDataStoreTest extends UnitFessTestCase {
         paramMap.put("param3", "PARAM3*");
 
         value = "\"abc\"";
-        assertEquals("abc", dataStore.convertValue(value, paramMap));
+        assertEquals("abc", dataStore.convertValue(Constants.DEFAULT_SCRIPT, value, paramMap));
 
         value = "param1";
-        assertEquals("PARAM1", dataStore.convertValue(value, paramMap));
+        assertEquals("PARAM1", dataStore.convertValue(Constants.DEFAULT_SCRIPT, value, paramMap));
 
         value = "param2";
-        assertEquals("PARAM2+", dataStore.convertValue(value, paramMap));
+        assertEquals("PARAM2+", dataStore.convertValue(Constants.DEFAULT_SCRIPT, value, paramMap));
 
         value = "\"123\"+param2+\",\"+param3+\"abc\"";
-        assertEquals("123PARAM2+,PARAM3*abc", dataStore.convertValue(value, paramMap));
+        assertEquals("123PARAM2+,PARAM3*abc", dataStore.convertValue(Constants.DEFAULT_SCRIPT, value, paramMap));
 
         value = null;
-        assertEquals("", dataStore.convertValue(value, paramMap));
+        assertEquals("", dataStore.convertValue(Constants.DEFAULT_SCRIPT, value, paramMap));
 
         value = "";
-        assertEquals("", dataStore.convertValue(value, paramMap));
+        assertEquals("", dataStore.convertValue(Constants.DEFAULT_SCRIPT, value, paramMap));
 
         value = " ";
-        assertNull(dataStore.convertValue(value, paramMap));
+        assertNull(dataStore.convertValue(Constants.DEFAULT_SCRIPT, value, paramMap));
     }
 }