Yes. Another issue is that the way the code is currently factored means that you'd get write access when you only need read...
Gary -------- Original message -------- From: Benedikt Ritter <brit...@apache.org> Date:01/30/2014 13:22 (GMT-05:00) To: Commons Developers List <dev@commons.apache.org> Subject: Re: [LANG] FieldUtils forceAccess does not force access for final So the point you're making is that accessibility alway includes write access? 2014/1/29 Gary Gregory <garydgreg...@gmail.com> > Hi All: > > I have a use case where I need to use reflection to set a public static > final Object. > > This does not work with our FieldUtils class because the "forceAccess" > argument is only used to deal with field visibility by calling > Field#setAccessible(boolean) > > Q1: Should "forceAccess" be expanded to remove the final modifier? Or: > Q2: Should we add another boolean parameter "forceWrite" to remove the > FINAL modifier? > > I like Q1. > > Q3: The Accessible flag is NOT reset if changed after a write! I think it > should be. Thoughts? > > Gary > > -- > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org > Java Persistence with Hibernate, Second Edition< > http://www.manning.com/bauer3/> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> > Spring Batch in Action <http://www.manning.com/templier/> > Blog: http://garygregory.wordpress.com > Home: http://garygregory.com/ > Tweet! http://twitter.com/GaryGregory > -- http://people.apache.org/~britter/ http://www.systemoutprintln.de/ http://twitter.com/BenediktRitter http://github.com/britter