This is your BugInformation attribute class.
using System;
using System.Collections.Generic;
using System.Text;
namespace FindBug.Entity
{
[AttributeUsage(AttributeTargets.Class AttributeTargets.Constructor
AttributeTargets.Field AttributeTargets.Method
AttributeTargets.Property, AllowMultiple = true)]
public class BugInformation : System.Attribute
{
//private member data
private int bugID;
private string comment;
private string date;
private string programmer;
public BugInformation(int bugID, string programmer, string date)
{
this.bugID = bugID;
this.programmer = programmer;
this.date = date;
}
//Named Param
public string Comment
{
get
{
return comment;
}
set
{
comment = value;
}
}
//Positional Param
public int BugID
{
get
{
return bugID;
}
}
public string Programmer
{
get
{
return programmer;
}
}
public string Date
{
get
{
return date;
}
}
}
}
Here is your Class, for which you fix bugs.
using System;
using System.Collections.Generic;
using System.Text;
using FindBug.Entity;
namespace FindBug
{
[BugInformation(121, "Mamun", "01/03/08")]
[BugInformation(107, "Zaq", "01/04/08", Comment = "Fixed one error")]
public class MyCodeWitBugFixing
{
public MyCodeWitBugFixing()
{
}
public int SumTwoDigit(int i, int j)
{
return i + j;
}
public int DeductTwoDigit(int i, int j)
{
return i - j;
}
}
}
Part-I, Part-III
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment