#104 String.indexof has different behavior

open-remind
None
5
2010-11-16
2010-08-03
Hao Zhong
No

I find that Java2CSharp maps java.lang.String.indexOf(String, int ) to ILOG.J2CsMapping.Util.StringUtil.IndexOf(String, String, int), and the two methods have different behavior as shown in the following code:
Java:
String obj = new String(new char[1]);
int mark = obj.indexOf("", 1073741824);//mark is 1
C#:
System.String obj = ILOG.J2CsMapping.Util.StringUtil.NewString(new char[1]);
int mark = ILOG.J2CsMapping.Util.StringUtil.IndexOf(obj,"",1073741824);//mark is 0

Discussion

  • Alexandre FAU

    Alexandre FAU - 2010-08-09
    • assigned_to: nobody --> alexandrefau
     
  • Alexandre FAU

    Alexandre FAU - 2010-11-16
    • status: open --> open-remind
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks