ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/jasper/runtime/ExceptionUtils.java

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

      
    
Rootfs path

      
    
Size
2101 (2.1 KB)
MD5
f57e1b4bbd85ce4bd4f392bf6d07c484
SHA1
a7ab802257c2b8bb8f53b3ef652b2aee80a6667c
SHA256
597039010dd0febc0ec73209d0adcc75c1f2f727ae4d9db66dd1d6c2ac565a9a
SHA512

      
    
SHA1_git
bcd7cae071db78b1203f83230dbcd3fb1d8d0a12
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
ExceptionUtils.java | 2.1 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.jasper.runtime; import java.lang.reflect.InvocationTargetException; /** * Utilities for handling Throwables and Exceptions. */ public class ExceptionUtils { /** * Checks whether the supplied Throwable is one that needs to be rethrown and swallows all others. * * @param t the Throwable to check */ public static void handleThrowable(Throwable t) { if (t instanceof StackOverflowError) { // Swallow silently - it should be recoverable return; } if (t instanceof VirtualMachineError) { throw (VirtualMachineError) t; } // All other instances of Throwable will be silently swallowed } /** * Checks whether the supplied Throwable is an instance of <code>InvocationTargetException</code> and returns the * throwable that is wrapped by it, if there is any. * * @param t the Throwable to check * * @return <code>t</code> or <code>t.getCause()</code> */ public static Throwable unwrapInvocationTargetException(Throwable t) { if (t instanceof InvocationTargetException && t.getCause() != null) { return t.getCause(); } return t; } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
47.6
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