Replace the try/catch with a null check.

0.6.0-stable
Mike Mazur 2008-07-24 05:23:42 +00:00
parent 117cc09edc
commit bb777a9c3c
2 changed files with 6 additions and 12 deletions

View File

@ -34,7 +34,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
public class LSL2CSCodeTransformer public class LSL2CSCodeTransformer
{ {
private SYMBOL m_astRoot = null; private SYMBOL m_astRoot = null;
private static Dictionary<string, string> m_datatypeLSL2OpenSim = new Dictionary<string, string>(); private static Dictionary<string, string> m_datatypeLSL2OpenSim = null;
/// <summary> /// <summary>
/// Pass the new CodeTranformer an abstract syntax tree. /// Pass the new CodeTranformer an abstract syntax tree.
@ -45,8 +45,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
m_astRoot = astRoot; m_astRoot = astRoot;
// let's populate the dictionary // let's populate the dictionary
try if (null == m_datatypeLSL2OpenSim)
{ {
m_datatypeLSL2OpenSim = new Dictionary<string, string>();
m_datatypeLSL2OpenSim.Add("integer", "LSL_Types.LSLInteger"); m_datatypeLSL2OpenSim.Add("integer", "LSL_Types.LSLInteger");
m_datatypeLSL2OpenSim.Add("float", "LSL_Types.LSLFloat"); m_datatypeLSL2OpenSim.Add("float", "LSL_Types.LSLFloat");
//m_datatypeLSL2OpenSim.Add("key", "LSL_Types.key"); // key doesn't seem to be used //m_datatypeLSL2OpenSim.Add("key", "LSL_Types.key"); // key doesn't seem to be used
@ -56,10 +57,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
m_datatypeLSL2OpenSim.Add("rotation", "LSL_Types.Quaternion"); m_datatypeLSL2OpenSim.Add("rotation", "LSL_Types.Quaternion");
m_datatypeLSL2OpenSim.Add("list", "LSL_Types.list"); m_datatypeLSL2OpenSim.Add("list", "LSL_Types.list");
} }
catch
{
// temporary workaround since we are adding to a static datatype
}
} }
/// <summary> /// <summary>

View File

@ -34,7 +34,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
public class LSL2CSCodeTransformer public class LSL2CSCodeTransformer
{ {
private SYMBOL m_astRoot = null; private SYMBOL m_astRoot = null;
private static Dictionary<string, string> m_datatypeLSL2OpenSim = new Dictionary<string, string>(); private static Dictionary<string, string> m_datatypeLSL2OpenSim = null;
/// <summary> /// <summary>
/// Pass the new CodeTranformer an abstract syntax tree. /// Pass the new CodeTranformer an abstract syntax tree.
@ -45,8 +45,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
m_astRoot = astRoot; m_astRoot = astRoot;
// let's populate the dictionary // let's populate the dictionary
try if (null == m_datatypeLSL2OpenSim)
{ {
m_datatypeLSL2OpenSim = new Dictionary<string, string>();
m_datatypeLSL2OpenSim.Add("integer", "LSL_Types.LSLInteger"); m_datatypeLSL2OpenSim.Add("integer", "LSL_Types.LSLInteger");
m_datatypeLSL2OpenSim.Add("float", "LSL_Types.LSLFloat"); m_datatypeLSL2OpenSim.Add("float", "LSL_Types.LSLFloat");
//m_datatypeLSL2OpenSim.Add("key", "LSL_Types.key"); // key doesn't seem to be used //m_datatypeLSL2OpenSim.Add("key", "LSL_Types.key"); // key doesn't seem to be used
@ -56,10 +57,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
m_datatypeLSL2OpenSim.Add("rotation", "LSL_Types.Quaternion"); m_datatypeLSL2OpenSim.Add("rotation", "LSL_Types.Quaternion");
m_datatypeLSL2OpenSim.Add("list", "LSL_Types.list"); m_datatypeLSL2OpenSim.Add("list", "LSL_Types.list");
} }
catch
{
// temporary workaround since we are adding to a static datatype
}
} }
/// <summary> /// <summary>