±±¾©Ê¯ÓÍ»¯¹¤Ñ§Ôº2026ÄêÑо¿ÉúÕÐÉú½ÓÊÕµ÷¼Á¹«¸æ
²é¿´: 1262  |  »Ø¸´: 1
±¾Ìû²úÉú 1 ¸ö ·­ÒëEPI £¬µã»÷ÕâÀï½øÐв鿴

einsteinjw

Òø³æ (СÓÐÃûÆø)

[ÇóÖú] °ïæ·­ÒëÏÂÓ¢ÒëÖУ¬¼±Çó£¬Ð»Ð»ÁË£¬¿ÉÒÔ·­ÒëÆäÖÐÒ»¶Î

Reflection enables a Java program to analyze and modify itself. In particular, a program can discover the values of field variables and change them [ Forman 2005 ], [ Sun 2002 ]. The Java reflection API includes a method that enables fields that are normally inaccessible to be accessed under reflection. The following code prints out the names and values of all fields of an object someObject of class SomeClass;
When the default security manager is used, it prevents fields that are normally
inaccessible from being accessed under reflection. The default security manager throws a java.security.AccessControlException in these circumstances. However, java.lang.reflect.ReflectPermission can be granted with action suppressAccessChecks to override this default behavior.
For example, although an object is ordinarily prevented from accessing private members or invoking private methods of another class, the APIs belonging to the java.lang.reflect package allow an object to do so contingent upon performing the language-defined access checks. It is important to note, however, that these access checks consider only the language-level visibility of the immediate caller. Consequently, unwary programmers can create an opportunity for a privilege escalation attack by untrusted callers.

» ²ÂÄãϲ»¶

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

zcius

ÖÁ×ðľ³æ (ÖªÃû×÷¼Ò)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

einsteinjw(½ð±Ò+20, ·­ÒëEPI+1): 2012-02-14 12:55:49
sltmac(½ð±Ò+25): 2012-02-25 09:49:41
·´Ë¼Ê¹µÃJava³ÌÐò¿ÉÒÔ·ÖÎöÇÒÐÞ¸Ä×Ô¼º¡£ÌرðÊÇ£¬Ò»¸ö³ÌÐò¿ÉÒÔ·¢ÏÖÓò±äÁ¿µÄÖµ£¬²¢ÐÞ¸ÄËüÃÇ[Forman 2005]£¬[Sun 2002]¡£ Java·´Ë¼API°üÀ¨Ò»¸ö·½·¨£¬Ê¹µÃͨ³£ÎÞ·¨·ÃÎʵÄÓòÔÚ·´Ë¼Ê±¿É·ÃÎÊ¡£ÏÂÃæµÄ´úÂë´òÓ¡³ö SomeClass ÀàµÄ¶ÔÏó someObject ¸÷ÓòµÄÃû³ÆºÍÖµ;


