Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SPRNET-1563 Make code as ClsCompliant as possible

  • Loading branch information...
commit 1b733688269db3f9a0476440e5b64f9e2e0d9c05 1 parent 72fd5be
@lahma lahma authored
Showing with 1,271 additions and 1,106 deletions.
  1. +6 −0 BreakingChanges.txt
  2. +0 −24 Spring.Net.2010.sln
  3. +19 −0 Spring.Net.2010.sln.DotSettings
  4. +2 −2 Spring.include
  5. +1 −1  common-project.include
  6. +2 −1  src/Spring/CommonAssemblyInfo.cs
  7. +29 −22 src/Spring/Spring.Aop/Aop/Framework/AbstractMethodInvocation.cs
  8. +15 −7 src/Spring/Spring.Aop/Aop/Framework/DynamicMethodInvocation.cs
  9. +16 −8 src/Spring/Spring.Aop/Aop/Framework/ReflectiveMethodInvocation.cs
  10. +1 −1  src/Spring/Spring.Aop/Spring.Aop.2010.csproj
  11. +7 −4 src/Spring/Spring.Core/Context/Attributes/AssemblyTypeScanner.cs
  12. +8 −1 src/Spring/Spring.Core/Context/Attributes/DependsOnAttribute.cs
  13. +7 −0 src/Spring/Spring.Core/Context/Attributes/ImportAttribute.cs
  14. +1 −0  src/Spring/Spring.Core/Expressions/BinaryOperator.cs
  15. +615 −615 src/Spring/Spring.Core/Expressions/Parser/antlr/BaseAST.cs
  16. +149 −149 src/Spring/Spring.Core/Expressions/SpringAST.cs
  17. +3 −3 src/Spring/Spring.Core/Objects/Factory/Attributes/AutowiredAttributeObjectPostProcessor.cs
  18. +6 −1 src/Spring/Spring.Core/Objects/Factory/Attributes/InjectionMetadata.cs
  19. +1 −1  src/Spring/Spring.Core/Objects/Factory/Config/ConfigurableVariableSource.cs
  20. +6 −0 src/Spring/Spring.Core/Objects/Factory/Config/VariableAccessor.cs
  21. +2 −1  src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectFactory.cs
  22. +4 −3 src/Spring/Spring.Core/Spring.Core.2010.csproj
  23. +1 −1  src/Spring/Spring.Data/Data/Core/AdoAccessor.cs
  24. +1 −1  src/Spring/Spring.Data/Data/Core/AdoTemplate.cs
  25. +3 −4 src/Spring/Spring.Data/Data/Generic/AdoTemplate.cs
  26. +2 −1  src/Spring/Spring.Data/Data/Objects/AbstractAdoOperation.cs
  27. +19 −36 src/Spring/Spring.Data/Data/Objects/AdoOperation.cs
  28. +18 −30 src/Spring/Spring.Data/Data/Objects/Generic/AdoOperation.cs
  29. +1 −1  src/Spring/Spring.Data/Spring.Data.2010.csproj
  30. +1 −0  src/Spring/Spring.Messaging.Ems/Spring.Messaging.Ems.2010.csproj
  31. +1 −1  src/Spring/Spring.Messaging.Nms/Messaging/Nms/Core/NmsTemplate.cs
  32. +6 −2 src/Spring/Spring.Messaging/Messaging/Core/MessageQueueGatewaySupport.cs
  33. +27 −1 src/Spring/Spring.Messaging/Messaging/Core/MessageQueueMetadataCache.cs
  34. +11 −6 src/Spring/Spring.Messaging/Messaging/Core/MessageQueueTemplate.cs
  35. +5 −0 src/Spring/Spring.Messaging/Messaging/Listener/MessageListenerAdapter.cs
  36. +1 −1  src/Spring/Spring.Messaging/Spring.Messaging.2010.csproj
  37. +42 −0 src/Spring/Spring.Scheduling.Quartz21/AssemblyInfo.cs
  38. +11 −2 src/Spring/Spring.Scheduling.Quartz21/Scheduling/Quartz/SchedulerAccessor.cs
  39. +6 −8 src/Spring/Spring.Scheduling.Quartz21/Scheduling/Quartz/SchedulerFactoryObject.cs
  40. +6 −0 src/Spring/Spring.Scheduling.Quartz21/Spring.Scheduling.Quartz21.2010.csproj
  41. +2 −1  src/Spring/Spring.Services/ServiceModel/Activation/ServiceHostFactoryObject.cs
  42. +4 −2 src/Spring/Spring.Services/ServiceModel/ServiceExporter.cs
  43. +2 −2 src/Spring/Spring.Services/Spring.Services.2010.csproj
  44. +42 −0 src/Spring/Spring.Template.Velocity/AssemblyInfo.cs
  45. +4 −0 src/Spring/Spring.Template.Velocity/Spring.Template.Velocity.2010.csproj
  46. +8 −2 src/Spring/Spring.Template.Velocity/Template/Velocity/CommonsLoggingLogSystem.cs
  47. +1 −0  src/Spring/Spring.Template.Velocity/Template/Velocity/SpringResourceLoader.cs
  48. +17 −7 src/Spring/Spring.Template.Velocity/Template/Velocity/VelocityEngineFactory.cs
  49. +2 −1  src/Spring/Spring.Template.Velocity/Template/Velocity/VelocityEngineFactoryObject.cs
  50. +3 −1 src/Spring/Spring.Template.Velocity/Template/Velocity/VelocityEngineUtils.cs
  51. +17 −16 src/Spring/Spring.Testing.Microsoft/Testing/Microsoft/AbstractTransactionalDbProviderSpringContextTests.cs
  52. +26 −16 src/Spring/Spring.Testing.Microsoft/Testing/Microsoft/AbstractTransactionalSpringContextTests.cs
  53. +1 −0  src/Spring/Spring.Testing.NUnit/Spring.Testing.NUnit.2010.csproj
  54. +2 −1  src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractTransactionalDbProviderSpringContextTests.cs
  55. +12 −10 src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractTransactionalSpringContextTests.cs
  56. +3 −1 src/Spring/Spring.Web.Conversation.NHibernate32/Spring.Web.Conversation.NHibernate32.2010.csproj
  57. +3 −1 src/Spring/Spring.Web.Conversation.NHibernate33/Spring.Web.Conversation.NHibernate33.2010.csproj
  58. +2 −0  src/Spring/Spring.Web.Extensions/Spring.Web.Extensions.2010.csproj
  59. +2 −1  src/Spring/Spring.Web.Mvc3/Spring.Web.Mvc3.2010.csproj
  60. +2 −1  src/Spring/Spring.Web.Mvc4/Spring.Web.Mvc4.2010.csproj
  61. +2 −2 src/Spring/Spring.Web.Mvc4/SpringMvcDependencyResolver.cs
  62. +2 −1  src/Spring/Spring.Web.Mvc5/Spring.Web.Mvc5.2010.csproj
  63. +4 −6 src/Spring/Spring.Web/Spring.Web.2010.csproj
  64. +6 −4 src/Spring/Spring.Web/Web/Services/WebServiceExporter.cs
  65. +0 −3  test/Spring/Spring.Data.Integration.Tests/Data/OracleAdoTemplateTests.cs
  66. +0 −7 test/Spring/Spring.Web.Conversation.NHibernate32.Tests/Conversation/SerializeConversationTestModule.cs
  67. +3 −13 ...rsation.NHibernate32.Tests/Data/Spring/Conversation/WebConversationStateTest/CircularDependenceTest.aspx.cs
  68. +24 −28 ...ion.NHibernate32.Tests/Data/Spring/Conversation/WebConversationStateTest/ConnectionReleaseModeIssue.aspx.cs
  69. +1 −10 ...ation.NHibernate32.Tests/Data/Spring/Conversation/WebConversationStateTest/EndConversationTestBegin.aspx.cs
  70. +1 −10 ...rsation.NHibernate32.Tests/Data/Spring/Conversation/WebConversationStateTest/EndConversationTestEnd.aspx.cs
  71. +1 −10 ...ibernate32.Tests/Data/Spring/Conversation/WebConversationStateTest/SPCSwitchConversationSameRequest.aspx.cs
  72. +10 −10 test/Spring/Spring.Web.Tests/Util/WebUtilsTests.cs
