ggregory    2003/07/19 18:12:32

  Modified:    lang/src/java/org/apache/commons/lang/builder
                        HashCodeBuilder.java
  Log:
  Severity      Description     Resource        In Folder       Location        
Creation Time
        The static method setAccessible(AccessibleObject[], boolean) from the type 
AccessibleObject should be accessed directly         HashCodeBuilder.java    Apache 
Jakarta Commons/lang/src/java/org/apache/commons/lang/builder    line 341        July 
18, 2003 8:21:31 PM
  
  Revision  Changes    Path
  1.14      +9 -8      
jakarta-commons/lang/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java
  
  Index: HashCodeBuilder.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/HashCodeBuilder.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- HashCodeBuilder.java      14 Jul 2003 22:25:03 -0000      1.13
  +++ HashCodeBuilder.java      20 Jul 2003 01:12:32 -0000      1.14
  @@ -53,6 +53,7 @@
    */
   package org.apache.commons.lang.builder;
   
  +import java.lang.reflect.AccessibleObject;
   import java.lang.reflect.Field;
   import java.lang.reflect.Modifier;
   /**
  @@ -93,7 +94,7 @@
    *
    * <p>Alternatively, there is a method that uses reflection to determine
    * the fields to test. Because these fields are usually private, the method,
  - * <code>reflectionHashCode</code>, uses <code>Field.setAccessible</code> to
  + * <code>reflectionHashCode</code>, 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. It is also slower
    * than testing explicitly.</p>
  @@ -172,7 +173,7 @@
        * <p>This constructor uses two hard coded choices for the constants
        * needed to build a hash 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>
  @@ -196,7 +197,7 @@
        * <p>This constructor uses two hard coded choices for the constants needed
        * to build a hash 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>
  @@ -219,7 +220,7 @@
       /**
        * <p>This method uses reflection to build a valid hash 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>
  @@ -248,7 +249,7 @@
       /**
        * <p>This method uses reflection to build a valid hash 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>
  @@ -280,7 +281,7 @@
       /**
        * <p>This method uses reflection to build a valid hash 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>
  @@ -338,7 +339,7 @@
        */
       private static void reflectionAppend(Object object, Class clazz, 
HashCodeBuilder builder, boolean useTransients) {
           Field[] fields = clazz.getDeclaredFields();
  -        Field.setAccessible(fields, true);
  +        AccessibleObject.setAccessible(fields, true);
           for (int i = 0; i < fields.length; i++) {
               Field f = fields[i];
               if ((f.getName().indexOf('$') == -1)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to