Skip to content

Commit 8df93f2

Browse files
committed
Remove methods marked as obsolete
1 parent 8ee8eb7 commit 8df93f2

File tree

3 files changed

+0
-74
lines changed

3 files changed

+0
-74
lines changed

NHibernate.Spatial.MySQL/Type/MySQL57GeometryAdapterType.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ public override object Get(DbDataReader rs, string name, ISessionImplementor ses
4848
return Get(rs, rs.GetOrdinal(name), session);
4949
}
5050

51-
[Obsolete("This method has no more usages and will be removed in a future version. Override ToLoggableString instead.")]
52-
public override string ToString(object value)
53-
{
54-
return value.ToString();
55-
}
56-
5751
public override string Name
5852
{
5953
get { return ReturnedClass.Name; }
@@ -64,12 +58,6 @@ public override object Get(DbDataReader rs, int index, ISessionImplementor sessi
6458
return new MySqlGeometry(MySqlDbType.Geometry, (byte[])rs[index]);
6559
}
6660

67-
[Obsolete("This method has no more usages and will be removed in a future version.")]
68-
public override object FromStringValue(string xml)
69-
{
70-
return MySqlGeometry.Parse(xml);
71-
}
72-
7361
public override System.Type ReturnedClass
7462
{
7563
get { return typeof(MySqlGeometry); }

NHibernate.Spatial.MySQL/Type/MySQLGeometryStringType.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,23 +112,6 @@ public object StringToObject(string xml)
112112
return xml;
113113
}
114114

115-
/// <summary>
116-
///
117-
/// </summary>
118-
/// <param name="value"></param>
119-
/// <returns></returns>
120-
[Obsolete("This method has no more usages and will be removed in a future version. Override ToLoggableString instead.")]
121-
public override string ToString(object value)
122-
{
123-
return (string)value;
124-
}
125-
126-
[Obsolete("This method has no more usages and will be removed in a future version.")]
127-
public override object FromStringValue(string xml)
128-
{
129-
return xml;
130-
}
131-
132115
public string ObjectToSQLString(object value, NHibernate.Dialect.Dialect dialect)
133116
{
134117
return (string)value;

NHibernate.Spatial.PostGis/Type/PostGisGeometryType.cs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -105,39 +105,6 @@ protected override Geometry ToGeometry(object value)
105105
return geometry;
106106
}
107107

108-
private static byte[] ToByteArray(string hex)
109-
{
110-
if (hex.Length % 2 == 1)
111-
throw new ArgumentException("Invalid input. It must have an even length.", "hex");
112-
113-
byte[] data = new byte[hex.Length / 2];
114-
for (int i = 0; i < hex.Length; i += 2)
115-
{
116-
char c1 = hex[i];
117-
char c2 = hex[i + 1];
118-
119-
int result = (c1 < 'A') ? (c1 - '0') : (10 + (c1 - 'A'));
120-
result = result << 4;
121-
result |= (c2 < 'A') ? (c2 - '0') : (10 + (c2 - 'A'));
122-
data[i / 2] = (byte)(result);
123-
}
124-
return data;
125-
}
126-
127-
private static string ToString(byte[] bytes)
128-
{
129-
char[] data = new char[bytes.Length * 2];
130-
int idx = 0;
131-
for (int i = 0; i < bytes.Length; i++)
132-
{
133-
int n1 = bytes[i] >> 4;
134-
int n2 = bytes[i] & 0xF;
135-
data[idx++] = (char)((n1) < 10 ? '0' + n1 : n1 - 10 + 'A');
136-
data[idx++] = (char)((n2) < 10 ? '0' + n2 : n2 - 10 + 'A');
137-
}
138-
return new string(data);
139-
}
140-
141108
[Serializable]
142109
private class CustomGeometryType : MutableType
143110
{
@@ -164,18 +131,6 @@ public override object Get(DbDataReader rs, string name, ISessionImplementor ses
164131
return Get(rs, rs.GetOrdinal(name), session);
165132
}
166133

167-
[Obsolete("This method has no more usages and will be removed in a future version. Override ToLoggableString instead.")]
168-
public override string ToString(object val)
169-
{
170-
return PostGisGeometryType.ToString((byte[])val);
171-
}
172-
173-
[Obsolete("This method has no more usages and will be removed in a future version.")]
174-
public override object FromStringValue(string xml)
175-
{
176-
return ToByteArray(xml);
177-
}
178-
179134
public override System.Type ReturnedClass => typeof(Geometry);
180135

181136
public override void Set(DbCommand cmd, object value, int index, ISessionImplementor session)

0 commit comments

Comments
 (0)