View
6 BreakingChanges.txt
@@ -1,3 +1,9 @@
+Changes (1.3.2 to 2.0)
+========================
+
+Protected fields were changed to private. Access is now allowed via public/protected property member.
+
+
Changes (1.3.1 to 1.3.2)
========================
View
24 Spring.Net.2010.sln
@@ -99,10 +99,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Web.Conversation.NHi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Web.Conversation.NHibernate33.Tests.2010", "test\Spring\Spring.Web.Conversation.NHibernate33.Tests\Spring.Web.Conversation.NHibernate33.Tests.2010.csproj", "{C57B05EA-FD1A-40EC-BB60-D2E45AB1A86A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Web.Mvc5.2010", "src\Spring\Spring.Web.Mvc5\Spring.Web.Mvc5.2010.csproj", "{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Web.Mvc5.Tests.2010", "test\Spring\Spring.Web.Mvc5.Tests\Spring.Web.Mvc5.Tests.2010.csproj", "{B9590252-6D58-4587-950C-475AB61FDBCF}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{79F495DF-83D6-435E-A20E-47800F6F8FE7}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
@@ -560,26 +556,6 @@ Global
{C57B05EA-FD1A-40EC-BB60-D2E45AB1A86A}.Release|Any CPU.Build.0 = Release|Any CPU
{C57B05EA-FD1A-40EC-BB60-D2E45AB1A86A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{C57B05EA-FD1A-40EC-BB60-D2E45AB1A86A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Debug|.NET.ActiveCfg = Debug|Any CPU
- {39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Release|.NET.ActiveCfg = Release|Any CPU
- {39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Release|Any CPU.Build.0 = Release|Any CPU
- {39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {B9590252-6D58-4587-950C-475AB61FDBCF}.Debug|.NET.ActiveCfg = Debug|Any CPU
- {B9590252-6D58-4587-950C-475AB61FDBCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B9590252-6D58-4587-950C-475AB61FDBCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B9590252-6D58-4587-950C-475AB61FDBCF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {B9590252-6D58-4587-950C-475AB61FDBCF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {B9590252-6D58-4587-950C-475AB61FDBCF}.Release|.NET.ActiveCfg = Release|Any CPU
- {B9590252-6D58-4587-950C-475AB61FDBCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B9590252-6D58-4587-950C-475AB61FDBCF}.Release|Any CPU.Build.0 = Release|Any CPU
- {B9590252-6D58-4587-950C-475AB61FDBCF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {B9590252-6D58-4587-950C-475AB61FDBCF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
19 Spring.Net.2010.sln.DotSettings
@@ -3,6 +3,24 @@
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue">False</s:Boolean>
+ <s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderRegionName/@EntryValue">License</s:String>
+ <s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">&#xD;
+/*&#xD;
+ * Copyright 2002-$CURRENT_YEAR$ the original author or authors.&#xD;
+ *&#xD;
+ * Licensed under the Apache License, Version 2.0 (the "License");&#xD;
+ * you may not use this file except in compliance with the License.&#xD;
+ * You may obtain a copy of the License at&#xD;
+ *&#xD;
+ * http://www.apache.org/licenses/LICENSE-2.0&#xD;
+ *&#xD;
+ * Unless required by applicable law or agreed to in writing, software&#xD;
+ * distributed under the License is distributed on an "AS IS" BASIS,&#xD;
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#xD;
+ * See the License for the specific language governing permissions and&#xD;
+ * limitations under the License.&#xD;
+ */&#xD;
+</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=URL/@EntryIndexedValue"></s:String>
@@ -11,6 +29,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/IdentifierHighlightingEnabled/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">SOLUTION</s:String>
+ <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/TextControl/HighlightCurrentLine/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_IFELSE_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FOR_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
View
4 Spring.include
@@ -237,7 +237,7 @@
</target>
<target name="common.set-assembly-attribute-values" depends="generate-build-number">
- <property name="assembly.is-cls-compliant" value="false" />
+ <property name="assembly.is-cls-compliant" value="true" />
<property name="assembly.configuration" value="${nant.settings.currentframework}.win32; ${current.build.config}"/>
<if test="${nant.settings.currentframework!='mono-2.0'}">
<property name="assembly.product" value="${project.name.full} ${package.version} for .NET ${nant.settings.currentframework.number}" />-->
@@ -273,7 +273,7 @@
<import namespace="System.Reflection" />
</imports>
<attributes>
- <attribute type="CLSCompliantAttribute" value="${assembly.is-cls-compliant}" />
+ <attribute type="CLSCompliantAttribute" value="${assembly.is-cls-compliant}" />
<attribute type="AssemblyConfigurationAttribute" value="${assembly.configuration}" />
<attribute type="AssemblyProductAttribute" value="${assembly.product}" />
<attribute type="AssemblyCompanyAttribute" value="${assembly.company}" />
View
2  common-project.include
@@ -53,7 +53,7 @@ ${current.bin.dir}: the binary directory to output the assembly + app.config to
-->
<target name="common.init" description="Initializes build properties">
- <property name="assembly.is-cls-compliant" value="false" />
+ <property name="assembly.is-cls-compliant" value="true" />
<property name="assembly.version" value="1.0.0.0" />
<property name="assembly.version.informational" value="1.0" />
View
3  src/Spring/CommonAssemblyInfo.cs
@@ -1,6 +1,7 @@
using System;
using System.Reflection;
-[assembly: CLSCompliant(false)]
+
+[assembly: CLSCompliant(true)]
//
// General Information about an assembly is controlled through the following
View
51 src/Spring/Spring.Aop/Aop/Framework/AbstractMethodInvocation.cs
@@ -55,39 +55,39 @@ public abstract class AbstractMethodInvocation : IMethodInvocation
/// The arguments (if any = may be <see lang="null"/>) to the method
/// that is to be invoked.
/// </summary>
- protected object[] arguments;
+ private object[] arguments;
/// <summary>
/// The target object that the method is to be invoked on.
/// </summary>
- protected object target;
+ private readonly object target;
/// <summary>
/// The AOP proxy for the target object.
/// </summary>
- protected object proxy;
+ private object proxy;
/// <summary>
/// The method invocation that is to be invoked.
/// </summary>
- protected MethodInfo method;
+ private MethodInfo method;
/// <summary>
/// The list of <see cref="AopAlliance.Intercept.IMethodInterceptor"/> and
/// <cref see="Spring.Aop.Framework.InterceptorAndDynamicMethodMatcher"/>
/// that need dynamic checks.
/// </summary>
- protected IList interceptors;
+ private IList interceptors;
/// <summary>
/// The declaring type of the method that is to be invoked.
/// </summary>
- protected Type targetType;
+ private Type targetType;
/// <summary>
/// The index from 0 of the current interceptor we're invoking.
/// </summary>
- protected int currentInterceptorIndex;
+ private int currentInterceptorIndex;
/// <summary>
/// Creates a new instance of the
@@ -128,16 +128,11 @@ public abstract class AbstractMethodInvocation : IMethodInvocation
protected AbstractMethodInvocation(object proxy, object target,
MethodInfo method, object[] arguments, Type targetType, IList interceptors)
{
- #region Sanity Check
-
- // EE: There is not necessarily always a target - e.g. for DynamicEntities
+ // EE: There is not necessarily always a target - e.g. for DynamicEntities
// moved this check to InvokeJoinpoint()
-// AssertUtils.ArgumentNotNull(target, "target");
AssertUtils.ArgumentNotNull(method, "method");
- #endregion
-
- this.proxy = proxy;
+ this.proxy = proxy;
this.target = target;
this.method = method;
this.targetType = targetType;
@@ -157,10 +152,11 @@ public abstract class AbstractMethodInvocation : IMethodInvocation
/// <see cref="AopAlliance.Intercept.IMethodInvocation.Method"/>
public virtual MethodInfo Method
{
- get { return method; }
- }
+ get { return method; }
+ protected set { method = value; }
+ }
- /// <summary>
+ /// <summary>
/// Gets the static part of this joinpoint.
/// </summary>
/// <value>
@@ -181,6 +177,7 @@ public virtual MemberInfo StaticPart
public virtual object Proxy
{
get { return this.proxy; }
+ protected set { this.proxy = value; }
}
/// <summary>
/// Gets the target object for the invocation.
@@ -200,7 +197,8 @@ public virtual object Target
/// </value>
public virtual Type TargetType
{
- get { return this.targetType; }
+ get { return this.targetType; }
+ protected set { this.targetType = value; }
}
/// <summary>
@@ -240,7 +238,16 @@ public virtual object This
get { return this.target; }
}
- /// <summary>
+ /// <summary>
+ /// The index from 0 of the current interceptor we're invoking.
+ /// </summary>
+ protected int CurrentInterceptorIndex
+ {
+ get { return currentInterceptorIndex; }
+ set { currentInterceptorIndex = value; }
+ }
+
+ /// <summary>
/// Proceeds to the next interceptor in the chain.
/// </summary>
/// <returns>
@@ -357,15 +364,15 @@ public override string ToString()
{
StringBuilder buffer = new StringBuilder("Invocation: method '");
buffer.Append(Method.Name).Append("', ").Append("arguments ");
- buffer.Append(this.arguments != null ? StringUtils.CollectionToCommaDelimitedString(this.arguments) : "[none]");
+ buffer.Append(Arguments != null ? StringUtils.CollectionToCommaDelimitedString(Arguments) : "[none]");
buffer.Append("; ");
- if (this.target == null)
+ if (Target == null)
{
buffer.Append("target is null.");
}
else
{
- buffer.Append("target is of Type [").Append(this.targetType.FullName).Append(']');
+ buffer.Append("target is of Type [").Append(TargetType.FullName).Append(']');
}
return buffer.ToString();
}
View
22 src/Spring/Spring.Aop/Aop/Framework/DynamicMethodInvocation.cs
@@ -44,7 +44,7 @@ public class DynamicMethodInvocation : AbstractMethodInvocation
/// <summary>
/// The method invocation that is to be invoked on the proxy.
/// </summary>
- protected MethodInfo proxyMethod;
+ private MethodInfo proxyMethod;
/// <summary>
/// Creates a new instance of the
@@ -74,6 +74,15 @@ public class DynamicMethodInvocation : AbstractMethodInvocation
}
/// <summary>
+ /// The method invocation that is to be invoked on the proxy.
+ /// </summary>
+ protected MethodInfo ProxyMethod
+ {
+ get { return proxyMethod; }
+ set { proxyMethod = value; }
+ }
+
+ /// <summary>
/// Invokes the joinpoint using dynamic reflection.
/// </summary>
/// <remarks>
@@ -90,14 +99,14 @@ public class DynamicMethodInvocation : AbstractMethodInvocation
/// <see cref="Spring.Aop.Framework.AbstractMethodInvocation.InvokeJoinpoint"/>
protected override object InvokeJoinpoint()
{
- MethodInfo targetMethodInfo = ((this.proxyMethod == null)) ? method : this.proxyMethod;
+ MethodInfo targetMethodInfo = this.proxyMethod ?? Method;
IDynamicMethod targetMethod = new SafeMethod(targetMethodInfo);
try
{
- AssertUtils.Understands(target, "target", targetMethodInfo);
- return targetMethod.Invoke(target, arguments);
+ AssertUtils.Understands(Target, "target", targetMethodInfo);
+ return targetMethod.Invoke(Target, Arguments);
}
// Only happens if fallback to standard reflection.
catch (TargetInvocationException ex)
@@ -119,9 +128,8 @@ protected override object InvokeJoinpoint()
/// </returns>
protected override IMethodInvocation PrepareMethodInvocationForProceed(IMethodInvocation invocation)
{
- DynamicMethodInvocation rmi = new DynamicMethodInvocation(
- this.proxy, this.target, this.method, this.proxyMethod, this.arguments, this.targetType, this.interceptors);
- rmi.currentInterceptorIndex = this.currentInterceptorIndex + 1;
+ var rmi = new DynamicMethodInvocation(Proxy, Target, Method, ProxyMethod, Arguments, TargetType, Interceptors);
+ rmi.CurrentInterceptorIndex = CurrentInterceptorIndex + 1;
return rmi;
}
View
24 src/Spring/Spring.Aop/Aop/Framework/ReflectiveMethodInvocation.cs
@@ -44,7 +44,7 @@ public class ReflectiveMethodInvocation : AbstractMethodInvocation
/// <summary>
/// The method invocation that is to be invoked on the proxy.
/// </summary>
- protected MethodInfo proxyMethod;
+ private MethodInfo proxyMethod;
/// <summary>
/// Creates a new instance of the
@@ -73,7 +73,16 @@ public class ReflectiveMethodInvocation : AbstractMethodInvocation
this.proxyMethod = proxyMethod;
}
- /// <summary>
+ /// <summary>
+ /// The method invocation that is to be invoked on the proxy.
+ /// </summary>
+ protected MethodInfo ProxyMethod
+ {
+ get { return proxyMethod; }
+ set { proxyMethod = value; }
+ }
+
+ /// <summary>
/// Invokes the joinpoint using standard reflection.
/// </summary>
/// <remarks>
@@ -92,10 +101,10 @@ protected override object InvokeJoinpoint()
{
try
{
- MethodInfo targetMethodInfo = ((this.proxyMethod == null)) ? method : this.proxyMethod;
+ MethodInfo targetMethodInfo = ProxyMethod ?? Method;
- AssertUtils.Understands(target, "target", targetMethodInfo);
- return targetMethodInfo.Invoke(target, arguments);
+ AssertUtils.Understands(Target, "target", targetMethodInfo);
+ return targetMethodInfo.Invoke(Target, Arguments);
}
catch (TargetInvocationException ex)
{
@@ -116,9 +125,8 @@ protected override object InvokeJoinpoint()
/// </returns>
protected override IMethodInvocation PrepareMethodInvocationForProceed(IMethodInvocation invocation)
{
- ReflectiveMethodInvocation rmi = new ReflectiveMethodInvocation(
- this.proxy, this.target, this.method, this.proxyMethod, this.arguments, this.targetType, this.interceptors);
- rmi.currentInterceptorIndex = this.currentInterceptorIndex + 1;
+ var rmi = new ReflectiveMethodInvocation(Proxy, Target, Method, ProxyMethod, Arguments, TargetType, Interceptors);
+ rmi.CurrentInterceptorIndex = CurrentInterceptorIndex + 1;
return rmi;
}
View
2  src/Spring/Spring.Aop/Spring.Aop.2010.csproj
@@ -85,7 +85,7 @@
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
View
11 src/Spring/Spring.Core/Context/Attributes/AssemblyTypeScanner.cs
@@ -84,16 +84,19 @@ public abstract class AssemblyTypeScanner : IAssemblyTypeScanner
/// <summary>
/// Stores the object default definitons defined in the XML configuration documnet
/// </summary>
- protected DocumentDefaultsDefinition _defaults;
+ private DocumentDefaultsDefinition _defaults;
-
- protected string _scanStartFolderPath;
+ private string _scanStartFolderPath;
/// <summary>
/// Stores the object default definitons defined in the XML configuration documnet
/// </summary>
- public DocumentDefaultsDefinition Defaults { get { return _defaults; } set { _defaults = value; } }
+ public DocumentDefaultsDefinition Defaults
+ {
+ get { return _defaults; }
+ set { _defaults = value; }
+ }
public string ScanStartFolderPath
{
View
9 src/Spring/Spring.Core/Context/Attributes/DependsOnAttribute.cs
@@ -44,7 +44,14 @@ public class DependsOnAttribute : Attribute
/// <summary>
/// Initializes a new instance of the DependsOn class.
/// </summary>
- /// <param name="name"></param>
+ public DependsOnAttribute(string name)
+ : this(new[] { name })
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the DependsOn class.
+ /// </summary>
public DependsOnAttribute(params string[] name)
{
_name = name;
View
7 src/Spring/Spring.Core/Context/Attributes/ImportAttribute.cs
@@ -37,6 +37,13 @@ namespace Spring.Context.Attributes
public class ImportAttribute : Attribute
{
private Type[] _types;
+
+ /// <summary>
+ /// Initializes a new instance of the Import class.
+ /// </summary>
+ public ImportAttribute(Type type) : this(new []{ type })
+ {
+ }
/// <summary>
/// Initializes a new instance of the Import class.
View
1  src/Spring/Spring.Core/Expressions/BinaryOperator.cs
@@ -74,6 +74,7 @@ protected object GetLeftValue(object context, EvaluationContext evalContext)
/// Gets the right operand.
/// </summary>
/// <value>The right operand.</value>
+ [CLSCompliant(false)]
public BaseNode Right
{
get { return (BaseNode) this.getFirstChild().getNextSibling(); }
View
1,230 src/Spring/Spring.Core/Expressions/Parser/antlr/BaseAST.cs
@@ -1,617 +1,617 @@
-using System;
+using System;
using Spring.Expressions.Parser.antlr.collections;
-using StringBuilder = System.Text.StringBuilder;
-using ISerializable = System.Runtime.Serialization.ISerializable;
-using TextWriter = System.IO.TextWriter;
-using ArrayList = System.Collections.ArrayList;
-using IEnumerator = System.Collections.IEnumerator;
-
-using AST = Spring.Expressions.Parser.antlr.collections.AST;
-
-namespace Spring.Expressions.Parser.antlr
-{
- /*ANTLR Translator Generator
- * Project led by Terence Parr at http://www.jGuru.com
- * Software rights: http://www.antlr.org/license.html
- *
- * $Id:$
- */
-
- //
- // ANTLR C# Code Generator by Micheal Jordan
- // Kunle Odutola : kunle UNDERSCORE odutola AT hotmail DOT com
- // Anthony Oguntimehin
- //
- // With many thanks to Eric V. Smith from the ANTLR list.
- //
-
- /*
- * A Child-Sibling Tree.
- *
- * A tree with PLUS at the root and with two children 3 and 4 is
- * structured as:
- *
- * PLUS
- * |
- * 3 -- 4
- *
- * and can be specified easily in LISP notation as
- *
- * (PLUS 3 4)
- *
- * where every '(' starts a new subtree.
- *
- * These trees are particular useful for translators because of
- * the flexibility of the children lists. They are also very easy
- * to walk automatically, whereas trees with specific children
- * reference fields can't easily be walked automatically.
- *
- * This class contains the basic support for an AST.
- * Most people will create ASTs that are subclasses of
- * BaseAST or of CommonAST.
- */
- [Serializable()]
- public abstract class BaseAST : AST
- {
- protected internal BaseAST down;
- protected internal BaseAST right;
-
- private static bool verboseStringConversion = false;
- private static string[] tokenNames = null;
-
- /*Add a node to the end of the child list for this node */
- public virtual void addChild(AST node)
- {
- if (node == null)
- return ;
- BaseAST t = this.down;
- if (t != null)
- {
- while (t.right != null)
- {
- t = t.right;
- }
- t.right = (BaseAST) node;
- }
- else
- {
- this.down = (BaseAST) node;
- }
- }
-
- private void doWorkForFindAll(ArrayList v, AST target, bool partialMatch)
- {
- AST sibling;
-
- // Start walking sibling lists, looking for matches.
-//siblingWalk:
- for (sibling = this; sibling != null; sibling = sibling.getNextSibling())
- {
- if ((partialMatch && sibling.EqualsTreePartial(target)) || (!partialMatch && sibling.EqualsTree(target)))
- {
- v.Add(sibling);
- }
- // regardless of match or not, check any children for matches
- if (sibling.getFirstChild() != null)
- {
- ((BaseAST) sibling.getFirstChild()).doWorkForFindAll(v, target, partialMatch);
- }
- }
- }
-
- public override bool Equals(object obj)
- {
- if (obj == null)
- return false;
- if (this.GetType() != obj.GetType())
- return false;
- return Equals((AST)obj);
- }
-
- /*Is node t equal to this in terms of token type and text? */
- public virtual bool Equals(AST t)
- {
- if (t == null)
- return false;
-
- return (Object.Equals(this.getText(), t.getText())) &&
- (this.Type == t.Type);
- }
-
- /*Is t an exact structural and equals() match of this tree. The
- * 'this' reference is considered the start of a sibling list.
- */
- public virtual bool EqualsList(AST t)
- {
- AST sibling;
-
- // the empty tree is not a match of any non-null tree.
- if (t == null)
- {
- return false;
- }
-
- // Otherwise, start walking sibling lists. First mismatch, return false.
- for (sibling = this; sibling != null && t != null; sibling = sibling.getNextSibling(), t = t.getNextSibling())
- {
- // as a quick optimization, check roots first.
- if (!sibling.Equals(t))
- {
- return false;
- }
- // if roots match, do full list match test on children.
- if (sibling.getFirstChild() != null)
- {
- if (!sibling.getFirstChild().EqualsList(t.getFirstChild()))
- {
- return false;
- }
- }
- else if (t.getFirstChild() != null)
- {
- return false;
- }
- }
- if (sibling == null && t == null)
- {
- return true;
- }
- // one sibling list has more than the other
- return false;
- }
-
- /*Is 'sub' a subtree of this list?
- * The siblings of the root are NOT ignored.
- */
- public virtual bool EqualsListPartial(AST sub)
- {
- AST sibling;
-
- // the empty tree is always a subset of any tree.
- if (sub == null)
- {
- return true;
- }
-
- // Otherwise, start walking sibling lists. First mismatch, return false.
- for (sibling = this; sibling != null && sub != null; sibling = sibling.getNextSibling(), sub = sub.getNextSibling())
- {
- // as a quick optimization, check roots first.
- if (!sibling.Equals(sub))
- return false;
- // if roots match, do partial list match test on children.
- if (sibling.getFirstChild() != null)
- {
- if (!sibling.getFirstChild().EqualsListPartial(sub.getFirstChild()))
- return false;
- }
- }
- if (sibling == null && sub != null)
- {
- // nothing left to match in this tree, but subtree has more
- return false;
- }
- // either both are null or sibling has more, but subtree doesn't
- return true;
- }
-
- /*Is tree rooted at 'this' equal to 't'? The siblings
- * of 'this' are ignored.
- */
- public virtual bool EqualsTree(AST t)
- {
- // check roots first.
- if (!this.Equals(t))
- return false;
- // if roots match, do full list match test on children.
- if (this.getFirstChild() != null)
- {
- if (!this.getFirstChild().EqualsList(t.getFirstChild()))
- return false;
- }
- else if (t.getFirstChild() != null)
- {
- return false;
- }
- return true;
- }
-
- /*Is 't' a subtree of the tree rooted at 'this'? The siblings
- * of 'this' are ignored.
- */
- public virtual bool EqualsTreePartial(AST sub)
- {
- // the empty tree is always a subset of any tree.
- if (sub == null)
- {
- return true;
- }
-
- // check roots first.
- if (!this.Equals(sub))
- return false;
- // if roots match, do full list partial match test on children.
- if (this.getFirstChild() != null)
- {
- if (!this.getFirstChild().EqualsListPartial(sub.getFirstChild()))
- return false;
- }
- return true;
- }
-
- /*Walk the tree looking for all exact subtree matches. Return
- * an IEnumerator that lets the caller walk the list
- * of subtree roots found herein.
- */
- public virtual IEnumerator findAll(AST target)
- {
- ArrayList roots = new ArrayList(10);
- //AST sibling;
-
- // the empty tree cannot result in an enumeration
- if (target == null)
- {
- return null;
- }
-
- doWorkForFindAll(roots, target, false); // find all matches recursively
-
- return roots.GetEnumerator();
- }
-
- /*Walk the tree looking for all subtrees. Return
- * an IEnumerator that lets the caller walk the list
- * of subtree roots found herein.
- */
- public virtual IEnumerator findAllPartial(AST sub)
- {
- ArrayList roots = new ArrayList(10);
- //AST sibling;
-
- // the empty tree cannot result in an enumeration
- if (sub == null)
- {
- return null;
- }
-
- doWorkForFindAll(roots, sub, true); // find all matches recursively
-
- return roots.GetEnumerator();
- }
-
- /*Get the first child of this node; null if not children */
- public virtual AST getFirstChild()
- {
- return down;
- }
-
- /*Get the next sibling in line after this one */
- public virtual AST getNextSibling()
- {
- return right;
- }
-
- /*Get the token text for this node */
- public virtual string getText()
- {
- return "";
- }
-
- /*Get the token type for this node */
- public virtual int Type
- {
- get { return 0; }
- set { ; }
- }
-
- /// <summary>
- /// Get number of children of this node; if leaf, returns 0
- /// </summary>
- /// <returns>Number of children</returns>
- public int getNumberOfChildren()
- {
- BaseAST t = this.down;
- int n = 0;
- if (t != null)
- {
- n = 1;
- while (t.right != null)
- {
- t = t.right;
- n++;
- }
- }
- return n;
- }
-
- public abstract void initialize(int t, string txt);
-
- public abstract void initialize(AST t);
-
- public abstract void initialize(IToken t);
-
- /*Remove all children */
- public virtual void removeChildren()
- {
- down = null;
- }
-
- public virtual void setFirstChild(AST c)
- {
- down = (BaseAST) c;
- }
-
- public virtual void setNextSibling(AST n)
- {
- right = (BaseAST) n;
- }
-
- /*Set the token text for this node */
- public virtual void setText(string text)
- {
- ;
- }
-
- /*Set the token type for this node */
- public virtual void setType(int ttype)
- {
- this.Type = ttype;
- }
-
- public static void setVerboseStringConversion(bool verbose, string[] names)
- {
- verboseStringConversion = verbose;
- tokenNames = names;
- }
-
- override public string ToString()
- {
- StringBuilder b = new StringBuilder();
- // if verbose and type name not same as text (keyword probably)
- if (verboseStringConversion &&
- (0 != String.Compare(getText(), (tokenNames[Type]), true)) &&
- (0 != String.Compare(getText(), StringUtils.stripFrontBack(tokenNames[Type], @"""", @""""), true)))
- {
- b.Append('[');
- b.Append(getText());
- b.Append(",<");
- b.Append(tokenNames[Type]);
- b.Append(">]");
- return b.ToString();
- }
- return getText();
- }
-
- /*Print out a child-sibling tree in LISP notation */
- public virtual string ToStringList()
- {
- AST t = this;
- string ts = "";
- if (t.getFirstChild() != null)
- ts += " (";
- ts += " " + this.ToString();
- if (t.getFirstChild() != null)
- {
- ts += ((BaseAST) t.getFirstChild()).ToStringList();
- }
- if (t.getFirstChild() != null)
- ts += " )";
- if (t.getNextSibling() != null)
- {
- ts += ((BaseAST) t.getNextSibling()).ToStringList();
- }
- return ts;
- }
-
- public virtual string ToStringTree()
- {
- AST t = this;
- string ts = "";
- if (t.getFirstChild() != null)
- {
- ts += " (";
- }
- ts += " " + this.ToString();
- if (t.getFirstChild() != null)
- {
- ts += ((BaseAST) t.getFirstChild()).ToStringList();
- }
- if (t.getFirstChild() != null)
- {
- ts += " )";
- }
- return ts;
- }
-
- public virtual string ToTree()
- {
- return ToTree(string.Empty);
- }
-
- public virtual string ToTree(string prefix)
- {
- StringBuilder sb = new StringBuilder(prefix);
-
- // Replace vertical bar if there is no next sibling.
- if ( (getNextSibling() == null) )
- sb.Append("+--");
- else
- sb.Append("|--");
-
- sb.Append( ToString() );
- sb.Append( Environment.NewLine );
-
- if ( getFirstChild() != null )
- {
- // Replace vertical bar if there is no next sibling.
- if ( getNextSibling() == null )
- sb.Append( ((BaseAST) getFirstChild()).ToTree(prefix + " ") );
- else
- sb.Append( ((BaseAST) getFirstChild()).ToTree(prefix + "| ") );
- }
-
- if ( getNextSibling() != null )
- sb.Append( ((BaseAST) getNextSibling()).ToTree(prefix) );
-
- return sb.ToString();
- }
-
- public static string decode(string text)
- {
- char c, c1, c2, c3, c4, c5;
- StringBuilder n = new StringBuilder();
- for (int i = 0; i < text.Length; i++)
- {
- c = text[i];
- if (c == '&')
- {
- c1 = text[i + 1];
- c2 = text[i + 2];
- c3 = text[i + 3];
- c4 = text[i + 4];
- c5 = text[i + 5];
-
- if (c1 == 'a' && c2 == 'm' && c3 == 'p' && c4 == ';')
- {
- n.Append("&");
- i += 5;
- }
- else if (c1 == 'l' && c2 == 't' && c3 == ';')
- {
- n.Append("<");
- i += 4;
- }
- else if (c1 == 'g' && c2 == 't' && c3 == ';')
- {
- n.Append(">");
- i += 4;
- }
- else if (c1 == 'q' && c2 == 'u' && c3 == 'o' && c4 == 't' && c5 == ';')
- {
- n.Append("\"");
- i += 6;
- }
- else if (c1 == 'a' && c2 == 'p' && c3 == 'o' && c4 == 's' && c5 == ';')
- {
- n.Append("'");
- i += 6;
- }
- else
- n.Append("&");
- }
- else
- n.Append(c);
- }
- return n.ToString();
- }
-
- public static string encode(string text)
- {
- char c;
- StringBuilder n = new StringBuilder();
- for (int i = 0; i < text.Length; i++)
- {
- c = text[i];
- switch (c)
- {
- case '&':
- {
- n.Append("&amp;");
- break;
- }
-
- case '<':
- {
- n.Append("&lt;");
- break;
- }
-
- case '>':
- {
- n.Append("&gt;");
- break;
- }
-
- case '"':
- {
- n.Append("&quot;");
- break;
- }
-
- case '\'':
- {
- n.Append("&apos;");
- break;
- }
-
- default:
- {
- n.Append(c);
- break;
- }
-
- }
- }
- return n.ToString();
- }
-
- public virtual void xmlSerializeNode(TextWriter outWriter)
- {
- StringBuilder buf = new StringBuilder(100);
- buf.Append("<");
- buf.Append(GetType().FullName + " ");
- buf.Append("text=\"" + encode(getText()) + "\" type=\"" + Type + "\"/>");
- outWriter.Write(buf.ToString());
- }
-
- public virtual void xmlSerializeRootOpen(TextWriter outWriter)
- {
- StringBuilder buf = new StringBuilder(100);
- buf.Append("<");
- buf.Append(GetType().FullName + " ");
- buf.Append("text=\"" + encode(getText()) + "\" type=\"" + Type + "\">\n");
- outWriter.Write(buf.ToString());
- }
-
- public virtual void xmlSerializeRootClose(TextWriter outWriter)
- {
- outWriter.Write("</" + GetType().FullName + ">\n");
- }
-
- public virtual void xmlSerialize(TextWriter outWriter)
- {
- // print out this node and all siblings
- for (AST node = this; node != null; node = node.getNextSibling())
- {
- if (node.getFirstChild() == null)
- {
- // print guts (class name, attributes)
- ((BaseAST) node).xmlSerializeNode(outWriter);
- }
- else
- {
- ((BaseAST) node).xmlSerializeRootOpen(outWriter);
-
- // print children
- ((BaseAST) node.getFirstChild()).xmlSerialize(outWriter);
-
- // print end tag
- ((BaseAST) node).xmlSerializeRootClose(outWriter);
- }
- }
- }
-
- #region Implementation of ICloneable
- [Obsolete("Deprecated since version 2.7.2. Use ASTFactory.dup() instead.", false)]
- public virtual object Clone()
- {
- return MemberwiseClone();
- }
- #endregion
-
- public override Int32 GetHashCode()
- {
- return base.GetHashCode();
- }
- }
+using StringBuilder = System.Text.StringBuilder;
+using ISerializable = System.Runtime.Serialization.ISerializable;
+using TextWriter = System.IO.TextWriter;
+using ArrayList = System.Collections.ArrayList;
+using IEnumerator = System.Collections.IEnumerator;
+
+using AST = Spring.Expressions.Parser.antlr.collections.AST;
+
+namespace Spring.Expressions.Parser.antlr
+{
+ /*ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id:$
+ */
+
+ //
+ // ANTLR C# Code Generator by Micheal Jordan
+ // Kunle Odutola : kunle UNDERSCORE odutola AT hotmail DOT com
+ // Anthony Oguntimehin
+ //
+ // With many thanks to Eric V. Smith from the ANTLR list.
+ //
+
+ /*
+ * A Child-Sibling Tree.
+ *
+ * A tree with PLUS at the root and with two children 3 and 4 is
+ * structured as:
+ *
+ * PLUS
+ * |
+ * 3 -- 4
+ *
+ * and can be specified easily in LISP notation as
+ *
+ * (PLUS 3 4)
+ *
+ * where every '(' starts a new subtree.
+ *
+ * These trees are particular useful for translators because of
+ * the flexibility of the children lists. They are also very easy
+ * to walk automatically, whereas trees with specific children
+ * reference fields can't easily be walked automatically.
+ *
+ * This class contains the basic support for an AST.
+ * Most people will create ASTs that are subclasses of
+ * BaseAST or of CommonAST.
+ */
+ [Serializable()]
+ public abstract class BaseAST : AST
+ {
+ protected internal BaseAST down;
+ protected internal BaseAST right;
+
+ private static bool verboseStringConversion = false;
+ private static string[] tokenNames = null;
+
+ /*Add a node to the end of the child list for this node */
+ public virtual void addChild(AST node)
+ {
+ if (node == null)
+ return ;
+ BaseAST t = this.down;
+ if (t != null)
+ {
+ while (t.right != null)
+ {
+ t = t.right;
+ }
+ t.right = (BaseAST) node;
+ }
+ else
+ {
+ this.down = (BaseAST) node;
+ }
+ }
+
+ private void doWorkForFindAll(ArrayList v, AST target, bool partialMatch)
+ {
+ AST sibling;
+
+ // Start walking sibling lists, looking for matches.
+//siblingWalk:
+ for (sibling = this; sibling != null; sibling = sibling.getNextSibling())
+ {
+ if ((partialMatch && sibling.EqualsTreePartial(target)) || (!partialMatch && sibling.EqualsTree(target)))
+ {
+ v.Add(sibling);
+ }
+ // regardless of match or not, check any children for matches
+ if (sibling.getFirstChild() != null)
+ {
+ ((BaseAST) sibling.getFirstChild()).doWorkForFindAll(v, target, partialMatch);
+ }
+ }
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj == null)
+ return false;
+ if (this.GetType() != obj.GetType())
+ return false;
+ return Equals((AST)obj);
+ }
+
+ /*Is node t equal to this in terms of token type and text? */
+ public virtual bool Equals(AST t)
+ {
+ if (t == null)
+ return false;
+
+ return (Object.Equals(this.getText(), t.getText())) &&
+ (this.Type == t.Type);
+ }
+
+ /*Is t an exact structural and equals() match of this tree. The
+ * 'this' reference is considered the start of a sibling list.
+ */
+ public virtual bool EqualsList(AST t)
+ {
+ AST sibling;
+
+ // the empty tree is not a match of any non-null tree.
+ if (t == null)
+ {
+ return false;
+ }
+
+ // Otherwise, start walking sibling lists. First mismatch, return false.
+ for (sibling = this; sibling != null && t != null; sibling = sibling.getNextSibling(), t = t.getNextSibling())
+ {
+ // as a quick optimization, check roots first.
+ if (!sibling.Equals(t))
+ {
+ return false;
+ }
+ // if roots match, do full list match test on children.
+ if (sibling.getFirstChild() != null)
+ {
+ if (!sibling.getFirstChild().EqualsList(t.getFirstChild()))
+ {
+ return false;
+ }
+ }
+ else if (t.getFirstChild() != null)
+ {
+ return false;
+ }
+ }
+ if (sibling == null && t == null)
+ {
+ return true;
+ }
+ // one sibling list has more than the other
+ return false;
+ }
+
+ /*Is 'sub' a subtree of this list?
+ * The siblings of the root are NOT ignored.
+ */
+ public virtual bool EqualsListPartial(AST sub)
+ {
+ AST sibling;
+
+ // the empty tree is always a subset of any tree.
+ if (sub == null)
+ {
+ return true;
+ }
+
+ // Otherwise, start walking sibling lists. First mismatch, return false.
+ for (sibling = this; sibling != null && sub != null; sibling = sibling.getNextSibling(), sub = sub.getNextSibling())
+ {
+ // as a quick optimization, check roots first.
+ if (!sibling.Equals(sub))
+ return false;
+ // if roots match, do partial list match test on children.
+ if (sibling.getFirstChild() != null)
+ {
+ if (!sibling.getFirstChild().EqualsListPartial(sub.getFirstChild()))
+ return false;
+ }
+ }
+ if (sibling == null && sub != null)
+ {
+ // nothing left to match in this tree, but subtree has more
+ return false;
+ }
+ // either both are null or sibling has more, but subtree doesn't
+ return true;
+ }
+
+ /*Is tree rooted at 'this' equal to 't'? The siblings
+ * of 'this' are ignored.
+ */
+ public virtual bool EqualsTree(AST t)
+ {
+ // check roots first.
+ if (!this.Equals(t))
+ return false;
+ // if roots match, do full list match test on children.
+ if (this.getFirstChild() != null)
+ {
+ if (!this.getFirstChild().EqualsList(t.getFirstChild()))
+ return false;
+ }
+ else if (t.getFirstChild() != null)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /*Is 't' a subtree of the tree rooted at 'this'? The siblings
+ * of 'this' are ignored.
+ */
+ public virtual bool EqualsTreePartial(AST sub)
+ {
+ // the empty tree is always a subset of any tree.
+ if (sub == null)
+ {
+ return true;
+ }
+
+ // check roots first.
+ if (!this.Equals(sub))
+ return false;
+ // if roots match, do full list partial match test on children.
+ if (this.getFirstChild() != null)
+ {
+ if (!this.getFirstChild().EqualsListPartial(sub.getFirstChild()))
+ return false;
+ }
+ return true;
+ }
+
+ /*Walk the tree looking for all exact subtree matches. Return
+ * an IEnumerator that lets the caller walk the list
+ * of subtree roots found herein.
+ */
+ public virtual IEnumerator findAll(AST target)
+ {
+ ArrayList roots = new ArrayList(10);
+ //AST sibling;
+
+ // the empty tree cannot result in an enumeration
+ if (target == null)
+ {
+ return null;
+ }
+
+ doWorkForFindAll(roots, target, false); // find all matches recursively
+
+ return roots.GetEnumerator();
+ }
+
+ /*Walk the tree looking for all subtrees. Return
+ * an IEnumerator that lets the caller walk the list
+ * of subtree roots found herein.
+ */
+ public virtual IEnumerator findAllPartial(AST sub)
+ {
+ ArrayList roots = new ArrayList(10);
+ //AST sibling;
+
+ // the empty tree cannot result in an enumeration
+ if (sub == null)
+ {
+ return null;
+ }
+
+ doWorkForFindAll(roots, sub, true); // find all matches recursively
+
+ return roots.GetEnumerator();
+ }
+
+ /*Get the first child of this node; null if not children */
+ public virtual AST getFirstChild()
+ {
+ return down;
+ }
+
+ /*Get the next sibling in line after this one */
+ public virtual AST getNextSibling()
+ {
+ return right;
+ }
+
+ /*Get the token text for this node */
+ public virtual string getText()
+ {
+ return "";
+ }
+
+ /*Get the token type for this node */
+ public virtual int Type
+ {
+ get { return 0; }
+ set { ; }
+ }
+
+ /// <summary>
+ /// Get number of children of this node; if leaf, returns 0
+ /// </summary>
+ /// <returns>Number of children</returns>
+ public int getNumberOfChildren()
+ {
+ BaseAST t = this.down;
+ int n = 0;
+ if (t != null)
+ {
+ n = 1;
+ while (t.right != null)
+ {
+ t = t.right;
+ n++;
+ }
+ }
+ return n;
+ }
+
+ public abstract void initialize(int t, string txt);
+
+ public abstract void initialize(AST t);
+
+ public abstract void initialize(IToken t);
+
+ /*Remove all children */
+ public virtual void removeChildren()
+ {
+ down = null;
+ }
+
+ public virtual void setFirstChild(AST c)
+ {
+ down = (BaseAST) c;
+ }
+
+ public virtual void setNextSibling(AST n)
+ {
+ right = (BaseAST) n;
+ }
+
+ /*Set the token text for this node */
+ public virtual void setText(string text)
+ {
+ ;
+ }
+
+ /*Set the token type for this node */
+ public virtual void setType(int ttype)
+ {
+ this.Type = ttype;
+ }
+
+ public static void setVerboseStringConversion(bool verbose, string[] names)
+ {
+ verboseStringConversion = verbose;
+ tokenNames = names;
+ }
+
+ override public string ToString()
+ {
+ StringBuilder b = new StringBuilder();
+ // if verbose and type name not same as text (keyword probably)
+ if (verboseStringConversion &&
+ (0 != String.Compare(getText(), (tokenNames[Type]), true)) &&
+ (0 != String.Compare(getText(), StringUtils.stripFrontBack(tokenNames[Type], @"""", @""""), true)))
+ {
+ b.Append('[');
+ b.Append(getText());
+ b.Append(",<");
+ b.Append(tokenNames[Type]);
+ b.Append(">]");
+ return b.ToString();
+ }
+ return getText();
+ }
+
+ /*Print out a child-sibling tree in LISP notation */
+ public virtual string ToStringList()
+ {
+ AST t = this;
+ string ts = "";
+ if (t.getFirstChild() != null)
+ ts += " (";
+ ts += " " + this.ToString();
+ if (t.getFirstChild() != null)
+ {
+ ts += ((BaseAST) t.getFirstChild()).ToStringList();
+ }
+ if (t.getFirstChild() != null)
+ ts += " )";
+ if (t.getNextSibling() != null)
+ {
+ ts += ((BaseAST) t.getNextSibling()).ToStringList();
+ }
+ return ts;
+ }
+
+ public virtual string ToStringTree()
+ {
+ AST t = this;
+ string ts = "";
+ if (t.getFirstChild() != null)
+ {
+ ts += " (";
+ }
+ ts += " " + this.ToString();
+ if (t.getFirstChild() != null)
+ {
+ ts += ((BaseAST) t.getFirstChild()).ToStringList();
+ }
+ if (t.getFirstChild() != null)
+ {
+ ts += " )";
+ }
+ return ts;
+ }
+
+ public virtual string ToTree()
+ {
+ return ToTree(string.Empty);
+ }
+
+ public virtual string ToTree(string prefix)
+ {
+ StringBuilder sb = new StringBuilder(prefix);
+
+ // Replace vertical bar if there is no next sibling.
+ if ( (getNextSibling() == null) )
+ sb.Append("+--");
+ else
+ sb.Append("|--");
+
+ sb.Append( ToString() );
+ sb.Append( Environment.NewLine );
+
+ if ( getFirstChild() != null )
+ {
+ // Replace vertical bar if there is no next sibling.
+ if ( getNextSibling() == null )
+ sb.Append( ((BaseAST) getFirstChild()).ToTree(prefix + " ") );
+ else
+ sb.Append( ((BaseAST) getFirstChild()).ToTree(prefix + "| ") );
+ }
+
+ if ( getNextSibling() != null )
+ sb.Append( ((BaseAST) getNextSibling()).ToTree(prefix) );
+
+ return sb.ToString();
+ }
+
+ public static string decode(string text)
+ {
+ char c, c1, c2, c3, c4, c5;
+ StringBuilder n = new StringBuilder();
+ for (int i = 0; i < text.Length; i++)
+ {
+ c = text[i];
+ if (c == '&')
+ {
+ c1 = text[i + 1];
+ c2 = text[i + 2];
+ c3 = text[i + 3];
+ c4 = text[i + 4];
+ c5 = text[i + 5];
+
+ if (c1 == 'a' && c2 == 'm' && c3 == 'p' && c4 == ';')
+ {
+ n.Append("&");
+ i += 5;
+ }
+ else if (c1 == 'l' && c2 == 't' && c3 == ';')
+ {
+ n.Append("<");
+ i += 4;
+ }
+ else if (c1 == 'g' && c2 == 't' && c3 == ';')
+ {
+ n.Append(">");
+ i += 4;
+ }
+ else if (c1 == 'q' && c2 == 'u' && c3 == 'o' && c4 == 't' && c5 == ';')
+ {
+ n.Append("\"");
+ i += 6;
+ }
+ else if (c1 == 'a' && c2 == 'p' && c3 == 'o' && c4 == 's' && c5 == ';')
+ {
+ n.Append("'");
+ i += 6;
+ }
+ else
+ n.Append("&");
+ }
+ else
+ n.Append(c);
+ }
+ return n.ToString();
+ }
+
+ public static string encode(string text)
+ {
+ char c;
+ StringBuilder n = new StringBuilder();
+ for (int i = 0; i < text.Length; i++)
+ {
+ c = text[i];
+ switch (c)
+ {
+ case '&':
+ {
+ n.Append("&amp;");
+ break;
+ }
+
+ case '<':
+ {
+ n.Append("&lt;");
+ break;
+ }
+
+ case '>':
+ {
+ n.Append("&gt;");
+ break;
+ }
+
+ case '"':
+ {
+ n.Append("&quot;");
+ break;
+ }
+
+ case '\'':
+ {
+ n.Append("&apos;");
+ break;
+ }
+
+ default:
+ {
+ n.Append(c);
+ break;
+ }
+
+ }
+ }
+ return n.ToString();
+ }
+
+ public virtual void xmlSerializeNode(TextWriter outWriter)
+ {
+ StringBuilder buf = new StringBuilder(100);
+ buf.Append("<");
+ buf.Append(GetType().FullName + " ");
+ buf.Append("text=\"" + encode(getText()) + "\" type=\"" + Type + "\"/>");
+ outWriter.Write(buf.ToString());
+ }
+
+ public virtual void xmlSerializeRootOpen(TextWriter outWriter)
+ {
+ StringBuilder buf = new StringBuilder(100);
+ buf.Append("<");
+ buf.Append(GetType().FullName + " ");
+ buf.Append("text=\"" + encode(getText()) + "\" type=\"" + Type + "\">\n");
+ outWriter.Write(buf.ToString());
+ }
+
+ public virtual void xmlSerializeRootClose(TextWriter outWriter)
+ {
+ outWriter.Write("</" + GetType().FullName + ">\n");
+ }
+
+ public virtual void xmlSerialize(TextWriter outWriter)
+ {
+ // print out this node and all siblings
+ for (AST node = this; node != null; node = node.getNextSibling())
+ {
+ if (node.getFirstChild() == null)
+ {
+ // print guts (class name, attributes)
+ ((BaseAST) node).xmlSerializeNode(outWriter);
+ }
+ else
+ {
+ ((BaseAST) node).xmlSerializeRootOpen(outWriter);
+
+ // print children
+ ((BaseAST) node.getFirstChild()).xmlSerialize(outWriter);
+
+ // print end tag
+ ((BaseAST) node).xmlSerializeRootClose(outWriter);
+ }
+ }
+ }
+
+ #region Implementation of ICloneable
+ [Obsolete("Deprecated since version 2.7.2. Use ASTFactory.dup() instead.", false)]
+ public virtual object Clone()
+ {
+ return MemberwiseClone();
+ }
+ #endregion
+
+ public override Int32 GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+ }
}
View
298 src/Spring/Spring.Core/Expressions/SpringAST.cs
@@ -1,152 +1,152 @@
-using System;
+using System;
using System.Runtime.Serialization;
using Spring.Expressions.Parser.antlr;
-using Spring.Expressions.Parser.antlr.collections;
-
-namespace Spring.Expressions
-{
- /// <summary>
- /// For internal purposes only. Use <see cref="BaseNode"/> for expression node implementations.
- /// </summary>
- /// <remarks>
- /// This class is only required to enable serialization of parsed Spring expressions since antlr.CommonAST
- /// unfortunately is not marked as [Serializable].<br/>
- /// <br/>
- /// <b>Note:</b>Since SpringAST implements <see cref="ISerializable"/>, deriving classes
- /// have to explicitely override <see cref="GetObjectData"/> if they need to persist additional
- /// data during serialization.
- /// </remarks>
- [Serializable]
- public class SpringAST : Parser.antlr.BaseAST, ISerializable
- {
- #region Global SpringAST Factory
-
- internal class SpringASTCreator : Parser.antlr.ASTNodeCreator
- {
- public override Parser.antlr.collections.AST Create()
- {
- return new SpringAST();
- }
-
- public override string ASTNodeTypeName
- {
- get { return typeof(SpringAST).FullName; }
- }
- }
-
- /// <summary>
- /// The global SpringAST node factory
- /// </summary>
- internal static readonly SpringASTCreator Creator = new SpringASTCreator();
-
- #endregion
-
- #region Members
-
- private string text;
- private int ttype;
-
- #endregion
-
- /// <summary>
- /// Create an instance
- /// </summary>
- public SpringAST()
- {}
-
- /// <summary>
- /// Create an instance from a token
- /// </summary>
- public SpringAST(IToken token)
- {
- initialize(token);
- }
-
- /// <summary>
- /// initialize this instance from an AST
- /// </summary>
- public override void initialize(AST t)
- {
- this.setText(t.getText());
- this.Type = t.Type;
- }
-
- /// <summary>
- /// initialize this instance from an IToken
- /// </summary>
- public override void initialize(IToken tok)
- {
- this.setText(tok.getText());
- this.Type = tok.Type;
- }
-
- /// <summary>
- /// initialize this instance from a token type number and a text
- /// </summary>
- public override void initialize(int t, string txt)
- {
- this.Type = t;
- this.setText(txt);
- }
-
- /// <summary>
- /// gets or sets the token type of this node
- /// </summary>
- public override int Type
- {
- get { return this.ttype; }
- set { this.ttype = value; }
- }
-
- /// <summary>
- /// gets or sets the text of this node
- /// </summary>
- public string Text
- {
- get { return this.getText(); }
- set { this.setText(value); }
- }
-
- /// <summary>
- /// sets the text of this node
- /// </summary>
- public override void setText(string txt)
- {
- this.text = txt;
- }
-
- /// <summary>
- /// gets the text of this node
- /// </summary>
- public override string getText()
- {
- return this.text;
- }
-
- #region ISerializable Implementation
-
- /// <summary>
- /// Create a new instance from SerializationInfo
- /// </summary>
- protected SpringAST(SerializationInfo info, StreamingContext context)
- {
- base.down = (BaseAST)info.GetValue("down", typeof(BaseAST));
- base.right = (BaseAST)info.GetValue("right", typeof(BaseAST));
- this.ttype = info.GetInt32("ttype");
- this.text = info.GetString("text");
- }
-
- /// <summary>
- /// populate SerializationInfo from this instance
- /// </summary>
- public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- info.AddValue("down", base.down, typeof(SpringAST));
- info.AddValue("right", base.right, typeof(SpringAST));
- info.AddValue("ttype", this.Type, typeof(int));
- info.AddValue("text", this.Text, typeof(string));
- }
-
- #endregion
- }
+using Spring.Expressions.Parser.antlr.collections;
+
+namespace Spring.Expressions
+{
+ /// <summary>
+ /// For internal purposes only. Use <see cref="BaseNode"/> for expression node implementations.
+ /// </summary>
+ /// <remarks>
+ /// This class is only required to enable serialization of parsed Spring expressions since antlr.CommonAST
+ /// unfortunately is not marked as [Serializable].<br/>
+ /// <br/>
+ /// <b>Note:</b>Since SpringAST implements <see cref="ISerializable"/>, deriving classes
+ /// have to explicitely override <see cref="GetObjectData"/> if they need to persist additional
+ /// data during serialization.
+ /// </remarks>
+ [Serializable]
+ public class SpringAST : Parser.antlr.BaseAST, ISerializable
+ {
+ #region Global SpringAST Factory
+
+ internal class SpringASTCreator : Parser.antlr.ASTNodeCreator
+ {
+ public override Parser.antlr.collections.AST Create()
+ {
+ return new SpringAST();
+ }
+
+ public override string ASTNodeTypeName
+ {
+ get { return typeof(SpringAST).FullName; }
+ }
+ }
+
+ /// <summary>
+ /// The global SpringAST node factory
+ /// </summary>
+ internal static readonly SpringASTCreator Creator = new SpringASTCreator();
+
+ #endregion
+
+ #region Members
+
+ private string text;
+ private int ttype;
+
+ #endregion
+
+ /// <summary>
+ /// Create an instance
+ /// </summary>
+ public SpringAST()
+ {}
+
+ /// <summary>
+ /// Create an instance from a token
+ /// </summary>
+ public SpringAST(IToken token)
+ {
+ initialize(token);
+ }
+
+ /// <summary>
+ /// initialize this instance from an AST
+ /// </summary>
+ public override void initialize(AST t)
+ {
+ this.setText(t.getText());
+ this.Type = t.Type;
+ }
+
+ /// <summary>
+ /// initialize this instance from an IToken
+ /// </summary>
+ public override void initialize(IToken tok)
+ {
+ this.setText(tok.getText());
+ this.Type = tok.Type;
+ }
+
+ /// <summary>
+ /// initialize this instance from a token type number and a text
+ /// </summary>
+ public override void initialize(int t, string txt)
+ {
+ this.Type = t;
+ this.setText(txt);
+ }
+
+ /// <summary>
+ /// gets or sets the token type of this node
+ /// </summary>
+ public override int Type
+ {
+ get { return this.ttype; }
+ set { this.ttype = value; }
+ }
+
+ /// <summary>
+ /// gets or sets the text of this node
+ /// </summary>
+ public string Text
+ {
+ get { return this.getText(); }
+ set { this.setText(value); }
+ }
+
+ /// <summary>
+ /// sets the text of this node
+ /// </summary>
+ public override void setText(string txt)
+ {
+ this.text = txt;
+ }
+
+ /// <summary>
+ /// gets the text of this node
+ /// </summary>
+ public override string getText()
+ {
+ return this.text;
+ }
+
+ #region ISerializable Implementation
+
+ /// <summary>
+ /// Create a new instance from SerializationInfo
+ /// </summary>
+ protected SpringAST(SerializationInfo info, StreamingContext context)
+ {
+ base.down = (BaseAST)info.GetValue("down", typeof(BaseAST));
+ base.right = (BaseAST)info.GetValue("right", typeof(BaseAST));
+ this.ttype = info.GetInt32("ttype");
+ this.text = info.GetString("text");
+ }
+
+ /// <summary>
+ /// populate SerializationInfo from this instance
+ /// </summary>
+ public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ info.AddValue("down", base.down, typeof(SpringAST));
+ info.AddValue("right", base.right, typeof(SpringAST));
+ info.AddValue("ttype", this.Type, typeof(int));
+ info.AddValue("text", this.Text, typeof(string));
+ }
+
+ #endregion
+ }
}
View
6 src/Spring/Spring.Core/Objects/Factory/Attributes/AutowiredAttributeObjectPostProcessor.cs
@@ -441,7 +441,7 @@ public AutowiredPropertyElement(PropertyInfo property, bool required)
public override void Inject(Object instance, String objectName, IPropertyValues pvs)
{
- var property = (PropertyInfo) _member;
+ var property = (PropertyInfo) Member;
try
{
Object value;
@@ -513,7 +513,7 @@ public AutowiredFieldElement(FieldInfo field, bool required)
public override void Inject(Object instance, String objectName, IPropertyValues pvs)
{
- var field = (FieldInfo) _member;
+ var field = (FieldInfo) Member;
try
{
Object value;
@@ -585,7 +585,7 @@ public AutowiredMethodElement(MethodInfo method, bool required)
public override void Inject(Object target, string objectName, IPropertyValues pvs)
{
- MethodInfo method = _member as MethodInfo;
+ MethodInfo method = Member as MethodInfo;
try
{
Object[] arguments;
View
7 src/Spring/Spring.Core/Objects/Factory/Attributes/InjectionMetadata.cs
@@ -89,7 +89,7 @@ public abstract class InjectedElement
/// <summary>
/// The Property, field, method or constructor info
/// </summary>
- protected readonly MemberInfo _member;
+ private readonly MemberInfo _member;
/// <summary>
/// Instantiates a new inject element
@@ -100,6 +100,11 @@ protected InjectedElement(MemberInfo member)
_member = member;
}
+ public MemberInfo Member
+ {
+ get { return _member; }
+ }
+
/// <summary>
/// Ececuted to inject value to associated memeber info
/// </summary>
View
2  src/Spring/Spring.Core/Objects/Factory/Config/ConfigurableVariableSource.cs
@@ -38,7 +38,7 @@ namespace Spring.Objects.Factory.Config
[Serializable]
public class ConfigurableVariableSource : IVariableSource
{
- protected NameValueCollection _variables;
+ private NameValueCollection _variables;
/// <summary>
/// Initializes a new instance of <see cref="ConfigurableVariableSource"/>.
View
6 src/Spring/Spring.Core/Objects/Factory/Config/VariableAccessor.cs
@@ -243,6 +243,7 @@ public long GetInt64(string name, long defaultValue, bool throwOnInvalidValue)
/// A <see cref="ulong"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> returns <c>null</c>.
/// </returns>
+ [CLSCompliant(false)]
public ulong GetUInt64(string name, ulong defaultValue)
{
return GetUInt64(name, defaultValue, true);
@@ -261,6 +262,7 @@ public ulong GetUInt64(string name, ulong defaultValue)
/// A <see cref="ulong"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> cannot be parsed.
/// </returns>
+ [CLSCompliant(false)]
public ulong GetUInt64(string name, ulong defaultValue, bool throwOnInvalidValue)
{
try
@@ -337,6 +339,7 @@ public int GetInt32(string name, int defaultValue, bool throwOnInvalidValue)
/// A <see cref="uint"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> returns <c>null</c>.
/// </returns>
+ [CLSCompliant(false)]
public uint GetUInt32(string name, uint defaultValue)
{
return GetUInt32(name, defaultValue, true);
@@ -355,6 +358,7 @@ public uint GetUInt32(string name, uint defaultValue)
/// A <see cref="uint"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> cannot be parsed.
/// </returns>
+ [CLSCompliant(false)]
public uint GetUInt32(string name, uint defaultValue, bool throwOnInvalidValue)
{
try
@@ -431,6 +435,7 @@ public short GetInt16(string name, short defaultValue, bool throwOnInvalidValue)
/// A <see cref="short"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> returns <c>null</c>.
/// </returns>
+ [CLSCompliant(false)]
public ushort GetUInt16(string name, ushort defaultValue)
{
return GetUInt16(name, defaultValue, true);
@@ -449,6 +454,7 @@ public ushort GetUInt16(string name, ushort defaultValue)
/// A <see cref="short"/> that contains the value of the specified variable
/// or <paramref name="defaultValue"/>, if <see cref="IVariableSource.ResolveVariable"/> cannot be parsed.
/// </returns>
+ [CLSCompliant(false)]
public ushort GetUInt16(string name, ushort defaultValue, bool throwOnInvalidValue)
{
try
View
3  src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectFactory.cs
@@ -158,7 +158,7 @@ protected override int CompareEqualOrder(object o1, object o2)
/// <summary>
/// Whether to cache object metadata or rather reobtain it for every access
/// </summary>
- protected bool cacheObjectMetadata = true;
+ private bool cacheObjectMetadata = true;
/// <summary>
@@ -766,6 +766,7 @@ protected bool IsObjectEligibleForMetadataCaching(String beanName)
protected bool CacheObjectMetadata
{
get { return this.cacheObjectMetadata; }
+ set { this.cacheObjectMetadata = value; }
}
/// <summary>
View
7 src/Spring/Spring.Core/Spring.Core.2010.csproj
@@ -60,11 +60,12 @@
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
- <WarningsAsErrors>1591</WarningsAsErrors>
+ <WarningsAsErrors>
+ </WarningsAsErrors>
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -85,7 +86,7 @@
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
View
2  src/Spring/Spring.Data/Data/Core/AdoAccessor.cs
@@ -36,7 +36,7 @@ public abstract class AdoAccessor : IInitializingObject
{
protected object AdoUtils;
- protected int commandTimeout = -1;
+ private int commandTimeout = -1;
#region Properties
View
2  src/Spring/Spring.Data/Data/Core/AdoTemplate.cs
@@ -57,7 +57,7 @@ public class AdoTemplate : AdoAccessor, IAdoOperations
private IAdoExceptionTranslator exceptionTranslator;
private bool lazyInit = true;
- protected Type dataReaderWrapperType;
+ private Type dataReaderWrapperType;
protected IDynamicConstructor newDataReaderWrapper;
#endregion
View
7 src/Spring/Spring.Data/Data/Generic/AdoTemplate.cs
@@ -50,8 +50,7 @@ public class AdoTemplate : AdoAccessor, IAdoOperations
#region Fields
private Core.AdoTemplate classicAdoTemplate;
- protected Type dataReaderWrapperType;
-
+
#endregion
#region Constructors
@@ -172,10 +171,10 @@ public Core.AdoTemplate ClassicAdoTemplate
/// </remarks>
public override int CommandTimeout
{
- get { return commandTimeout; }
+ get { return base.CommandTimeout; }
set
{
- commandTimeout = value;
+ base.CommandTimeout = value;
classicAdoTemplate.CommandTimeout = value;
}
}
View
3  src/Spring/Spring.Data/Data/Objects/AbstractAdoOperation.cs
@@ -54,7 +54,7 @@ public abstract class AbstractAdoOperation : IInitializingObject