Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
36 | 2 | 6 | 0.987 | block |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 36 | 53 | src/NHibernate.Test/VersionTest/VersionFixture.cs |
2 | 36 | 93 | 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(); } |
| ||||
{ 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(); } |
| |||
{ 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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#55372640]] | Thing |
1 | 2 | [[#55372640]] | Task |
2 | 1 | [[#553732c0]] | "Passport" |
2 | 2 | [[#553732c0]] | "Code" |
3 | 1 | [[#6afd08a0]] | "Laptop" |
3 | 2 | [[#6afd08a0]] | "Document" |
4 | 1 | [[#6afd0740]] | 2 |
4 | 2 | [[#6afd0740]] | 1 |
5 | 1 | [[#6afd0600]] | Things |
5 | 2 | [[#6afd0600]] | Tasks |
6 | 1 | [[#6afd0420]] | 3 |
6 | 2 | [[#6afd0420]] | 1 |