JEP proposed to target JDK 15: 371: Hidden Classes

Mandy Chung mandy.chung at oracle.com
Thu Apr 2 05:25:54 UTC 2020


Hi Netroby,

Like David said, I think you misunderstand what this JEP proposes.

A hidden class is like a normal class that you can inspect and reflect 
on.  One main characteristics of a hidden class is that it cannot be 
symbolically referenced by other classes and hence a hidden class cannot 
be named as a supertype, cannot be a declaring field type, and cannot be 
the parameter type or the return type. It cannot be found by class 
loader via `Class::forName`, `ClassLoader::loadClass`, 
`Lookup::findClass` etc.  This is what the hidden-ness is about.

The class bytes of a hidden class is passed to the 
`Lookup::defineHiddenClass` as the argument.  Typically it is generated 
dynamically.  It is not a class file on the classpath (which I suspect 
JAR file you are referring to).

Mandy

On 4/1/20 9:19 PM, Netroby wrote:
> This may be dangerous. For virus creator and attacker. If they replace
> the origin Jar, the hidden  class may cause we can not easy to see
> what's inside it .
>
> For company , If company choose to using hide class protect the
> important framework. It's valuable , but for who working deal with the
> framework, not good news.
>
> We often tired to find out whats happening. while there is exception,
> what's inside the exceptions.
>
> The JEP may cause us coders hard to work. Not just easy to read code,
> easy to understand.
>
> Like there will have many walls , block us . close our eyes.
>
> any way, Hidden class may useful, but not to Java coder like me.
>
>
> Appreciate your time.
> ----------------------------
> Netroby
>
> <mark.reinhold at oracle.com> 于2020年4月2日周四 上午7:26写道:
>> The following JEP is proposed to target JDK 15:
>>
>>    371: Hidden Classes
>>         https://openjdk.java.net/jeps/371
>>
>> Feedback on this proposal from JDK Project Committers and Reviewers [1]
>> is more than welcome, as are reasoned objections.  If no such objections
>> are raised by 23:59 UTC on Wednesday, 8 April, or if they’re raised and
>> then satisfactorily answered, then per the JEP 2.0 process proposal [2]
>> I’ll target this JEP to JDK 15.
>>
>> - Mark
>>
>>
>> [1] https://openjdk.java.net/census#jdk
>> [2] https://cr.openjdk.java.net/~mr/jep/jep-2.0-02.html



More information about the jdk-dev mailing list