[Mono-bugs] [Bug 52800][Wis] New - System.Text.RegularExpression Incompatible IL

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 12 Jan 2004 16:59:50 -0500 (EST)

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by erdut2@ift.ulaval.ca.


--- shadow/52800	2004-01-12 16:59:49.000000000 -0500
+++ shadow/52800.tmp.26965	2004-01-12 16:59:49.000000000 -0500
@@ -0,0 +1,63 @@
+Bug#: 52800
+Product: Mono/Class Libraries
+Version: unspecified
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: erdut2@ift.ulaval.ca               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: System.Text.RegularExpression  Incompatible IL
+Description of Problem:
+When running an application using a RegexCollection with .net interpreter,
+a call to RegexCollection.Count throw an exception.
+Steps to reproduce the problem:
+Compile under Mono any class with function :
+void anyFunction()
+ Regex regex = new Regex("hello");
+ MatchCollection matches = regex.Matches("hello");
+ nbMatch = matches.Count;	
+Actual Results:
+Unhandled Exception: System.TypeLoadException: Could not load type
+System.Text.RegularExpressions.RegexCollectionBase from assembly System,
+Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
+   at test.RegexBench.Main(String[] args)
+Expected Results:
+How often does this happen? 
+Additional Information:
+The problem reside in the implementation of RegexCollection
+In Mono, RegexCollection inherit from RegexCollectionBase.
+In MS,  RegexCollection juste instanciate ICollection interface (do not
+call any base class function)
+Cut&Paste RegexCollectionBase code to RegexCollection.
+or better...
+In MS, I think RegexCollection isn't really a collection as we know it but
+actually execute the regex for each new item asked and then keep them in
+cache.  For exemple, a call to collection.Count will really do the job of
+matching the regex and not the Matches method like in mono. (Discovered
+this doing a benchmark)
+Could be a good improvement.