ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/util/bcel/classfile/Utility.java

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

      
    
Rootfs path

      
    
Size
2177 (2.1 KB)
MD5
018bb0d053cfff05f778f57794ba459a
SHA1
1f3b116b2a5480cbd611819a1682eaac1e505f36
SHA256
fac0506aed2419d179127c3f66d21f559496041bab15c8669ae5fd4bdc8f1b7a
SHA512

      
    
SHA1_git
da26042a18928e3c9eea989a1fb02e7ed5e564a2
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
Utility.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.tomcat.util.bcel.classfile; import java.io.DataInput; import java.io.EOFException; import java.io.IOException; import org.apache.tomcat.util.bcel.Const; /** * Utility functions that do not really belong to any class in particular. */ final class Utility { /** * Shorten long class names, <em>java/lang/String</em> becomes <em>String</em>. * * @param str The long class name * @return Compacted class name */ static String compactClassName(final String str) { return str.replace('/', '.'); // Is '/' on all systems, even DOS } static String getClassName(final ConstantPool constantPool, final int index) { Constant c = constantPool.getConstant(index, Const.CONSTANT_Class); int i = ((ConstantClass) c).getNameIndex(); // Finally get the string from the constant pool c = constantPool.getConstant(i, Const.CONSTANT_Utf8); String name = ((ConstantUtf8) c).getBytes(); return compactClassName(name); } static void skipFully(final DataInput file, final int length) throws IOException { int total = file.skipBytes(length); if (total != length) { throw new EOFException(); } } private Utility() { // Hide default constructor } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
45.77
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