CloneSet112


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
36260.987block
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
13653
src/NHibernate.Test/VersionTest/VersionFixture.cs
23693
src/NHibernate.Test/VersionTest/VersionFixture.cs
Clone Instance
1
Line Count
36
Source Line
53
Source File
src/NHibernate.Test/VersionTest/VersionFixture.cs

                {
                        ISession s = OpenSession();
                        ITransaction t = s.BeginTransaction();
                        Person gavin = new Person("Gavin");
                        new Thing("Passport", gavin);
                        s.Save(gavin);
                        t.Commit();
                        s.Close();

                        Assert.AreEqual(1, gavin.Version);

                        s = OpenSession();
                        t = s.BeginTransaction();
                        gavin = (Person) s.CreateCriteria( typeof(Person)).UniqueResult();
                        new Thing("Laptop", gavin);
                        t.Commit();
                        s.Close();

                        Assert.AreEqual(2, gavin.Version);
                        Assert.IsFalse(NHibernateUtil.IsInitialized(gavin.Things));

                        s = OpenSession();
                        t = s.BeginTransaction();
                        gavin = (Person) s.CreateCriteria( typeof(Person)).UniqueResult();
                        gavin.Things.Clear();
                        t.Commit();
                        s.Close();

                        Assert.AreEqual(3, gavin.Version);
                        Assert.IsTrue(NHibernateUtil.IsInitialized(gavin.Things));

                        s = OpenSession();
                        t = s.BeginTransaction();
                        s.Delete(gavin);
                        t.Commit();
                        s.Close();
                }


Clone Instance
2
Line Count
36
Source Line
93
Source File
src/NHibernate.Test/VersionTest/VersionFixture.cs

                {
                        ISession s = OpenSession();
                        ITransaction t = s.BeginTransaction();
                        Person gavin = new Person("Gavin");
                        new Task("Code", gavin);
                        s.Save(gavin);
                        t.Commit();
                        s.Close();

                        Assert.AreEqual(1, gavin.Version);

                        s = OpenSession();
                        t = s.BeginTransaction();
                        gavin = (Person) s.CreateCriteria( typeof(Person)).UniqueResult();
                        new Task("Document", gavin);
                        t.Commit();
                        s.Close();

                        Assert.AreEqual(1, gavin.Version);
                        Assert.IsFalse(NHibernateUtil.IsInitialized(gavin.Tasks));

                        s = OpenSession();
                        t = s.BeginTransaction();
                        gavin = (Person) s.CreateCriteria( typeof(Person)).UniqueResult();
                        gavin.Tasks.Clear();
                        t.Commit();
                        s.Close();

                        Assert.AreEqual(1, gavin.Version);
                        Assert.IsTrue(NHibernateUtil.IsInitialized(gavin.Tasks));

                        s = OpenSession();
                        t = s.BeginTransaction();
                        s.Delete(gavin);
                        t.Commit();
                        s.Close();
                }


Clone AbstractionParameter Count: 6Parameter Bindings

{
   ISession s = OpenSession();
   ITransaction t = s.BeginTransaction();
   Person gavin = new Person("Gavin");
   new [[#variable55372640]]( [[#variable553732c0]], gavin);
   s.Save(gavin);
   t.Commit();
   s.Close();
   Assert.AreEqual(1, gavin.Version);
   s = OpenSession();
   t = s.BeginTransaction();
   gavin = (Person)s.CreateCriteria( typeof(Person)).UniqueResult();
   new [[#variable55372640]]( [[#variable6afd08a0]], gavin);
   t.Commit();
   s.Close();
   Assert.AreEqual( [[#variable6afd0740]], gavin.Version);
   Assert.IsFalse(NHibernateUtil.IsInitialized(gavin. [[#variable6afd0600]]));
   s = OpenSession();
   t = s.BeginTransaction();
   gavin = (Person)s.CreateCriteria( typeof(Person)).UniqueResult();
   gavin. [[#variable6afd0600]].Clear();
   t.Commit();
   s.Close();
   Assert.AreEqual( [[#variable6afd0420]], gavin.Version);
   Assert.IsTrue(NHibernateUtil.IsInitialized(gavin. [[#variable6afd0600]]));
   s = OpenSession();
   t = s.BeginTransaction();
   s.Delete(gavin);
   t.Commit();
   s.Close();
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#55372640]]
Thing 
12[[#55372640]]
Task 
21[[#553732c0]]
"Passport" 
22[[#553732c0]]
"Code" 
31[[#6afd08a0]]
"Laptop" 
32[[#6afd08a0]]
"Document" 
41[[#6afd0740]]
2 
42[[#6afd0740]]
1 
51[[#6afd0600]]
Things 
52[[#6afd0600]]
Tasks 
61[[#6afd0420]]
3 
62[[#6afd0420]]
1