You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by gg...@apache.org on 2003/07/20 03:11:06 UTC

cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/builder EqualsBuilder.java

ggregory    2003/07/19 18:11:06

  Modified:    lang/src/java/org/apache/commons/lang/builder
                        EqualsBuilder.java
  Log:
  Severity	Description	Resource	In Folder	Location	Creation Time
  	The static method setAccessible(AccessibleObject[], boolean) from the type AccessibleObject should be accessed directly 	EqualsBuilder.java	Apache Jakarta Commons/lang/src/java/org/apache/commons/lang/builder	line 268	July 19, 2003 6:10:35 PM
  
  Revision  Changes    Path
  1.15      +7 -6      jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java
  
  Index: EqualsBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/EqualsBuilder.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- EqualsBuilder.java	14 Jul 2003 22:25:03 -0000	1.14
  +++ EqualsBuilder.java	20 Jul 2003 01:11:05 -0000	1.15
  @@ -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;
   /**
  @@ -92,7 +93,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>reflectionEquals</code>, uses <code>Field.setAccessible</code> to
  + * <code>reflectionEquals</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>
  @@ -133,7 +134,7 @@
        * <p>This method uses reflection to determine if the two <code>Object</code>s
        * are equal.</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>
  @@ -155,7 +156,7 @@
        * <p>This method uses reflection to determine if the two <code>Object</code>s
        * are equal.</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>
  @@ -179,7 +180,7 @@
        * <p>This method uses reflection to determine if the two <code>Object</code>s
        * are equal.</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>
  @@ -264,7 +265,7 @@
           EqualsBuilder builder,
           boolean useTransients) {
           Field[] fields = clazz.getDeclaredFields();
  -        Field.setAccessible(fields, true);
  +        AccessibleObject.setAccessible(fields, true);
           for (int i = 0; i < fields.length && builder.isEquals; i++) {
               Field f = fields[i];
               if ((f.getName().indexOf('$') == -1)
  
  
  

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