thedesolatesoul Expert Licensed User Longtime User Feb 4, 2012 #1 Hi, I dont really know if this is a bug or not. But if I use a key that does not exist with a map it returns a "null" instead of the generic Null. Code: Dim imgFile As String imgFile = MimeTypeMap.Get(db.GetFileExt(sft.FilePath)) If imgFile= Null OR imgFile = "null" Then imgFile = MimeTypeMap.Get("default") End If
Hi, I dont really know if this is a bug or not. But if I use a key that does not exist with a map it returns a "null" instead of the generic Null. Code: Dim imgFile As String imgFile = MimeTypeMap.Get(db.GetFileExt(sft.FilePath)) If imgFile= Null OR imgFile = "null" Then imgFile = MimeTypeMap.Get("default") End If
agraham Expert Licensed User Longtime User Feb 4, 2012 #2 Actually it does return null as you can see here Code: Dim m As Map m.Initialize Dim s, t As String Dim o As Object o = m.Get("bill") If o = Null Then t = "null" Else t = "not null" End If s = m.Get("fred") Msgbox(s & CRLF & t,"") The java is Code: //BA.debugLineNum = 19;BA.debugLine="s = m.Get(\"fred\")"; _s = String.valueOf(_m.Get((Object)("fred"))); The Java static valueOf method is documented to return "null" if given a null. I don't know why Erel chose valueOf for string conversions instead of toString.
Actually it does return null as you can see here Code: Dim m As Map m.Initialize Dim s, t As String Dim o As Object o = m.Get("bill") If o = Null Then t = "null" Else t = "not null" End If s = m.Get("fred") Msgbox(s & CRLF & t,"") The java is Code: //BA.debugLineNum = 19;BA.debugLine="s = m.Get(\"fred\")"; _s = String.valueOf(_m.Get((Object)("fred"))); The Java static valueOf method is documented to return "null" if given a null. I don't know why Erel chose valueOf for string conversions instead of toString.
thedesolatesoul Expert Licensed User Longtime User Feb 4, 2012 #3 I did suspect it would be a conversion issue. Well, its nothing of much concern. Just wanted to flag the issue. Thanks Andrew.
I did suspect it would be a conversion issue. Well, its nothing of much concern. Just wanted to flag the issue. Thanks Andrew.