PDA

View Full Version : 1.1 P3 issue with varying property access levels causes exception



dean.ward
12-24-2006, 07:38 PM
Hi there,

Just a little something I've noticed while playing with Spring 1.1P3 - using a property like this for dependency injection:


private ISomeInterface something;
public ISomeInterface Something
{

private get { return something; }
set { contentGroupDL = value; }
}
(note the more restrictive getter) causes Spring to throw a NullReferenceException in Spring.Util.DynamicReflection.DynamicProperty.Gene rateGetValue (DyanmicProperty.cs, line 188). Removing the more restrictive getter, replacing it with a public version, or replacing the call in the method above to GetGetMethod() with GetGetMethod(true) does the trick.

Not investigated much further than that yet, but thought I'd give you guys a heads up anyhow.

Cheers,

Dean

Erich Eichinger
12-25-2006, 10:14 PM
Hi

I added a JIRA (http://opensource.atlassian.com/projects/spring/browse/SPRNET-427) entry (SPRNET-427) to keep track of this issue. Thanks for reporting it!

- Erich