| ²é¿´: 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. |
» ²ÂÄãϲ»¶
Ò»Ö¾Ô¸±±½»´ó²ÄÁϹ¤³Ì×Ü·Ö358Çóµ÷¼Á
ÒѾÓÐ9È˻ظ´
286Çóµ÷¼Á
ÒѾÓÐ11È˻ظ´
Çóµ÷¼Á£¡ÉúÎïÓëҽҩר˶
ÒѾÓÐ6È˻ظ´
362Çóµ÷¼ÁÒ»Ö¾Ô¸ÖйúʯÓÍ´óѧ
ÒѾÓÐ4È˻ظ´
085600£¬321·ÖÇóµ÷¼Á
ÒѾÓÐ14È˻ظ´
²ÄÁϵ÷¼Á
ÒѾÓÐ4È˻ظ´
Ò»Ö¾Ô¸ÉúÎïÓëÒ½Ò©£¬296·Ö£¬Çóµ÷¼Á
ÒѾÓÐ11È˻ظ´
346·ÖµÄÉúÎïÓëÒ½Ò©08600Çóµ÷¼Á
ÒѾÓÐ7È˻ظ´
071000ÉúÎïѧµ÷¼Á
ÒѾÓÐ6È˻ظ´
Ò»Ö¾Ô¸Ö£ÖÝ´óѧ²ÄÁÏÓ뻯¹¤085600£¬Çóµ÷¼Á
ÒѾÓÐ25È˻ظ´
zcius
ÖÁ×ðľ³æ (ÖªÃû×÷¼Ò)
- ·ÒëEPI: 65
- Ó¦Öú: 5 (Ó×¶ùÔ°)
- ½ð±Ò: 16742.4
- É¢½ð: 810
- ºì»¨: 8
- Ìû×Ó: 8863
- ÔÚÏß: 406.9Сʱ
- ³æºÅ: 1123409
- ×¢²á: 2010-10-15
- רҵ: ¼ÆËã»ú¿ÆÑ§µÄ»ù´¡ÀíÂÛ
¡¾´ð°¸¡¿Ó¦Öú»ØÌû
einsteinjw(½ð±Ò+20, ·ÒëEPI+1): 2012-02-14 12:55:49
sltmac(½ð±Ò+25): 2012-02-25 09:49:41
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














»Ø¸´´ËÂ¥