Welcome to mirror list, hosted at ThFree Co, Russian Federation.

MissingMethod.cs « corcompare « tools « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 306bbb66e8158c588f9a315b9d577463ea7570d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Mono.Util.CorCompare.MissingMethod
//
// Author(s):
//   Nick Drochak (ndrochak@gol.com)
//
// (C) 2001-2002 Nick Drochak

using System;
using System.Reflection;
using System.Text;

namespace Mono.Util.CorCompare {

	/// <summary>
	/// 	Represents a class method that is completely missing
	/// </summary>
	/// <remarks>
	/// 	created by - Nick
	/// 	created on - 2/20/2002 10:43:57 PM
	/// </remarks>
	class MissingMethod : MissingMember 
	{
		// e.g. <method name="Equals" status="missing"/>
		public MissingMethod (MemberInfo infoMono, MemberInfo infoMS) : base (infoMono, infoMS) {}

		public override string Name {
			get {
				string s = Info.ToString();
				int index = s.IndexOf(' ');
				return s.Substring(index + 1);
			}
		}

		public override string Type {
			get {
				return "method";
			}
		}

		public override NodeStatus Analyze ()
		{
			m_nodeStatus = base.Analyze ();

			if (mInfoMono != null && mInfoMS != null)
			{
				MethodBase miMono = (MethodBase) mInfoMono;
				MethodBase miMS   = (MethodBase) mInfoMS;

				AddFlagWarning (miMono.IsAbstract, miMS.IsAbstract, "abstract");
				AddFlagWarning (miMono.IsStatic, miMS.IsStatic, "static");
				AddFlagWarning (miMono.IsVirtual && !miMono.IsFinal, miMS.IsVirtual && !miMS.IsFinal, "virtual");
				AddFlagWarning (miMono.IsConstructor, miMS.IsConstructor, "a constructor");
				//AddFlagWarning (miMono.IsFinal, miMS.IsFinal, "sealed");
			}
			return m_nodeStatus;
		}
	}
}