ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/el/parser/AstInteger.java

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

      
    
Rootfs path

      
    
Size
2255 (2.2 KB)
MD5
4aada26b4aaf34a4fbcd847000117753
SHA1
15e2dd640d9a4613bfd37196257e15f14588d53e
SHA256
cd94b3ec3571c2e6a641aec23d06c661a073f6c1418a7f9343b9e0b8e49dbb06
SHA512

      
    
SHA1_git
ef3a1eb29697345121934c33aa798dddc12e8652
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
AstInteger.java | 2.2 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. */ /* Generated By:JJTree: Do not edit this line. AstInteger.java */ package org.apache.el.parser; import java.math.BigInteger; import jakarta.el.ELException; import org.apache.el.lang.EvaluationContext; public final class AstInteger extends SimpleNode { public AstInteger(int id) { super(id); } private volatile Number number; private Number getInteger() { // The parser should ensure the format of the string to be parsed if (this.number == null) { try { try { this.number = Long.valueOf(this.image); } catch (NumberFormatException ignore) { // Too large for Long. Try BigInteger. this.number = new BigInteger(this.image); } } catch (ArithmeticException | NumberFormatException e) { // Too big for BigInteger. // Catch NumberFormatException as well here just in case the // parser provides invalid input. throw new ELException(e); } } return number; } @Override public Class<?> getType(EvaluationContext ctx) throws ELException { return this.getInteger().getClass(); } @Override public Object getValue(EvaluationContext ctx) throws ELException { return this.getInteger(); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
46.85
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