[seam-commits] Seam SVN: r9572 - trunk/src/main/org/jboss/seam/util.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Sat Nov 15 17:33:10 EST 2008
Author: shane.bryzak at jboss.com
Date: 2008-11-15 17:33:10 -0500 (Sat, 15 Nov 2008)
New Revision: 9572
Modified:
trunk/src/main/org/jboss/seam/util/Reflections.java
Log:
allow setting of private fields
Modified: trunk/src/main/org/jboss/seam/util/Reflections.java
===================================================================
--- trunk/src/main/org/jboss/seam/util/Reflections.java 2008-11-15 21:57:04 UTC (rev 9571)
+++ trunk/src/main/org/jboss/seam/util/Reflections.java 2008-11-15 22:33:10 UTC (rev 9572)
@@ -114,8 +114,10 @@
public static void setAndWrap(Field field, Object target, Object value)
{
+ boolean accessible = field.isAccessible();
try
{
+ field.setAccessible(true);
set(field, target, value);
}
catch (Exception e)
@@ -129,6 +131,10 @@
throw new IllegalArgumentException("exception setting: " + field.getName(), e);
}
}
+ finally
+ {
+ field.setAccessible(accessible);
+ }
}
public static Object invokeAndWrap(Method method, Object target, Object... args)
More information about the seam-commits
mailing list