Permalink
Browse files

Build with no warning.

SVN: trunk@3576
  • Loading branch information...
1 parent d58a033 commit 0968166fb774b47653af50293c85f071747c0fe2 @ayende ayende committed Jun 27, 2008
Showing with 184 additions and 117 deletions.
  1. +3 −2 build-common/common-project.xml
  2. +2 −0 src/NHibernate.DomainModel/Master.cs
  3. +2 −0 src/NHibernate.DomainModel/Top.cs
  4. +1 −1 src/NHibernate.Test/ConnectionTest/AggressiveReleaseTest.cs
  5. +2 −0 src/NHibernate.Test/Criteria/StudentDTO.cs
  6. +0 −3 src/NHibernate.Test/Join/JoinCompositeKeyTest.cs
  7. +2 −0 src/NHibernate.Test/Join/User.cs
  8. +46 −36 src/NHibernate.Test/Legacy/SQLLoaderTest.cs
  9. +2 −0 src/NHibernate.Test/NHSpecificTest/NH1250/Model.cs
  10. +2 −0 src/NHibernate.Test/NHSpecificTest/NH247/LiteralDescription.cs
  11. +2 −0 src/NHibernate.Test/NHSpecificTest/NH251/CustomAccessDO.cs
  12. +2 −0 src/NHibernate.Test/NHSpecificTest/NH372/Model.cs
  13. +2 −0 src/NHibernate.Test/NHSpecificTest/NH548/MainObject.cs
  14. +1 −1 src/NHibernate.Test/NHSpecificTest/NH901/Fixture.cs
  15. +12 −3 src/NHibernate.Test/NHSpecificTest/ProxyValidator/Fixture.cs
  16. +18 −6 src/NHibernate.Test/NHibernate.Test-3.5.csproj
  17. +3 −0 src/NHibernate.Test/PropertyTest/FieldGetterFixture.cs
  18. +5 −0 src/NHibernate.Test/QueryTest/DetachedQueryFixture.cs
  19. +7 −7 src/NHibernate.Test/UtilityTest/JoinedEnumerableGenericFixture.cs
  20. +8 −6 src/NHibernate/AdoNet/AdoNetContext.cs
  21. +2 −2 src/NHibernate/Collection/Generic/PersistentGenericSet.cs
  22. +7 −2 src/NHibernate/Collection/PersistentArrayHolder.cs
  23. +41 −41 src/NHibernate/Collection/PersistentSet.cs
  24. +3 −2 src/NHibernate/Dialect/Schema/IDataBaseSchema.cs
  25. +0 −1 src/NHibernate/Event/Default/DefaultFlushEntityEventListener.cs
  26. +2 −2 src/NHibernate/Loader/Collection/BasicCollectionLoader.cs
  27. +3 −1 src/NHibernate/Loader/Entity/IUniqueEntityLoader.cs
  28. +4 −1 src/NHibernate/NHibernate-3.5.csproj
