You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yang Jie (Jira)" <ji...@apache.org> on 2023/10/09 05:12:00 UTC

[jira] [Updated] (SPARK-45467) Replace `Proxy.getProxyClass()` with `Proxy.newProxyInstance().getClass`

     [ https://issues.apache.org/jira/browse/SPARK-45467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yang Jie updated SPARK-45467:
-----------------------------
    Description: 
{code:java}
 * @deprecated Proxy classes generated in a named module are encapsulated
 *      and not accessible to code outside its module.
 *      {@link Constructor#newInstance(Object...) Constructor.newInstance}
 *      will throw {@code IllegalAccessException} when it is called on
 *      an inaccessible proxy class.
 *      Use {@link #newProxyInstance(ClassLoader, Class[], InvocationHandler)}
 *      to create a proxy instance instead.
 *
 * @see <a href="#membership">Package and Module Membership of Proxy Class</a>
 * @revised 9
 */
@Deprecated
@CallerSensitive
public static Class<?> getProxyClass(ClassLoader loader,
                                     Class<?>... interfaces)
    throws IllegalArgumentException {code}

> Replace `Proxy.getProxyClass()` with `Proxy.newProxyInstance().getClass`
> ------------------------------------------------------------------------
>
>                 Key: SPARK-45467
>                 URL: https://issues.apache.org/jira/browse/SPARK-45467
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Spark Core
>    Affects Versions: 4.0.0
>            Reporter: Yang Jie
>            Priority: Major
>
> {code:java}
>  * @deprecated Proxy classes generated in a named module are encapsulated
>  *      and not accessible to code outside its module.
>  *      {@link Constructor#newInstance(Object...) Constructor.newInstance}
>  *      will throw {@code IllegalAccessException} when it is called on
>  *      an inaccessible proxy class.
>  *      Use {@link #newProxyInstance(ClassLoader, Class[], InvocationHandler)}
>  *      to create a proxy instance instead.
>  *
>  * @see <a href="#membership">Package and Module Membership of Proxy Class</a>
>  * @revised 9
>  */
> @Deprecated
> @CallerSensitive
> public static Class<?> getProxyClass(ClassLoader loader,
>                                      Class<?>... interfaces)
>     throws IllegalArgumentException {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org