ȱʡµÄ°²È«¹ÜÀí£¬·ÀÖ¹Ò»°ã²»¿É·ÃÎʵÄÓòÔÚ·´Ë¼Ê±¿É·ÃÎÊ¡£´Ëʱ£¬È±Ê¡µÄ°²È«¹ÜÀíÆô¶¯Ò»¸ö java.security.AccessControlException¡£µ«ÊÇ£¬java.lang.reflect.ReflectPermission ×¼Ðí suppressAccessChecks ¸²¸Ç¸ÃȱʡÐÐΪ¡£
ÀýÈ磬ËäȻһ¸ö¶ÔÏóͨ³£²»ÄÜ·ÃÎÊÁíÒ»¸öÀàµÄ˽ÓгÉÔ±»òµ÷ÓÃÁíÒ»¸öÀàµÄ˽Óз½·¨£¬µ« java.lang.reflect °üÖеÄAPI ¿ÉÊÓÓïÑÔ¶¨ÒåµÄ·ÃÎʼì²é¶øÔÊÐíÕâÑù×ö¡£È»¶øÒª×¢Ò⣬ÕâЩ·ÃÎʼì²éÖ»¿¼ÂÇÁËÓïÑÔ²ã´Î¿É¼ûµÄÖ±½Óµ÷ÓÃÕß¡£Òò´Ë£¬´ÖÐĵijÌÐòÔ±»áÁôÏÂÊܲ»ÐÅÈε÷ÓÃÕß½øÐÐÌØÈ¨Éý¼¶¹¥»÷µÄ»ú»á¡£
2Â¥2012-02-14 06:16:49
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ einsteinjw µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 332Çóµ÷¼Á +17 ССÃÏ... 2026-04-05 18/900 2026-04-06 09:51 by À¶ÔÆË¼Óê
[¿¼ÑÐ] µ÷¼Á Ò»Ö¾Ô¸¼ªÁÖ´óѧ357·Ö +5 .Starry. 2026-04-04 5/250 2026-04-06 09:28 by cql1109
[¿¼ÑÐ] ²ÄÁϵ÷¼Á +14 Ò¼·¡·¡ÒÚ 2026-04-04 14/700 2026-04-05 23:31 by À´¿´Á÷ÐÇÓê10
[¿¼ÑÐ] 341Çóµ÷¼Á +3 ѧÎÞÖ¹¾³£¬³å 2026-04-05 3/150 2026-04-05 09:40 by lbsjt
[¿¼ÑÐ] 353Çóµ÷¼Á +10 MayUxw1 2026-04-03 10/500 2026-04-05 09:23 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] 324Çóµ÷¼Á +9 ÏëÉÏѧÇóµ÷ 2026-04-03 9/450 2026-04-04 23:57 by ¹û¶³´óÍõ
[¿¼ÑÐ] 286Çóµ÷¼Á +3 ²Ýľ²»ÑÔ 2026-04-04 3/150 2026-04-04 22:40 by lbsjt
[¿¼ÑÐ] 0854Çóµ÷¼Á +4 assdll 2026-04-03 4/200 2026-04-04 22:17 by hemengdong
[¿¼ÑÐ] ²ÄÁÏ383Çóµ÷¼Á +5 ¹ùÑôÑôÑô³É 2026-04-04 5/250 2026-04-04 19:06 by dongzh2009
[¿¼ÑÐ] »¯¹¤Çóµ÷¼Á +11 ÀóÏã֥ʿҬÄÌ 2026-04-03 11/550 2026-04-03 22:06 by à£à£à£0119
[¿¼ÑÐ] Ò»Ö¾Ô¸»ªÖÐũҵ071010£¬×Ü·Ö320Çóµ÷¼Á +7 À§À§À§À§À¤À¤ 2026-04-02 7/350 2026-04-03 17:26 by Yuena_Wang
[¿¼ÑÐ] 289-Çóµ÷¼Á +4 ÕâÀïÊÇ_ 2026-04-03 4/200 2026-04-03 14:23 by 1753564080
[¿¼ÑÐ] 282Çóµ÷¼Á ²»Ìôרҵ ÇóÊÕÁô +7 Yam. 2026-03-30 8/400 2026-04-03 14:12 by zhangdingwa
[¿¼ÑÐ] ÉúÎïѧ308·ÖÇóµ÷¼Á£¨Ò»Ö¾Ô¸»ª¶«Ê¦´ó£© +6 ÏàÐűػá¹ââÍòÕ 2026-03-31 7/350 2026-04-02 23:16 by JourneyLucky
[¿¼ÑÐ] Ò»Ö¾Ô¸±±¾©¿Æ¼¼²ÄÁÏ¿ÆÑ§Ó빤³Ì288·Ö£¬Çóµ÷¼Á +14 Êdz½°¡ 2026-04-02 14/700 2026-04-02 21:10 by dongzh2009
[¿¼ÑÐ] Ò»Ö¾Ô¸±±¾©¿Æ¼¼´óѧ085601²ÄÁϹ¤³ÌÓ¢Ò»Êý¶þ³õÊÔ×Ü·Ö335Çóµ÷¼Á +8 Ë«ÂíβƦÀϰå2 2026-04-02 9/450 2026-04-02 14:45 by 5896
[˶²©¼ÒÔ°] ¿¼Ñе÷¼Á +5 ÂæÍÕÄÐÈË 2026-04-01 5/250 2026-04-01 14:28 by syjjj0321
[¿¼ÑÐ] Çó0861½»Í¨ÔËÊäר˶or²ÄÁÏר˶µ÷¼Á +4 ÀÕ²¼ÀÊ@ 2026-03-31 4/200 2026-04-01 09:54 by Ò»Ö»ºÃ¹û×Ó?
[¿¼ÑÐ] 080500-315·Ö¸´ÊÔµ÷¼Á +9 Éϰ¶3821 2026-03-31 9/450 2026-03-31 17:29 by ÌÆãå¶ù
[¿¼ÑÐ] Ò»Ö¾Ô¸Î÷µç085401ÊýÒ»Ó¢Ò»299Çóµ÷¼Á Áù¼¶521 +4 °®³Ô´óѼÀæ 2026-03-31 4/200 2026-03-31 11:51 by ²«»÷518
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û