Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 17 java.desktop.jmod - Desktop Module
JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module.
JDK 17 Desktop module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.desktop.jmod.
JDK 17 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Desktop module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/beans/finder/MethodFinder.java
/* * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.beans.finder; import com.sun.beans.TypeResolver; import com.sun.beans.util.Cache; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.Arrays; import static com.sun.beans.util.Cache.Kind.SOFT; import static sun.reflect.misc.ReflectUtil.isPackageAccessible; /** * This utility class provides {@code static} methods * to find a public method with specified name and parameter types * in specified class. * * @since 1.7 * * @author Sergey A. Malenkov */ public final class MethodFinder extends AbstractFinder<Method> { private static final Cache<Signature, Method> CACHE = new Cache<Signature, Method>(SOFT, SOFT) { @Override public Method create(Signature signature) { try { MethodFinder finder = new MethodFinder(signature.getName(), signature.getArgs()); return findAccessibleMethod(finder.find(signature.getType().getMethods())); } catch (Exception exception) { throw new SignatureException(exception); } } }; /** * Finds public method (static or non-static) * that is accessible from public class. * * @param type the class that can have method * @param name the name of method to find * @param args parameter types that is used to find method * @return object that represents found method * @throws NoSuchMethodException if method could not be found * or some methods are found */ public static Method findMethod(Class<?> type, String name, Class<?>...args) throws NoSuchMethodException { if (name == null) { throw new IllegalArgumentException("Method name is not set"); } PrimitiveWrapperMap.replacePrimitivesWithWrappers(args); Signature signature = new Signature(type, name, args); try { Method method = CACHE.get(signature); return (method == null) || isPackageAccessible(method.getDeclaringClass()) ? method : CACHE.create(signature); } catch (SignatureException exception) { throw exception.toNoSuchMethodException("Method '" + name + "' is not found"); } } /** * Finds public non-static method * that is accessible from public class. * * @param type the class that can have method * @param name the name of method to find * @param args parameter types that is used to find method * @return object that represents found method * @throws NoSuchMethodException if method could not be found * or some methods are found */ public static Method findInstanceMethod(Class<?> type, String name, Class<?>... args) throws NoSuchMethodException { Method method = findMethod(type, name, args); if (Modifier.isStatic(method.getModifiers())) { throw new NoSuchMethodException("Method '" + name + "' is static"); } return method; } /** * Finds public static method * that is accessible from public class. * * @param type the class that can have method * @param name the name of method to find * @param args parameter types that is used to find method * @return object that represents found method * @throws NoSuchMethodException if method could not be found * or some methods are found */ public static Method findStaticMethod(Class<?> type, String name, Class<?>...args) throws NoSuchMethodException { Method method = findMethod(type, name, args); if (!Modifier.isStatic(method.getModifiers())) { throw new NoSuchMethodException("Method '" + name + "' is not static"); } return method; } /** * Finds method that is accessible from public class or interface through class hierarchy. * * @param method object that represents found method * @return object that represents accessible method * @throws NoSuchMethodException if method is not accessible or is not found * in specified superclass or interface */ public static Method findAccessibleMethod(Method method) throws NoSuchMethodException { Class<?> type = method.getDeclaringClass(); if (!FinderUtils.isExported(type)) { throw new NoSuchMethodException("Method '" + method.getName() + "' is not accessible"); } if (Modifier.isPublic(type.getModifiers()) && isPackageAccessible(type)) { return method; } if (Modifier.isStatic(method.getModifiers())) { throw new NoSuchMethodException("Method '" + method.getName() + "' is not accessible"); } for (Type generic : type.getGenericInterfaces()) { try { return findAccessibleMethod(method, generic); } catch (NoSuchMethodException exception) { // try to find in superclass or another interface } } return findAccessibleMethod(method, type.getGenericSuperclass()); } /** * Finds method that accessible from specified class. * * @param method object that represents found method * @param generic generic type that is used to find accessible method * @return object that represents accessible method * @throws NoSuchMethodException if method is not accessible or is not found * in specified superclass or interface */ private static Method findAccessibleMethod(Method method, Type generic) throws NoSuchMethodException { String name = method.getName(); Class<?>[] params = method.getParameterTypes(); if (generic instanceof Class) { Class<?> type = (Class<?>) generic; return findAccessibleMethod(type.getMethod(name, params)); } if (generic instanceof ParameterizedType) { ParameterizedType pt = (ParameterizedType) generic; Class<?> type = (Class<?>) pt.getRawType(); for (Method m : type.getMethods()) { if (m.getName().equals(name)) { Class<?>[] pts = m.getParameterTypes(); if (pts.length == params.length) { if (Arrays.equals(params, pts)) { return findAccessibleMethod(m); } Type[] gpts = m.getGenericParameterTypes(); if (params.length == gpts.length) { if (Arrays.equals(params, TypeResolver.erase(TypeResolver.resolve(pt, gpts)))) { return findAccessibleMethod(m); } } } } } } throw new NoSuchMethodException("Method '" + name + "' is not accessible"); } private final String name; /** * Creates method finder with specified array of parameter types. * * @param name the name of method to find * @param args the array of parameter types */ private MethodFinder(String name, Class<?>[] args) { super(args); this.name = name; } /** * Checks validness of the method. * The valid method should be public and * should have the specified name. * * @param method the object that represents method * @return {@code true} if the method is valid, * {@code false} otherwise */ @Override protected boolean isValid(Method method) { return super.isValid(method) && method.getName().equals(this.name); } }
⏎ com/sun/beans/finder/MethodFinder.java
Or download all of them as a single archive file:
File name: java.desktop-17.0.5-src.zip File size: 9152233 bytes Release date: 2022-09-13 Download
⇒ JDK 17 java.instrument.jmod - Instrument Module
2023-09-16, 62430👍, 0💬
Popular Posts:
Provides a simple high-level Http server API, which can be used to build embedded HTTP servers. Both...
ASM is an all purpose Java bytecode manipulation and analysis framework. It can be used to modify ex...
Apache Log4j SLF4J Binding allows applications coded to the SLF4J API to use Log4j 2 as the implemen...
Saxon is an open source product available under the Mozilla Public License. It provides implementati...
JDK 11 jdk.jdeps.jmod is the JMOD file for JDK 11 JDeps tool, which can be invoked by the "jdeps" co...