ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/el/TesterFunctions.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/el/TesterFunctions.java
Status
scanned
Type
file
Name
TesterFunctions.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
3531 (3.4 KB)
MD5
7aea43117730bedb0c95d5245736bca3
SHA1
1c6faa1204a28c2f191dfa379de0719ca5d476b8
SHA256
d5192fc8b18c2089dc554601575b68ecd4af311cbb1ba6dafa33c7a3a9d73e17
SHA512

      
    
SHA1_git
b5e286eea9fe493d9e4fbddc5cdc4b3bdefea66f
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TesterFunctions.java | 3.4 KB |

/* * 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.el; import java.lang.reflect.Method; import jakarta.el.FunctionMapper; public class TesterFunctions { public static String trim(String input) { return input.trim(); } public static String concat(String... inputs) { if (inputs == null || inputs.length == 0) { return null; } StringBuilder result = new StringBuilder(); for (String input : inputs) { result.append(input); } return result.toString(); } public static String concat2(String prefix, String... inputs) { StringBuilder result = new StringBuilder(prefix); for (String input : inputs) { result.append(input); } return result.toString(); } public static String[] toArray(String a, String b) { return new String[] { a, b }; } public static class Inner$Class { public static final String RETVAL = "Return from bug49555"; public static String bug49555() { return RETVAL; } } public static class FMapper extends FunctionMapper { @Override public Method resolveFunction(String prefix, String localName) { if ("trim".equals(localName)) { Method m; try { m = TesterFunctions.class.getMethod("trim", String.class); return m; } catch (SecurityException | NoSuchMethodException e) { // Ignore } } else if ("concat".equals(localName)) { Method m; try { m = TesterFunctions.class.getMethod("concat", String[].class); return m; } catch (SecurityException | NoSuchMethodException e) { // Ignore } } else if ("concat2".equals(localName)) { Method m; try { m = TesterFunctions.class.getMethod("concat2", String.class, String[].class); return m; } catch (SecurityException | NoSuchMethodException e) { // Ignore } } else if ("toArray".equals(localName)) { Method m; try { m = TesterFunctions.class.getMethod("toArray", String.class, String.class); return m; } catch (SecurityException | NoSuchMethodException e) { // Ignore } } return null; } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
37.42
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9