@@ -66,6 +66,7 @@
target="library"
define="${current.build.defines}"
debug="${build.debug}"
+ keyfile="${key.file}"
output="${bin.dir}/${project::get-name()}.dll"
>
<sources refid="project.sources" />
@@ -89,6 +90,7 @@
target="library"
define="${current.build.defines}"
debug="${build.debug}"
+ keyfile="${key.file}"
output="${bin.dir}/${project::get-name()}.dll"
doc="${bin.dir}/${project::get-name()}.xml"
>
@@ -107,6 +109,7 @@
<csc
target="exe"
+ keyfile="${key.file}"
define="${current.build.defines}"
debug="${build.debug}"
output="${bin.dir}/${project::get-name()}.exe"
@@ -131,7 +134,6 @@
<property overwrite="false" name="assembly.version.informational" value="${project.version.numeric}" />
<property overwrite="false" name="assembly.version.file" value="${project.version.numeric}" />
<property overwrite="false" name="assembly.copyright" value="Licensed under LGPL." />
- <property overwrite="false" name="assembly.keyfile" value="${key.file}" />
<property overwrite="false" name="assembly.sign" value="${sign}" />
<!--
@@ -162,7 +164,6 @@
<attribute type="AssemblyVersionAttribute" value="${assembly.version}" />
<attribute type="AssemblyInformationalVersionAttribute" value="${assembly.version.informational}" />
<attribute type="AssemblyFileVersionAttribute" value="${assembly.version.file}" />
- <attribute type="AssemblyKeyFileAttribute" value="${assembly.keyfile}" if="${assembly.sign}"/>
<attribute type="AssemblyDelaySignAttribute" value="false" />
<!-- For some reason, NAnt doesn't detect that APTCA has a public no-argument constructor -->
@@ -19,7 +19,9 @@ public class Master : INamed
private ISet _incoming = new HashedSet();
private ISet _outgoing = new HashedSet();
private string _name = "master";
+#pragma warning disable 169
private DateTime version;
+#pragma warning restore 169
//private BigDecimal bigDecimal = new BigDecimal("1234.123"); //TODO: how to do in .net
private int _x;
@@ -13,7 +13,9 @@ public class Top
// accurracy issues
private DateTime date = new DateTime(2004, 01, 01, 12, 00, 00, 00);
private Top other;
+#pragma warning disable 169
private Top top;
+#pragma warning restore 169
public Top(int c)
{
@@ -86,7 +86,7 @@ public void SerializationFailsOnAfterStatementAggressiveReleaseWithOpenResources
Assert.Fail(
"Serialization allowed on connected session; or aggressive Release released connection with open resources");
}
- catch (InvalidOperationException e)
+ catch (InvalidOperationException)
{
// expected behavior
}
@@ -4,8 +4,10 @@ namespace NHibernate.Test.Criteria
{
public class StudentDTO
{
+#pragma warning disable 649
private string studentName;
private string courseDescription;
+#pragma warning restore 649
public StudentDTO()
{
@@ -27,12 +27,10 @@ protected override IList Mappings
}
ISession s;
- ITransaction t;
protected override void OnSetUp()
{
s = OpenSession();
- //t = s.BeginTransaction();
objectsNeedDeleting.Clear();
}
@@ -57,7 +55,6 @@ protected override void OnTearDown()
s.Close();
}
- t = null;
s = null;
}
@@ -4,7 +4,9 @@ namespace NHibernate.Test.Join
{
public class User : Person
{
+#pragma warning disable 169
private string _Silly;
+#pragma warning restore 169
private string _Login;
public virtual string Login
@@ -45,7 +45,8 @@ public void TS()
Simple sim = new Simple();
sim.Date = DateTime.Today; // NB We don't use Now() due to the millisecond alignment problem with SQL Server
session.Save(sim, 1L);
- IQuery q = session.CreateSQLQuery("select {sim.*} from Simple {sim} where {sim}.date_ = ?", "sim", typeof(Simple));
+ IQuery q = session.CreateSQLQuery("select {sim.*} from Simple {sim} where {sim}.date_ = ?")
+ .AddEntity("sim", typeof(Simple));
q.SetTimestamp(0, sim.Date);
Assert.AreEqual(1, q.List().Count, "q.List.Count");
session.Delete(sim);
@@ -68,7 +69,8 @@ public void TSNamed()
sim.Date = DateTime.Today; // NB We don't use Now() due to the millisecond alignment problem with SQL Server
session.Save(sim, 1L);
IQuery q =
- session.CreateSQLQuery("select {sim.*} from Simple {sim} where {sim}.date_ = :fred", "sim", typeof(Simple));
+ session.CreateSQLQuery("select {sim.*} from Simple {sim} where {sim}.date_ = :fred")
+ .AddEntity("sim", typeof(Simple));
q.SetTimestamp("fred", sim.Date);
Assert.AreEqual(1, q.List().Count, "q.List.Count");
session.Delete(sim);
@@ -96,9 +98,12 @@ public void FindBySQLStar()
//B b = new B();
//session.Save( b );
- session.CreateSQLQuery("select {category.*} from Category {category}", "category", typeof(Category)).List();
- session.CreateSQLQuery("select {simple.*} from Simple {simple}", "simple", typeof(Simple)).List();
- session.CreateSQLQuery("select {a.*} from A {a}", "a", typeof(A)).List();
+ session.CreateSQLQuery("select {category.*} from Category {category}")
+ .AddEntity("category", typeof(Category)).List();
+ session.CreateSQLQuery("select {simple.*} from Simple {simple}")
+ .AddEntity("simple", typeof(Simple)).List();
+ session.CreateSQLQuery("select {a.*} from A {a}")
+ .AddEntity("a", typeof(A)).List();
session.Delete(s);
session.Delete(simple);
@@ -123,8 +128,8 @@ public void FindBySQLProperties()
session.Flush();
IQuery query =
- session.CreateSQLQuery("select {category.*} from Category {category} where {category}.Name = :Name", "category",
- typeof(Category));
+ session.CreateSQLQuery("select {category.*} from Category {category} where {category}.Name = :Name")
+ .AddEntity("category",typeof(Category));
query.SetProperties(s);
query.List();
@@ -152,7 +157,8 @@ public void FindBySQLAssociatedObject()
s.Close();
s = OpenSession();
- IList list = s.CreateSQLQuery("select {category.*} from Category {category}", "category", typeof(Category)).List();
+ IList list = s.CreateSQLQuery("select {category.*} from Category {category}")
+ .AddEntity("category", typeof(Category)).List();
Assert.AreEqual(1, list.Count, "Count differs");
s.Delete("from Assignable");
@@ -199,9 +205,10 @@ public void FindBySQLMultipleObject()
if (!(Dialect is MySQLDialect))
{
IList list =
- s.CreateSQLQuery("select {category.*}, {assignable.*} from Category {category}, \"assign able\" {assignable}",
- new string[] {"category", "assignable"}, new System.Type[] {typeof(Category), typeof(Assignable)})
- .List();
+ s.CreateSQLQuery("select {category.*}, {assignable.*} from Category {category}, \"assign able\" {assignable}")
+ .AddEntity("category", typeof(Category))
+ .AddEntity("assignable", typeof(Assignable))
+ .List();
Assert.AreEqual(6, list.Count, "Count differs"); // cross-product of 2 categories x 3 assignables;
Assert.IsTrue(list[0] is object[]);
}
@@ -255,23 +262,23 @@ public void FindBySQLParameters()
s = OpenSession();
IQuery basicParam =
- s.CreateSQLQuery("select {category.*} from Category {category} where {category}.Name = 'Best'", "category",
- typeof(Category));
+ s.CreateSQLQuery("select {category.*} from Category {category} where {category}.Name = 'Best'")
+ .AddEntity("category", typeof(Category));
IList list = basicParam.List();
Assert.AreEqual(1, list.Count);
IQuery unnamedParam =
- s.CreateSQLQuery("select {category.*} from Category {category} where {category}.Name = ? or {category}.Name = ?",
- "category", typeof(Category));
+ s.CreateSQLQuery("select {category.*} from Category {category} where {category}.Name = ? or {category}.Name = ?")
+ .AddEntity("category", typeof(Category));
unnamedParam.SetString(0, "Good");
unnamedParam.SetString(1, "Best");
list = unnamedParam.List();
Assert.AreEqual(2, list.Count);
IQuery namedParam =
s.CreateSQLQuery(
- "select {category.*} from Category {category} where ({category}.Name=:firstCat or {category}.Name=:secondCat)",
- "category", typeof(Category));
+ "select {category.*} from Category {category} where ({category}.Name=:firstCat or {category}.Name=:secondCat)")
+ .AddEntity("category", typeof(Category));
namedParam.SetString("firstCat", "Better");
namedParam.SetString("secondCat", "Best");
list = namedParam.List();
@@ -307,8 +314,8 @@ public void EscapedODBC()
query =
session.CreateSQLQuery(
- "select identifier_column as {a.id}, clazz_discriminata as {a.class}, count_ as {a.Count}, name as {a.Name} from A where {fn ucase(Name)} like {fn ucase('max')}",
- "a", typeof(A));
+ "select identifier_column as {a.id}, clazz_discriminata as {a.class}, count_ as {a.Count}, name as {a.Name} from A where {fn ucase(Name)} like {fn ucase('max')}")
+ .AddEntity("a", typeof(A));
// NH: Replaced the whole if by the line above
/*
@@ -360,8 +367,9 @@ public void DoubleAliasing()
"select a.identifier_column as {a1.id}, a.clazz_discriminata as {a1.class}, a.count_ as {a1.Count}, a.name as {a1.Name}, a.anothername as {a1.AnotherName} " +
", b.identifier_column as {a2.id}, b.clazz_discriminata as {a2.class}, b.count_ as {a2.Count}, b.name as {a2.Name}, b.anothername as {a2.AnotherName} " +
" from A a, A b" +
- " where a.identifier_column = b.identifier_column", new String[] {"a1", "a2"},
- new System.Type[] {typeof(A), typeof(A)});
+ " where a.identifier_column = b.identifier_column")
+ .AddEntity("a1", typeof(A))
+ .AddEntity("a2",typeof(A));
IList list = query.List();
Assert.IsNotNull(list);
@@ -386,15 +394,17 @@ public void EmbeddedCompositeProperties()
session.Flush();
session.Clear();
- IQuery query = session.CreateSQLQuery("select {sing.*} from Single {sing}", "sing", typeof(Single));
+ IQuery query = session.CreateSQLQuery("select {sing.*} from Single {sing}")
+ .AddEntity("sing", typeof(Single));
IList list = query.List();
Assert.IsTrue(list.Count == 1);
session.Clear();
- query = session.CreateSQLQuery("select {sing.*} from Single {sing} where sing.Id = ?", "sing", typeof(Single));
+ query = session.CreateSQLQuery("select {sing.*} from Single {sing} where sing.Id = ?")
+ .AddEntity("sing", typeof(Single));
query.SetString(0, "my id");
list = query.List();
@@ -404,8 +414,8 @@ public void EmbeddedCompositeProperties()
query =
session.CreateSQLQuery(
- "select s.id as {sing.Id}, s.string_ as {sing.String}, s.prop as {sing.Prop} from Single s where s.Id = ?", "sing",
- typeof(Single));
+ "select s.id as {sing.Id}, s.string_ as {sing.String}, s.prop as {sing.Prop} from Single s where s.Id = ?")
+ .AddEntity("sing", typeof(Single));
query.SetString(0, "my id");
list = query.List();
@@ -416,8 +426,8 @@ public void EmbeddedCompositeProperties()
query =
session.CreateSQLQuery(
- "select s.id as {sing.Id}, s.string_ as {sing.String}, s.prop as {sing.Prop} from Single s where s.Id = ?", "sing",
- typeof(Single));
+ "select s.id as {sing.Id}, s.string_ as {sing.String}, s.prop as {sing.Prop} from Single s where s.Id = ?")
+ .AddEntity("sing", typeof(Single));
query.SetString(0, "my id");
list = query.List();
@@ -461,7 +471,7 @@ private void ComponentTest(string sql)
session.Clear();
- IQuery q = session.CreateSQLQuery(sql, "comp", typeof(Componentizable));
+ IQuery q = session.CreateSQLQuery(sql).AddEntity("comp", typeof(Componentizable));
IList list = q.List();
Assert.AreEqual(list.Count, 1);
@@ -491,8 +501,8 @@ public void FindSimpleBySQL()
IQuery query =
session.CreateSQLQuery(
- "select s.category_key_col as {category.id}, s.Name as {category.Name}, s.\"assign able id\" as {category.Assignable} from {category} s",
- "category", typeof(Category));
+ "select s.category_key_col as {category.id}, s.Name as {category.Name}, s.\"assign able id\" as {category.Assignable} from {category} s")
+ .AddEntity("category", typeof(Category));
IList list = query.List();
Assert.IsNotNull(list);
@@ -521,8 +531,8 @@ public void FindBySQLSimpleByDiffSessions()
IQuery query =
session.CreateSQLQuery(
- "select s.category_key_col as {category.id}, s.Name as {category.Name}, s.\"assign able id\" as {category.Assignable} from {category} s",
- "category", typeof(Category));
+ "select s.category_key_col as {category.id}, s.Name as {category.Name}, s.\"assign able id\" as {category.Assignable} from {category} s")
+ .AddEntity("category", typeof(Category));
IList list = query.List();
Assert.IsNotNull(list);
@@ -551,8 +561,8 @@ public void FindBySQLDiscriminatorSameSession()
IQuery query =
session.CreateSQLQuery(
- "select identifier_column as {a.id}, clazz_discriminata as {a.class}, name as {a.Name}, count_ as {a.Count} from {a} s",
- "a", typeof(A));
+ "select identifier_column as {a.id}, clazz_discriminata as {a.class}, name as {a.Name}, count_ as {a.Count} from {a} s")
+ .AddEntity("a", typeof(A));
IList list = query.List();
Assert.IsNotNull(list);
@@ -599,8 +609,8 @@ public void FindBySQLDiscriminatedDiffSessions()
session = OpenSession();
IQuery query = session.CreateSQLQuery(
- "select identifier_column as {a.id}, clazz_discriminata as {a.class}, count_ as {a.Count}, name as {a.Name}, anothername as {a.AnotherName} from A",
- "a", typeof(A));
+ "select identifier_column as {a.id}, clazz_discriminata as {a.class}, count_ as {a.Count}, name as {a.Name}, anothername as {a.AnotherName} from A")
+ .AddEntity("a", typeof(A));
IList list = query.List();
Assert.IsNotNull(list);
@@ -23,7 +23,9 @@ public virtual string DisplayForename
set { displayName = value; }
}
+#pragma warning disable 169
private int classTypeId; // something for NHibernate to write to
+#pragma warning restore 169
private string displayName;
public abstract int ClassTypeId
@@ -14,7 +14,9 @@ public LiteralDescription(string description)
_description = description;
}
+#pragma warning disable 649
private int _id;
+#pragma warning restore 649
public int Id
{
@@ -17,8 +17,10 @@ public interface IDynamicFieldContainer
// A component class
public class Name
{
+#pragma warning disable 169
private string first;
private string last;
+#pragma warning restore 169
}
/// <summary>
@@ -4,7 +4,9 @@ namespace NHibernate.Test.NHSpecificTest.NH372
{
public class BaseParent
{
+#pragma warning disable 649
private int _Id;
+#pragma warning restore 649
public virtual int Id
{
@@ -4,9 +4,11 @@ namespace NHibernate.Test.NHSpecificTest.NH548
{
public class MainObject
{
+#pragma warning disable 649
private int _id;
private string _name;
private ComponentObject _component;
+#pragma warning restore 649
public MainObject()
{
@@ -14,7 +14,7 @@ public override string BugNumber
get { return "NH901"; }
}
- private ISession OpenSession(IInterceptor interceptor)
+ private new ISession OpenSession(IInterceptor interceptor)
{
lastOpenedSession = sessions.OpenSession(interceptor);
return lastOpenedSession;
Oops, something went wrong.

0 comments on commit 0968166

Please sign in to comment.