commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/builder ReflectionToStringBuilder.java
Date Sun, 20 Jul 2003 01:13:14 GMT
ggregory    2003/07/19 18:13:14

  Modified:    lang/src/java/org/apache/commons/lang/builder
                        ReflectionToStringBuilder.java
  Log:
  Severity	Description	Resource	In Folder	Location	Creation Time
  	The static method setAccessible(AccessibleObject[], boolean) from the type AccessibleObject
should be accessed directly 	ReflectionToStringBuilder.java	Apache Jakarta Commons/lang/src/java/org/apache/commons/lang/builder
line 346	July 18, 2003 8:21:31 PM
  
  Revision  Changes    Path
  1.6       +8 -7      jakarta-commons/lang/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java
  
  Index: ReflectionToStringBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ReflectionToStringBuilder.java	15 Jul 2003 23:12:51 -0000	1.5
  +++ ReflectionToStringBuilder.java	20 Jul 2003 01:13:14 -0000	1.6
  @@ -1,5 +1,6 @@
   package org.apache.commons.lang.builder;
   
  +import java.lang.reflect.AccessibleObject;
   import java.lang.reflect.Field;
   import java.lang.reflect.Modifier;
   import java.util.HashSet;
  @@ -12,7 +13,7 @@
    *
    * <p>This class uses reflection to determine the fields to append. 
    * Because these fields are usually private, the class 
  - * uses <code>Field.setAccessible</code> to
  + * uses <code>AccessibleObject.setAccessible</code> to
    * change the visibility of the fields. This will fail under a security manager,
    * unless the appropriate permissions are set up correctly.</p>
    *
  @@ -100,7 +101,7 @@
        * <p>This method uses reflection to build a suitable
        * <code>toString</code> using the default <code>ToStringStyle</code>.
        *
  -     * <p>It uses <code>Field.setAccessible</code> to gain access to
private
  +     * <p>It uses <code>AccessibleObject.setAccessible</code> to gain
access to private
        * fields. This means that it will throw a security exception if run
        * under a security manger, if the permissions are not set up correctly.
        * It is also not as efficient as testing explicitly.</p>
  @@ -120,7 +121,7 @@
        * <p>This method uses reflection to build a suitable
        * <code>toString</code>.</p>
        *
  -     * <p>It uses <code>Field.setAccessible</code> to gain access to
private
  +     * <p>It uses <code>AccessibleObject.setAccessible</code> to gain
access to private
        * fields. This means that it will throw a security exception if run
        * under a security manger, if the permissions are not set up correctly.
        * It is also not as efficient as testing explicitly.</p>
  @@ -146,7 +147,7 @@
        * <p>This method uses reflection to build a suitable
        * <code>toString</code>.</p>
        *
  -     * <p>It uses <code>Field.setAccessible</code> to gain access to
private
  +     * <p>It uses <code>AccessibleObject.setAccessible</code> to gain
access to private
        * fields. This means that it will throw a security exception if run
        * under a security manger, if the permissions are not set up correctly.
        * It is also not as efficient as testing explicitly. </p>
  @@ -176,7 +177,7 @@
        * <p>This method uses reflection to build a suitable
        * <code>toString</code>.</p>
        *
  -     * <p>It uses <code>Field.setAccessible</code> to gain access to
private
  +     * <p>It uses <code>AccessibleObject.setAccessible</code> to gain
access to private
        * fields. This means that it will throw a security exception if run
        * under a security manger, if the permissions are not set up correctly.
        * It is also not as efficient as testing explicitly. </p>
  @@ -343,7 +344,7 @@
                   return;
               }
               Field[] fields = clazz.getDeclaredFields();
  -            Field.setAccessible(fields, true);
  +            AccessibleObject.setAccessible(fields, true);
               for (int i = 0; i < fields.length; i++) {
                   Field field = fields[i];
                   String fieldName = field.getName();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message