ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/jakarta/el/BeanSupportFull.java

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

      
    
Rootfs path

      
    
Size
3836 (3.7 KB)
MD5
aac7d0a37637f17e34feadc45ffeaa17
SHA1
b7c571102614ef485c6344aff81bfe5747bb9aa2
SHA256
b332493796fb250432ae6a746ce3a69fb35c7454d51b1f9c5759b306ac56d5ea
SHA512

      
    
SHA1_git
dc5464fc68fd6c9eb33cf77b25dbe291983c7400
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
BeanSupportFull.java | 3.7 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 jakarta.el; import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.Method; import jakarta.el.BeanELResolver.BeanProperties; import jakarta.el.BeanELResolver.BeanProperty; class BeanSupportFull extends BeanSupport { @Override BeanProperties getBeanProperties(Class<?> type) { return new BeanPropertiesFull(type); } static final class BeanPropertiesFull extends BeanProperties { BeanPropertiesFull(Class<?> type) throws ELException { super(type); try { BeanInfo info = Introspector.getBeanInfo(this.type); PropertyDescriptor[] pds = info.getPropertyDescriptors(); for (PropertyDescriptor pd : pds) { this.properties.put(pd.getName(), new BeanPropertyFull(type, pd)); } /* * https://bugs.openjdk.org/browse/JDK-8071693 - Introspector ignores default interface methods. * * This bug is fixed in Java 21 b21. This workaround can be removed once the minimum Java version is 21. * Populating from any interfaces causes default methods to be included. */ populateFromInterfaces(type); } catch (IntrospectionException ie) { throw new ELException(ie); } } private void populateFromInterfaces(Class<?> aClass) throws IntrospectionException { Class<?>[] interfaces = aClass.getInterfaces(); for (Class<?> ifs : interfaces) { BeanInfo info = Introspector.getBeanInfo(ifs); PropertyDescriptor[] pds = info.getPropertyDescriptors(); for (PropertyDescriptor pd : pds) { if (!this.properties.containsKey(pd.getName())) { this.properties.put(pd.getName(), new BeanPropertyFull(this.type, pd)); } } populateFromInterfaces(ifs); } Class<?> superclass = aClass.getSuperclass(); if (superclass != null) { populateFromInterfaces(superclass); } } } static final class BeanPropertyFull extends BeanProperty { private final PropertyDescriptor descriptor; BeanPropertyFull(Class<?> owner, PropertyDescriptor descriptor) { super(owner, descriptor.getPropertyType()); this.descriptor = descriptor; } @Override Method getWriteMethod() { return descriptor.getWriteMethod(); } @Override Method getReadMethod() { return descriptor.getReadMethod(); } @Override String getName() { return descriptor.getName(); } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
35.1
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
https://bugs.openjdk.org/browse/JDK-8071693 46 46