Re: [Mono-dev] System.Collections.Specialized.NameValueCollection patch

2007-04-22 Thread Ilya Kharmatsky
Please review updated patch - fixed 'CopyTo' method - in negative flow 
will catch ArrayTypeMismatchException and will re-throw 
InvalidCastException (under NET_2_0 directive)



Eyal Alaluf wrote:

Hi, Ilya.

The fix in the CopyTo is incoreect. It disallows copying to object[] or
IConvertible[] etc.

Eyal.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ilya
Kharmatsky
Sent: 17 April 2007 12:29
To: mono-devel-list@lists.ximian.com
Subject: [Mono-dev] System.Collections.Specialized.NameValueCollection
patch

Hi,
Please approve attached patch which fix proper exception handling in 
CopyTo method and constructors which get another instance of 
NameValueCollection.

The patch contains also the respective test cases.

Ilya.
  
Index: Test/System.Collections.Specialized/NameValueCollectionTest.cs
===
--- Test/System.Collections.Specialized/NameValueCollectionTest.cs  
(revision 75811)
+++ Test/System.Collections.Specialized/NameValueCollectionTest.cs  
(working copy)
@@ -292,6 +292,21 @@
NameValueCollection c = new NameValueCollection ();
c.CopyTo (a, 0);
}
+   
+   [Test]
+#if NET_2_0
+   [ExpectedException (typeof (InvalidCastException))]
+#else  
+   [ExpectedException (typeof (ArrayTypeMismatchException))]
+#endif
+   public void CopyTo_WrongTypeArray ()
+   {
+   Array a = Array.CreateInstance (typeof (DateTime), 3);
+   NameValueCollection c = new NameValueCollection ();
+   for (int i = 0; i  3; i++)
+   c.Add(i.ToString(), i.ToString());
+   c.CopyTo(a, 0);
+   }
 
[Test]
public void Remove () 
@@ -323,8 +338,30 @@
AssertEquals (Remove-3-Count, 0, c.Count);
}
}
+   [Test]
 #if NET_2_0
+   [ExpectedException (typeof (ArgumentNullException))]
+#else
+   [ExpectedException (typeof (NullReferenceException))]
+#endif 
+   public void Constructor_Null_NVC ()
+   {
+   NameValueCollection nvc = new 
NameValueCollection((NameValueCollection)null);
+   }
+   
[Test]
+#if NET_2_0
+   [ExpectedException (typeof (ArgumentNullException))]
+#else
+   [ExpectedException (typeof (NullReferenceException))]
+#endif 
+   public void Constructor_Capacity_Null_NVC ()
+   {
+   NameValueCollection nvc = new NameValueCollection(10, 
(NameValueCollection)null);
+   }
+
+#if NET_2_0
+   [Test]
public void Constructor_IEqualityComparer ()
{
NameValueCollection coll = new NameValueCollection (new 
EqualityComparer ());
Index: System.Collections.Specialized/NameValueCollection.cs
===
--- System.Collections.Specialized/NameValueCollection.cs   (revision 75811)
+++ System.Collections.Specialized/NameValueCollection.cs   (working copy)
@@ -64,10 +64,15 @@
/// TODO: uncomment constructor below after it will be possible 
to compile NameValueCollection and
/// NameObjectCollectionBase to the same assembly 

-   public NameValueCollection( NameValueCollection col ) : 
base(col.HashCodeProvider,col.Comparer)
+   public NameValueCollection( NameValueCollection col ) : 
base((col == null) ? null : col.HashCodeProvider,
+
(col == null) ? null : col.Comparer)
{
if (col==null)
+#if NET_2_0
throw new ArgumentNullException (col);
+#else
+   throw new NullReferenceException();
+#endif 
Add(col);
}
 
@@ -93,7 +98,8 @@
/// NameObjectCollectionBase to the same assembly 

public NameValueCollection( int capacity, NameValueCollection 
col )
-   : base(capacity, col.HashCodeProvider, col.Comparer)
+   : base(capacity, (col == null) ? null : 
col.HashCodeProvider, 
+   (col == null) ? null : col.Comparer)
{
Add(col);   
}
@@ -263,7 +269,17 @@
 
if (cachedAll==null)
RefreshCachedAll();
+#if NET_2_0
+   try {
+#endif

[Mono-dev] System.Collections.Specialized.NameValueCollection patch

2007-04-17 Thread Ilya Kharmatsky

Hi,
Please approve attached patch which fix proper exception handling in 
CopyTo method and constructors which get another instance of 
NameValueCollection.

The patch contains also the respective test cases.

Ilya.
Index: Test/System.Collections.Specialized/NameValueCollectionTest.cs
===
--- Test/System.Collections.Specialized/NameValueCollectionTest.cs  
(revision 75718)
+++ Test/System.Collections.Specialized/NameValueCollectionTest.cs  
(working copy)
@@ -292,6 +292,21 @@
NameValueCollection c = new NameValueCollection ();
c.CopyTo (a, 0);
}
+   
+   [Test]
+#if NET_2_0
+   [ExpectedException (typeof (InvalidCastException))]
+#else  
+   [ExpectedException (typeof (ArrayTypeMismatchException))]
+#endif
+   public void CopyTo_WrongTypeArray ()
+   {
+   Array a = Array.CreateInstance (typeof (DateTime), 3);
+   NameValueCollection c = new NameValueCollection ();
+   for (int i = 0; i  3; i++)
+   c.Add(i.ToString(), i.ToString());
+   c.CopyTo(a, 0);
+   }
 
[Test]
public void Remove () 
@@ -323,8 +338,30 @@
AssertEquals (Remove-3-Count, 0, c.Count);
}
}
+   [Test]
 #if NET_2_0
+   [ExpectedException (typeof (ArgumentNullException))]
+#else
+   [ExpectedException (typeof (NullReferenceException))]
+#endif 
+   public void Constructor_Null_NVC ()
+   {
+   NameValueCollection nvc = new 
NameValueCollection((NameValueCollection)null);
+   }
+   
[Test]
+#if NET_2_0
+   [ExpectedException (typeof (ArgumentNullException))]
+#else
+   [ExpectedException (typeof (NullReferenceException))]
+#endif 
+   public void Constructor_Capacity_Null_NVC ()
+   {
+   NameValueCollection nvc = new NameValueCollection(10, 
(NameValueCollection)null);
+   }
+
+#if NET_2_0
+   [Test]
public void Constructor_IEqualityComparer ()
{
NameValueCollection coll = new NameValueCollection (new 
EqualityComparer ());
Index: System.Collections.Specialized/NameValueCollection.cs
===
--- System.Collections.Specialized/NameValueCollection.cs   (revision 75718)
+++ System.Collections.Specialized/NameValueCollection.cs   (working copy)
@@ -64,10 +64,15 @@
/// TODO: uncomment constructor below after it will be possible 
to compile NameValueCollection and
/// NameObjectCollectionBase to the same assembly 

-   public NameValueCollection( NameValueCollection col ) : 
base(col.HashCodeProvider,col.Comparer)
+   public NameValueCollection( NameValueCollection col ) : 
base((col == null) ? null : col.HashCodeProvider,
+
(col == null) ? null : col.Comparer)
{
if (col==null)
+#if NET_2_0
throw new ArgumentNullException (col);
+#else
+   throw new NullReferenceException();
+#endif 
Add(col);
}
 
@@ -93,7 +98,8 @@
/// NameObjectCollectionBase to the same assembly 

public NameValueCollection( int capacity, NameValueCollection 
col )
-   : base(capacity, col.HashCodeProvider, col.Comparer)
+   : base(capacity, (col == null) ? null : 
col.HashCodeProvider, 
+   (col == null) ? null : col.Comparer)
{
Add(col);   
}
@@ -260,6 +266,10 @@
throw new ArgumentOutOfRangeException(index, 
index is less than 0);
if (dest.Rank  1)
throw new ArgumentException (dest, 
multidim);
+#if NET_2_0
+   if (dest.GetType().GetElementType() != typeof (string))
+   throw new InvalidCastException();
+#endif 
 
if (cachedAll==null)
RefreshCachedAll();
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Problems with MonoTests.System.Net.FileWebRequestTest

2007-02-01 Thread Ilya Kharmatsky
Hi,

I'm running System tests (net_2_0 profile) on Cygwin/Windows-XP.

I've noticed that since the patch from Gert Driesen on 2007-01-28, the 
FileWebRequestTest produces a lot of errors (almost all sub tests in 
this file) and this due to the exception in file deletion. Actually same 
happens in Grasshopper configuration, and I think the root of the 
problem somewhere in Async method (when I'm comment out this method, 
only one test fails). IMHO, some resource handler (such as stream) is 
not properly released in this test.


Thanks,
Ilya.

P.S. - See log details below.




7) MonoTests.System.Net.FileWebRequestTest.Async :
TearDown : System.IO.IOException : Sharing violation on path 
c:\DOCUME~1\ilyak\LOCALS~1\Temp\MonoTests.System.Net.FileWebRequestTest\FileWebRequestTest.tmp

--TearDown
  at System.IO.File.Delete (System.String path) [0x000bf] in 
C:\cygwin\monobuild\mcs\class\corlib\System.IO\File.cs:175
  at MonoTests.System.Net.FileWebRequestTest.TearDown () [0x00033] in 
C:\cygwin\monobuild\mcs\class\System\Test\System.Net\FileWebRequestTest.cs:60 

  at 0x0 unknown method
  at (wrapper managed-to-native) 
System.Reflection.MonoMethod:InternalInvoke (object,object[])
  at System.Reflection.MonoMethod.Invoke (System.Object obj, 
BindingFlags invokeAttr, System.Reflection.Binder binder, 
System.Object[] parameters, System.Globalization.CultureInfo culture) 
[0x00056] in 
C:\cygwin\monobuild\mcs\class\corlib\System.Reflection\MonoMethod.cs:143

8) MonoTests.System.Net.FileWebRequestTest.Sync : System.IO.IOException 
: Sharing violation on path 
c:\DOCUME~1\ilyak\LOCALS~1\Temp\MonoTests.System.Net.FileWebRequestTest\FileWebRequestTest.tmp
TearDown : System.IO.IOException : Sharing violation on path 
c:\DOCUME~1\ilyak\LOCALS~1\Temp\MonoTests.System.Net.FileWebRequestTest\FileWebRequestTest.tmp
  at System.IO.File.Delete (System.String path) [0x000bf] in 
C:\cygwin\monobuild\mcs\class\corlib\System.IO\File.cs:175
  at MonoTests.System.Net.FileWebRequestTest.SetUp () [0x0006f] in 
C:\cygwin\monobuild\mcs\class\System\Test\System.Net\FileWebRequestTest.cs:49 

  at 0x0 unknown method
  at (wrapper managed-to-native) 
System.Reflection.MonoMethod:InternalInvoke (object,object[])
  at System.Reflection.MonoMethod.Invoke (System.Object obj, 
BindingFlags invokeAttr, System.Reflection.Binder binder, 
System.Object[] parameters, System.Globalization.CultureInfo culture) 
[0x00056] in 
C:\cygwin\monobuild\mcs\class\corlib\System.Reflection\MonoMethod.cs:143
--TearDown
  at System.IO.File.Delete (System.String path) [0x000bf] in 
C:\cygwin\monobuild\mcs\class\corlib\System.IO\File.cs:175
  at MonoTests.System.Net.FileWebRequestTest.TearDown () [0x00033] in 
C:\cygwin\monobuild\mcs\class\System\Test\System.Net\FileWebRequestTest.cs:60 

  at 0x0 unknown method
  at (wrapper managed-to-native) 
System.Reflection.MonoMethod:InternalInvoke (object,object[])
  at System.Reflection.MonoMethod.Invoke (System.Object obj, 
BindingFlags invokeAttr, System.Reflection.Binder binder, 
System.Object[] parameters, System.Globalization.CultureInfo culture) 
[0x00056] in 
C:\cygwin\monobuild\mcs\class\corlib\System.Reflection\MonoMethod.cs:143

9) MonoTests.System.Net.FileWebRequestTest.ConnectionGroupName : 
System.IO.IOException : Sharing violation on path 
c:\DOCUME~1\ilyak\LOCALS~1\Temp\MonoTests.System.Net.FileWebRequestTest\FileWebRequestTest.tmp
TearDown : System.IO.IOException : Sharing violation on path 
c:\DOCUME~1\ilyak\LOCALS~1\Temp\MonoTests.System.Net.FileWebRequestTest\FileWebRequestTest.tmp
  at System.IO.File.Delete (System.String path) [0x000bf] in 
C:\cygwin\monobuild\mcs\class\corlib\System.IO\File.cs:175
  at MonoTests.System.Net.FileWebRequestTest.SetUp () [0x0006f] in 
C:\cygwin\monobuild\mcs\class\System\Test\System.Net\FileWebRequestTest.cs:49 

  at 0x0 unknown method
  at (wrapper managed-to-native) 
System.Reflection.MonoMethod:InternalInvoke (object,object[])
  at System.Reflection.MonoMethod.Invoke (System.Object obj, 
BindingFlags invokeAttr, System.Reflection.Binder binder, 
System.Object[] parameters, System.Globalization.CultureInfo culture) 
[0x00056] in 
C:\cygwin\monobuild\mcs\class\corlib\System.Reflection\MonoMethod.cs:143
--TearDown
  at System.IO.File.Delete (System.String path) [0x000bf] in 
C:\cygwin\monobuild\mcs\class\corlib\System.IO\File.cs:175
  at MonoTests.System.Net.FileWebRequestTest.TearDown () [0x00033] in 
C:\cygwin\monobuild\mcs\class\System\Test\System.Net\FileWebRequestTest.cs:60 

  at 0x0 unknown method
  at (wrapper managed-to-native) 
System.Reflection.MonoMethod:InternalInvoke (object,object[])
  at System.Reflection.MonoMethod.Invoke (System.Object obj, 
BindingFlags invokeAttr, System.Reflection.Binder binder, 
System.Object[] parameters, System.Globalization.CultureInfo culture) 
[0x00056] in 
C:\cygwin\monobuild\mcs\class\corlib\System.Reflection\MonoMethod.cs:143

10) MonoTests.System.Net.FileWebRequestTest.ContentLength : 

[Mono-dev] BaseCompareValidatorTest - fix

2007-01-09 Thread Ilya Kharmatsky
) ?
+NumberFormatInfo.InvariantInfo :
+NumberFormatInfo.CurrentInfo;
+value = Decimal.Parse(text, NumberStyles.Currency, 
currencyFormatProvider);
+return true;
+
+default:
+value = null;
+return false;
+}
+}
+catch
+{
+value = null;
+return false;
+}
}
-#endif
}
 
 }
 
 
+
+
Index: System.Web/System.Web.UI.WebControls/ChangeLog
===
--- System.Web/System.Web.UI.WebControls/ChangeLog  (revision 70722)
+++ System.Web/System.Web.UI.WebControls/ChangeLog  (working copy)
@@ -1,3 +1,8 @@
+2007-01-09  Ilya Kharmatsky ilyak-at-mainsoft.com
+   * BaseCompareValidator
+   * CompareValidator
+   Fixed the Invariant Calture issues.
+
 2007-01-08  Vladimir Krasnov  [EMAIL PROTECTED]
 
* SqlDataSourceView.cs: fixed parameters init for ExecuteUpdate
Index: System.Web/System.Web.UI.WebControls/CompareValidator.cs
===
--- System.Web/System.Web.UI.WebControls/CompareValidator.cs(revision 70722)
+++ System.Web/System.Web.UI.WebControls/CompareValidator.cs(working copy)
@@ -62,11 +62,16 @@
 
protected override bool ControlPropertiesValid ()
{
-   /* if the control id is the default , or if we're
+if ((this.Operator != ValidationCompareOperator.DataTypeCheck)  
!BaseCompareValidator.CanConvert(this.ValueToCompare, this.Type, 
this.CultureInvariantValues))
+{
+throw new HttpException(
+String.Format(Unable to convert the value: {0} as a {1}, 
ValueToCompare, Enum.GetName(typeof(ValidationDataType), this.Type)));
+}
+/* if the control id is the default , or if we're
 * using the one Operator that ignores the control
 * id.. */
-   if (ControlToCompare ==  || Operator == 
ValidationCompareOperator.DataTypeCheck)
-   return base.ControlPropertiesValid();
+if (ControlToCompare ==  || Operator == 
ValidationCompareOperator.DataTypeCheck)
+return base.ControlPropertiesValid();
 
/* attempt to locate the ControlToCompare somewhere on 
the page */
Control control = NamingContainer.FindControl 
(ControlToCompare);
@@ -86,9 +91,9 @@
/* ControlToCompare takes precendence, if it's set. */
compare = (ControlToCompare !=  ? 
GetControlValidationValue (ControlToCompare) : ValueToCompare);
 
-   return BaseCompareValidator.Compare 
(GetControlValidationValue (ControlToValidate), compare,
-Operator,
-this.Type);
+return BaseCompareValidator.Compare (GetControlValidationValue 
(ControlToValidate), false, 
+compare, this.CultureInvariantValues,
+   Operator, 
this.Type);
}
 
[DefaultValue()]
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Reading and writing excel files

2006-02-01 Thread Ilya Kharmatsky




You can also use this Java library : http://www.andykhan.com/jexcelapi/


Jonathan Pryor wrote:

  On Tue, 2006-01-31 at 10:24 +0100, "ZABALA CALVO, IÑAKI" wrote:
  
  
I am trying to read and write Excel .xls files
I have tried it with COM:

  
  
Mono does not currently support COM interop, though Jonathan Chambers is
attempting such functionality...

If you want to write Excel files, you'll either need to skip Mono
entirely (use .NET instead or _vbscript_ or...), or you could look into
alternate .xls creation functionality (such as porting Jakarta POI to C#
or using Jakarta POI through IKVM -- see
http://jakarta.apache.org/poi/index.html).

 - Jon


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
  



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] Re: FW: Soap Serialization interop

2005-06-21 Thread Ilya Kharmatsky




Hi, Hubert! 
I think its not related to bug 75323 - since in 
Web Services there is no use of Soap Serialization -
the framework uses Xml Serialization...

Ilya Kharmatsky.

Hubert FONGARNAND wrote:

  It may refer to the bug #75323 ?

Le Mardi 21 Juin 2005 16:32, Rafael Teixeira a crit:
  
  
Hi Robert,

Outputs as I and many other Mono developers mainly use only Linux
nowadays and so we can't easily reproduce cross-framework issues.

But sure you can post your test here, or attach it to a bugcase, so
that people that work in windows can help as well.

Thanks,

:)

On 6/21/05, Robert Jordan [EMAIL PROTECTED] wrote:


  Rafael,

  
  
Robert,

We fix things in the interop/serialization area as needed and possible
when enough information is given to us...

  
  I have an automatic test for serialization issues. Do you
want the test itself or just its output?

Rob

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
  

  
  ___
Ce message et les ventuels documents joints peuvent contenir des informations confidentielles.
Au cas o il ne vous serait pas destin, nous vous remercions de bien vouloir le supprimer et en aviser immdiatement l'expditeur. Toute utilisation de ce message non conforme  sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'tant pas scurises, l'intgrit de ce message n'est pas assure et la socit mettrice ne peut tre tenue pour responsable de son contenu.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

  



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] Re: FW: Soap Serialization interop

2005-06-21 Thread Ilya Kharmatsky




Hi, Robert!

Please post your tests - we are currently working
on Soap Serialization test suite, so your tests could help us.


Ilya Kharmatsky.


Robert Jordan wrote:
Rafael,
  
  
  Robert,


We fix things in the interop/serialization area as needed and possible

when enough information is given to us...

  
  
I have an automatic test for serialization issues. Do you
  
want the test itself or just its output?
  
  
Rob
  
  
___
  
Mono-devel-list mailing list
  
Mono-devel-list@lists.ximian.com
  
http://lists.ximian.com/mailman/listinfo/mono-devel-list
  
  



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] System.Web/System.Web.Mail - patch (code synchronization between Mono and Mainsoft)

2005-06-13 Thread Ilya Kharmatsky




I don't think so. Our general policy is to throw
proper .Net exception, instead
of java exception in case when it needed by API, however in case when
.Net
is not define any exception - we prefer to throw java exception - this
may be 
more useful for user in order to understand and solve the problem.
(For example you will not put at any line of code try/catch of
java.lang.RuntimeException, java.lang.Error etc. - this in order to pop
up more
"beautiful" exception). I really don't understand why it "would be
better" to throw 
SocketException in this case.


Ilya.


Konstantin Triger wrote:
Agreed,
but anyway, throwing SocketException would be better than
UnknownHostException
/jdk142/api/java/net/UnknownHostException.html.
  
You can also suppress the exception and pass "localhost" instead.
  
  
Regards,
  
Konstantin Triger
  
  
  
  
Ilya Kharmatsky wrote:
  
  
  In this case there is no "appropriate" throw.
May be I'm wrong, but

in .Net code there is no exception in this method.


Konstantin Triger wrote:


Hi Ilya,
  
  
It's worth to wrap the
  
  
"java.net.InetAddress address = java.net.InetAddress.getLocalHost();"
  
  
with an appropriate try/catch/throw, otherwise a Java exception would
be thrown to the user.
  
  
Regards,
      
Konstantin Triger
  
  
  
  
Ilya Kharmatsky wrote:
  
  
  Please review the patch.


Thanks,

Ilya.





Index: ChangeLog

===

--- ChangeLog (revision 45568)

+++ ChangeLog (working copy)
    
@@ -1,3 +1,9 @@

+2005-06-08 Ilya Kharmatsky ilyak-at-mainsoft.com

+

+ * SmtpMail.cs: Added TARGET_JVM directive in Send method,

+ where we will use in J2EE configuration the "native" java

+ support for obtaining the network address of localhost.

+ 2005-04-20 Gonzalo Paniagua Javier [EMAIL PROTECTED]


 * SmtpClient.cs:

Index: SmtpMail.cs

===

--- SmtpMail.cs (revision 45614)

+++ SmtpMail.cs (working copy)

@@ -64,7 +64,17 @@

 // access to properties and to add some functionality

 MailMessageWrapper messageWrapper = new MailMessageWrapper(
message );

 +#if TARGET_JVM

+ string currentSmtpServer = smtpServer;

+ if (currentSmtpServer == "localhost")

+ {

+ java.net.InetAddress address =
java.net.InetAddress.getLocalHost();

+ currentSmtpServer = address.getHostAddress();

+ }

+ SmtpClient smtp = new SmtpClient (currentSmtpServer);

+#else

 SmtpClient smtp = new SmtpClient (smtpServer);

+#endif

  smtp.Send (messageWrapper);

 



___

Mono-devel-list mailing list

Mono-devel-list@lists.ximian.com

http://lists.ximian.com/mailman/listinfo/mono-devel-list




  
  

  
  



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Fwd: Re: [Mono-devel-list] System.Web/System.Web.UI - patch (code synchronization between Mono and Mainsoft)]

2005-06-11 Thread Ilya Kharmatsky






 Original Message 

  

  Subject: 
  Re: [Mono-devel-list] System.Web/System.Web.UI - patch (code
synchronization between Mono and Mainsoft)


  Date: 
  Sat, 11 Jun 2005 15:35:32 +0300


  From: 
  Ilya Kharmatsky [EMAIL PROTECTED]


  To: 
  Ben Maurer [EMAIL PROTECTED]


  References: 
  [EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

  






Ben Maurer wrote:

  On Sat, 2005-06-11 at 09:43 +0300, Ilya Kharmatsky wrote:
  
  


  

In "empty page" benchmark - under heavy stress - it took 3-5% of
overall server side job.
I'm talking about "empty page", where no too much flows works. 

  
  
Wow. How much slower are you on a raw benchmark of accessing a struct
array?
  

"Accessing" is not a point. The initialization of such array is root of
troubles. I have no raw benchmark
but this cost will be proportional to length of array * "new". Since,
currently I'm on vocation - I cannot
run it and say you exact numbers.

  Given those numbers, it seems like struct member access is a few orders
of magnitude slower than it should be. Sounds like something that needs
to be fixed at the source... A 3-5% improvement on web requests makes
for a nice incentive!

  

Since each request - created new instanced of these arrays - we got the
problem. 


  

  BTW, doesn't this show up with Hashtable, which also uses an array of
structs?

  
  

In Grasshopper we are using completely different implementation of
Hashtable (BTW our 
implementation doesn't use structs and works faster then mono's
original hashtable and msft
hashtable).

  
  
How about in terms of memory usage? 

I don't know exact numbers - but it shouldn't be a problem.

  Care to share? Have benchmarks?
  

I have no benchmarks currently , it depends also on operation (Add,
Remove, ContainsKey).
When I'll be back in office I'll send the benchmarks and code - but our
code has been strongly 
influenced by :
http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap.html

(you can download code from here:
http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html
check "installation" part)

As I told, when I'll return to office - I'll send our version of
Hashtable.cs

Ilya.


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] System.Web/System.Web.UI - patch (code synchronization between Mono and Mainsoft)

2005-06-10 Thread Ilya Kharmatsky




Hi, All!

Rafael's guess is correct. Since Java doesn't support structs at all -
we are forced to
use classes instead of all ValueTypes. In case of struct array
initialization - our converter
(which converts MSIL = Java bytecode) generates "hidden" helper
functions
which initialize each element of array before first usage of such array.

Ilya.



Rafael Teixeira wrote:

  I maybe due to the fact that Java, doesn't have value objects other
than the basic crowd (int, long, double, float...), and to be able to
have the value semantics GH has to create lots of
imuttable/cloneable/value-comparable objects...

Just guessing...

On 6/9/05, Ben Maurer [EMAIL PROTECTED] wrote:
  
  
On Thu, 2005-06-09 at 19:05 -0400, Gonzalo Paniagua Javier wrote:


  On Wed, 2005-06-08 at 14:11 +0300, Ilya Kharmatsky wrote:
  
  
Please review the patch.

BTW, in HtmlTextWriter.cs we changed internal structs (e.g.
RenderStyle) to be the classes
 and not structs - this in order to resolve heavy performance problem
in our implementation
 of initialization of arrays of structs. May be the better idea is to
change also original mono
 code - since in this case we can avoid additional "splitting" of code
between standard and
 J2EE configuration. I think impact of this won't be too high - from
perspective of memory
 consumption and performance.

  
  RenderAttribute, TagInformation and RenderStyle might be ok as classes.
As you say, this is no big deal. Feel free to make those classes if
nothing breaks.
  

What exactly do you guys do when initing an array of structs that is so
slow?

In this case, chances are, performance won't suffer that much. It does
make our GC do more work than it needs to (and it is already pretty
heavy on stuff).

However, there are cases where using arrays of structs will give us a
large benefit in C#. So it would make sense to figure out what is
happening, rather than to shove it under the rug.

-- Ben

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


  
  

  



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] System.Web/System.Web.UI - patch (code synchronization between Mono and Mainsoft)

2005-06-10 Thread Ilya Kharmatsky







  
What if you split up such arrays. IE:

struct X {
   int a; int b; int c;
}

X [] foo;

Turns into:

int foo_A [];
int foo_B [];
int foo_C [];

  

It is complicated task in perspective of our conveter - if it will use
you suggestion, it should
remember the context of each foo_X array (in order for example to call
proper functions etc.)


  
The optimization of handling structs should take place in the .net -
java converter, not in our source code.

And if usage of structs in specific place in our source code is
optional? I'm talking about specific
case. This is not general proposal for optimization in every place,
where arrays of structs are used! 




___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] System.Web/System.Web.SessionState - patch (code synchronization between Mono and Mainsoft)

2005-06-09 Thread Ilya Kharmatsky




I agree, good shot Ben!
Attached updated patch.

Thank you,
Ilya.

Ben Maurer wrote:

  On Wed, 2005-06-08 at 13:17 +0300, Ilya Kharmatsky wrote:
  
  
InProc = 1,
StateServer = 2,
SQLServer = 3
+#if TARGET_J2EE
+   ,J2ee = 4
+#endif

  
  
It's probably a bad idea to add such a low enumeration value, as msft
could add a value here.

-- Ben


  



Index: ChangeLog
===
--- ChangeLog   (revision 45568)
+++ ChangeLog   (working copy)
@@ -1,3 +1,12 @@
+2005-06-08 Ilya Kharmatsky ilyak-at-mainsoft.com
+
+* SessionStateMode.cs: Added TARGET_J2EE directive in order
+to provide in J2EE configuration additional mode - J2EE
+* SessionStateModule.cs: Added TARGET_JVM directives in order
+to resolve unsupported in Ghrasshopper static variables issue
+(When static variable are stored in general place, instead of
+storing such variables per AppDomain).
+
 2005-05-27 Gonzalo Paniagua Javier [EMAIL PROTECTED]
 
* RemoteStateServer.cs:
Index: SessionStateMode.cs
===
--- SessionStateMode.cs (revision 45568)
+++ SessionStateMode.cs (working copy)
@@ -35,6 +35,9 @@
InProc = 1,
StateServer = 2,
SQLServer = 3
+#if TARGET_J2EE
+   ,J2ee = 4
+#endif
 }
 
 }
Index: SessionStateModule.cs
===
--- SessionStateModule.cs   (revision 45568)
+++ SessionStateModule.cs   (working copy)
@@ -42,8 +42,27 @@
internal static readonly string CookieName = ASPSESSION;
internal static readonly string HeaderName = 
AspFilterSessionId;

+#if !TARGET_J2EE   
static SessionConfig config;
static Type handlerType;
+#else
+   static private SessionConfig config {
+   get {
+   return 
(SessionConfig)AppDomain.CurrentDomain.GetData(SessionStateModule.config);
+   }
+   set {
+   
AppDomain.CurrentDomain.SetData(SessionStateModule.config, value);
+   }
+   }
+   static private Type handlerType {
+   get {
+   return 
(Type)AppDomain.CurrentDomain.GetData(SessionStateModule.handlerType);
+   }
+   set {
+   
AppDomain.CurrentDomain.SetData(SessionStateModule.handlerType, value);
+   }
+   }
+#endif 
ISessionHandler handler;
bool sessionForStaticFiles;

@@ -197,8 +216,10 @@
 
internal void OnEnd ()
{
+#if !TARGET_J2EE   
if (End != null)
End (this, EventArgs.Empty);
+#endif 
}

public event EventHandler Start;
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] System.Web/System.Web.SessionState - patch (code synchronization between Mono and Mainsoft)

2005-06-09 Thread Ilya Kharmatsky




Sorry I've sent the old diff - here is a new one - the value changed to
'1024'.

Ilya Kharmatsky wrote:

  
  I agree, good shot Ben!
Attached updated patch.
  
Thank you,
Ilya.
  
Ben Maurer wrote:
  
On Wed, 2005-06-08 at 13:17 +0300, Ilya Kharmatsky wrote:
  

  InProc = 1,
StateServer = 2,
SQLServer = 3
+#if TARGET_J2EE
+   ,J2ee = 4
+#endif



It's probably a bad idea to add such a low enumeration value, as msft
could add a value here.

-- Ben


  
  
  



Index: ChangeLog
===
--- ChangeLog   (revision 45568)
+++ ChangeLog   (working copy)
@@ -1,3 +1,12 @@
+2005-06-08 Ilya Kharmatsky ilyak-at-mainsoft.com
+
+* SessionStateMode.cs: Added TARGET_J2EE directive in order
+to provide in J2EE configuration additional mode - J2EE
+* SessionStateModule.cs: Added TARGET_JVM directives in order
+to resolve unsupported in Ghrasshopper static variables issue
+(When static variable are stored in general place, instead of
+storing such variables per AppDomain).
+
 2005-05-27 Gonzalo Paniagua Javier [EMAIL PROTECTED]
 
* RemoteStateServer.cs:
Index: SessionStateMode.cs
===
--- SessionStateMode.cs (revision 45568)
+++ SessionStateMode.cs (working copy)
@@ -35,6 +35,9 @@
InProc = 1,
StateServer = 2,
SQLServer = 3
+#if TARGET_J2EE
+   ,J2ee = 1024
+#endif
 }
 
 }
Index: SessionStateModule.cs
===
--- SessionStateModule.cs   (revision 45568)
+++ SessionStateModule.cs   (working copy)
@@ -42,8 +42,27 @@
internal static readonly string CookieName = ASPSESSION;
internal static readonly string HeaderName = 
AspFilterSessionId;

+#if !TARGET_J2EE   
static SessionConfig config;
static Type handlerType;
+#else
+   static private SessionConfig config {
+   get {
+   return 
(SessionConfig)AppDomain.CurrentDomain.GetData(SessionStateModule.config);
+   }
+   set {
+   
AppDomain.CurrentDomain.SetData(SessionStateModule.config, value);
+   }
+   }
+   static private Type handlerType {
+   get {
+   return 
(Type)AppDomain.CurrentDomain.GetData(SessionStateModule.handlerType);
+   }
+   set {
+   
AppDomain.CurrentDomain.SetData(SessionStateModule.handlerType, value);
+   }
+   }
+#endif 
ISessionHandler handler;
bool sessionForStaticFiles;

@@ -197,8 +216,10 @@
 
internal void OnEnd ()
{
+#if !TARGET_J2EE   
if (End != null)
End (this, EventArgs.Empty);
+#endif 
}

public event EventHandler Start;
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] System.Web/System.Web.Mail - patch (code synchronization between Mono and Mainsoft)

2005-06-09 Thread Ilya Kharmatsky




In this case there is no "appropriate" throw. May
be I'm wrong, but 
in .Net code there is no exception in this method.

Konstantin Triger wrote:
Hi Ilya,
  
  
It's worth to wrap the
  
  
"java.net.InetAddress address = java.net.InetAddress.getLocalHost();"
  
  
with an appropriate try/catch/throw, otherwise a Java exception would
be thrown to the user.
  
  
Regards,
  
Konstantin Triger
  
  
  
  
Ilya Kharmatsky wrote:
  
  
  Please review the patch.


Thanks,

Ilya.





Index: ChangeLog

===

--- ChangeLog (revision 45568)

+++ ChangeLog (working copy)

@@ -1,3 +1,9 @@
    
+2005-06-08 Ilya Kharmatsky ilyak-at-mainsoft.com

+

+ * SmtpMail.cs: Added TARGET_JVM directive in Send method,

+ where we will use in J2EE configuration the "native" java

+ support for obtaining the network address of localhost.

+ 2005-04-20 Gonzalo Paniagua Javier [EMAIL PROTECTED]


* SmtpClient.cs:

Index: SmtpMail.cs

===

--- SmtpMail.cs (revision 45614)

+++ SmtpMail.cs (working copy)

@@ -64,7 +64,17 @@

 // access to properties and to add some functionality

 MailMessageWrapper messageWrapper = new MailMessageWrapper(
message );

 
+#if TARGET_JVM

+ string currentSmtpServer = smtpServer;

+ if (currentSmtpServer == "localhost")

+ {

+ java.net.InetAddress address =
java.net.InetAddress.getLocalHost();

+ currentSmtpServer = address.getHostAddress();

+ }

+ SmtpClient smtp = new SmtpClient (currentSmtpServer);

+#else

 SmtpClient smtp = new SmtpClient (smtpServer);

+#endif

 
 smtp.Send (messageWrapper);

 





___

Mono-devel-list mailing list

Mono-devel-list@lists.ximian.com

http://lists.ximian.com/mailman/listinfo/mono-devel-list




  
  



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] System.Web/System.Web - patch (code synchronization between Mono and Mainsoft)

2005-06-08 Thread Ilya Kharmatsky




Hi, All!

Please review updated version of patch.

Thanks,
Ilya.

Gonzalo Paniagua Javier wrote:

  On Mon, 2005-06-06 at 18:17 +0300, Svetlana Zholkovsky wrote:
  
  
Hello All!
Attached diff is related to Mainsoft's effort to synchronize code base
between Mono and Mainsoft in System.Web assembly.
As a first stage we are providing only J2EE/JVM related directives and 
changes.
The original code flow of Mono will not be affected by these changes.
I'll send for each namespace separate mail with respective diff file.
The patch in attachment related to System.Web/System.Web namespace.
Please review it and if no objectives will be received I'll commit it in
next several days.

  
  
Please, go ahead and commit.
Btw, you sent the whole changelog, not just the diffs.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

  



Index: CapabilitiesLoader.cs
===
--- CapabilitiesLoader.cs   (revision 45568)
+++ CapabilitiesLoader.cs   (working copy)
@@ -181,7 +181,9 @@
lock (lockobj) {
if (loaded)
return;
-
+#if TARGET_J2EE
+   string filepath = browscap.ini
+#else
string dir = Path.GetDirectoryName 
(WebConfigurationSettings.MachineConfigPath);
string filepath = Path.Combine (dir, 
browscap.ini);
if (!File.Exists (filepath)) {
@@ -189,7 +191,7 @@
dir = Path.GetDirectoryName (dir);
filepath = Path.Combine (dir, 
browscap.ini);
}
-
+#endif
try {
LoadFile (filepath);
} catch (Exception) { }
@@ -197,13 +199,38 @@
loaded = true;
}
}
-
+#if TARGET_J2EE
+   private static TextReader GetJavaTextReader(string filename)
+   {
+   Stream s;
+   try
+   {
+   java.lang.ClassLoader cl = (java.lang.ClassLoader)
+   
AppDomain.CurrentDomain.GetData(GH_ContextClassLoader);
+   if (cl == null)
+   return null;
+   java.io.InputStream inputStream = 
cl.getResourceAsStream(filename);
+   s = (Stream)vmw.common.IOUtils.getStream(inputStream);
+   }
+   catch (Exception e)
+   {
+   return null;
+   }
+   return = new StreamReader (s);
+   }
+#endif
static void LoadFile (string filename)
{
+#if TARGET_J2EE
+   TextReader input = GetJavaTextReader(filename);
+   if(input == null)
+   return;
+#else
if (!File.Exists (filename))
return;
 
TextReader input = new StreamReader (File.OpenRead 
(filename));
+#endif
string str;
Hashtable allhash = new Hashtable ();
int aux = 0;
Index: ChangeLog
===
--- ChangeLog   (revision 45568)
+++ ChangeLog   (working copy)
@@ -1,3 +1,18 @@
+2005-06-06  Svetlana Zholkovsky svetlanaz-at-mainsoft.com
+* In following classes added TARGET_J2EE or/and TARGET_JVM
+   directives:
+   - HttpResponse.cs
+   - HttpRuntime.cs
+   - HttpUtility.cs
+   - CapabilitiesLoader.cs
+   - HttpApplication.cs
+   - HttpApplicationFactory.cs
+   - HttpContext.cs
+   - HttpException.cs
+   - HttpRequest.cs
+* Added Mainsoft's specific files :
+   - GhHttpAsyncResult.jvm.cs
+   
 2005-06-06 Gonzalo Paniagua Javier [EMAIL PROTECTED]
 
* HttpUtility.cs: fix InvalidCastException.
Index: HttpContext.cs
===
--- HttpContext.cs  (revision 45568)
+++ HttpContext.cs  (working copy)
@@ -65,6 +65,10 @@
string errorPage;
IPrincipal user;

+#if TARGET_J2EE
+   private object LOCK = new object();
+#endif
+
 #if NET_2_0
private System.Web.UI.Page lastPage;
 #endif
@@ -202,13 +206,33 @@
}
}
 
+#if TARGET_J2EE
+   public 

[Mono-devel-list] System.Web/System.Web.Mail - patch (code synchronization between Mono and Mainsoft)

2005-06-08 Thread Ilya Kharmatsky




Please review the patch.

Thanks,
Ilya.



Index: ChangeLog
===
--- ChangeLog   (revision 45568)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2005-06-08 Ilya Kharmatsky ilyak-at-mainsoft.com
+
+* SmtpMail.cs: Added TARGET_JVM directive in Send method,
+where we will use in J2EE configuration the native java
+support for obtaining the network address of localhost.
+
 2005-04-20 Gonzalo Paniagua Javier [EMAIL PROTECTED]
 
* SmtpClient.cs:
Index: SmtpMail.cs
===
--- SmtpMail.cs (revision 45614)
+++ SmtpMail.cs (working copy)
@@ -64,7 +64,17 @@
// access to properties and to add some functionality
MailMessageWrapper messageWrapper = new 
MailMessageWrapper( message );

+#if TARGET_JVM
+   string currentSmtpServer = smtpServer;
+   if (currentSmtpServer == localhost)
+   {
+   java.net.InetAddress address = 
java.net.InetAddress.getLocalHost();
+   currentSmtpServer = address.getHostAddress();
+   }
+   SmtpClient smtp = new SmtpClient (currentSmtpServer);
+#else
SmtpClient smtp = new SmtpClient (smtpServer);
+#endif

smtp.Send (messageWrapper);
   
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] System.Web/System.Web.SessionState - patch (code synchronization between Mono and Mainsoft)

2005-06-08 Thread Ilya Kharmatsky




Please review changes.

Thanks,
Ilya.



Index: ChangeLog
===
--- ChangeLog   (revision 45568)
+++ ChangeLog   (working copy)
@@ -1,3 +1,12 @@
+2005-06-08 Ilya Kharmatsky ilyak-at-mainsoft.com
+
+* SessionStateMode.cs: Added TARGET_J2EE directive in order
+to provide in J2EE configuration additional mode - J2EE
+* SessionStateModule.cs: Added TARGET_JVM directives in order
+to resolve unsupported in Ghrasshopper static variables issue
+(When static variable are stored in general place, instead of
+storing such variables per AppDomain).
+
 2005-05-27 Gonzalo Paniagua Javier [EMAIL PROTECTED]
 
* RemoteStateServer.cs:
Index: SessionStateMode.cs
===
--- SessionStateMode.cs (revision 45568)
+++ SessionStateMode.cs (working copy)
@@ -35,6 +35,9 @@
InProc = 1,
StateServer = 2,
SQLServer = 3
+#if TARGET_J2EE
+   ,J2ee = 4
+#endif
 }
 
 }
Index: SessionStateModule.cs
===
--- SessionStateModule.cs   (revision 45568)
+++ SessionStateModule.cs   (working copy)
@@ -42,8 +42,27 @@
internal static readonly string CookieName = ASPSESSION;
internal static readonly string HeaderName = 
AspFilterSessionId;

+#if !TARGET_J2EE   
static SessionConfig config;
static Type handlerType;
+#else
+   static private SessionConfig config {
+   get {
+   return 
(SessionConfig)AppDomain.CurrentDomain.GetData(SessionStateModule.config);
+   }
+   set {
+   
AppDomain.CurrentDomain.SetData(SessionStateModule.config, value);
+   }
+   }
+   static private Type handlerType {
+   get {
+   return 
(Type)AppDomain.CurrentDomain.GetData(SessionStateModule.handlerType);
+   }
+   set {
+   
AppDomain.CurrentDomain.SetData(SessionStateModule.handlerType, value);
+   }
+   }
+#endif 
ISessionHandler handler;
bool sessionForStaticFiles;

@@ -197,8 +216,10 @@
 
internal void OnEnd ()
{
+#if !TARGET_J2EE   
if (End != null)
End (this, EventArgs.Empty);
+#endif 
}

public event EventHandler Start;
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] System.Web/System.Web.Caching - patch (code synchronization between Mono and Mainsoft)

2005-06-08 Thread Ilya Kharmatsky




Please review the patch.

Thanks,
Ilya.



Index: CacheDependency.cs
===
--- CacheDependency.cs  (revision 45568)
+++ CacheDependency.cs  (working copy)
@@ -58,8 +58,12 @@
bool disposed;
CacheEntry [] entries;
CacheItemRemovedCallback removedDelegate;
+
+#if !TARGET_J2EE
+
FileSystemWatcher [] watchers;
 
+#endif
private CacheDependency ()
{
}
@@ -157,13 +161,17 @@
}
}
 
+#if !TARGET_J2EE
+
if (filenames.Length  0) {
watchers = new FileSystemWatcher 
[filenames.Length];
for (int i=0; ifilenames.Length; i++)
watchers [i] = CreateWatcher (filenames 
[i]);
}
+#endif
}
 
+#if !TARGET_J2EE
private FileSystemWatcher CreateWatcher (string file)
{
FileSystemWatcher watcher = new FileSystemWatcher ();
@@ -184,6 +192,7 @@
{
OnChanged (sender, e);
}
+#endif
 
void CacheItemRemoved (string key, object value, 
CacheItemRemovedReason reason)
{
@@ -200,11 +209,17 @@
Changed (this, new CacheDependencyChangedArgs 
(null));
}
 
+#if TARGET_J2EE
+   public void Dispose ()
+   {
+   }
+#else
public void Dispose ()
{
for (int i=0; iwatchers.Length; i++)
watchers [i].Dispose ();
}
+#endif
 
public bool HasChanged
{
Index: ChangeLog
===
--- ChangeLog   (revision 45568)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2005-06-08 Ilya Kharmatsky ilyak-at-mainsoft.com
+   
+   * CacheDependency.cs - added TARGET_JVM directives in places,
+ where file watching is using (Mainsoft's implementation currently
+ doesn't support the feature).
+ 
 2005-05-09 Gonzalo Paniagua Javier [EMAIL PROTECTED]
 
* CacheEntry.cs: credits for this patch should go to mcs. it catched
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] [Fwd: System.Web/System.Web.Configuration - patch (code synchronization between Mono and Mainsoft)]

2005-06-08 Thread Ilya Kharmatsky





Oups - I've forgot to send it to the list...

 Original Message 

  

  Subject: 
  System.Web/System.Web.Configuration - patch (code
synchronization between Mono and Mainsoft)


  Date: 
  Wed, 08 Jun 2005 13:20:40 +0300


  From: 
  Ilya Kharmatsky [EMAIL PROTECTED]


  To: 
  Gonzalo Paniagua Javier [EMAIL PROTECTED]

  




Please review the patch.

Thanks,
Ilya.




Index: ChangeLog
===
--- ChangeLog   (revision 45568)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2005-06-08 Ilya Kharmatsky ilyak-at-mainsoft.com
+
+* HttpRuntimeConfig.cs: Added TARGET_JVM directive in using clause
+  in order to exclude in J2EE configuration usage of unsupported
+  CodeDome API.
+   
 2005-05-04 Gonzalo Paniagua Javier [EMAIL PROTECTED]
 
* CompilationConfiguration.cs: throw if we cannot load the type given
Index: HttpRuntimeConfig.cs
===
--- HttpRuntimeConfig.cs(revision 45568)
+++ HttpRuntimeConfig.cs(working copy)
@@ -29,7 +29,9 @@
 //
 
 using System;
+#if !TARGET_J2EE
 using System.CodeDom.Compiler;
+#endif
 using System.Collections;
 using System.Configuration;
 using System.IO;

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] System.Web/System.Web.UI - patch (code synchronization between Mono and Mainsoft)

2005-06-08 Thread Ilya Kharmatsky




Please review the patch. 

BTW, in HtmlTextWriter.cs we changed internal structs (e.g.
RenderStyle) to be the classes
and not structs - this in order to resolve heavy performance problem
in our implementation
of initialization of arrays of structs. May be the better idea is to
change also original mono
code - since in this case we can avoid additional "splitting" of code
between standard and 
J2EE configuration. I think impact of this won't be too high - from
perspective of memory
consumption and performance.

Thanks,
Ilya.



Index: ChangeLog
===
--- ChangeLog   (revision 45568)
+++ ChangeLog   (working copy)
@@ -1,3 +1,13 @@
+2005-06-08  Ilya Kharmatsky ilyak-at-mainsoft.com
+
+* HtmlTextWriter.cs: Internal structs such as TagStackEntry,
+TagInforamation, RenderStyle etc. changed in J2EE configuration
+to be classes (due to heavy performance impact). All code changes
+are related to this issue.
+* ObjectStateFormatter.cs: Added TARGET_JVM directives, which
+allow to skip Assembly related work in J2EE configuration (due to
+limitations of Assembly API in Grasshopper).
+  
 2005-06-06  Lluis Sanchez Gual [EMAIL PROTECTED]
 
* Control.cs: Added new DataBind() overload for 2.0. The old
Index: ObjectStateFormatter.cs
===
--- ObjectStateFormatter.cs (revision 45568)
+++ ObjectStateFormatter.cs (working copy)
@@ -721,9 +721,10 @@
} else {
w.Write (PrimaryId);
w.Write (((Type) o).FullName);
-   
+#if !TARGET_J2EE   
// We should cache the name of the 
assembly
w.Write (((Type) o).Assembly.FullName);
+#endif
}
}

@@ -731,9 +732,13 @@
{
if (token == PrimaryId) {
string type = r.ReadString ();
+#if !TARGET_J2EE   

string assembly = r.ReadString ();

Type t = Assembly.Load 
(assembly).GetType (type);
+#else
+   Type t = Type.GetType(type);
+#endif
ctx.CacheItem (t);
return t;
} else {
Index: HtmlTextWriter.cs
===
--- HtmlTextWriter.cs   (revision 45568)
+++ HtmlTextWriter.cs   (working copy)
@@ -306,6 +306,9 @@
_attrList = rAttrArr;
}
RenderAttribute rAttr;
+#if TARGET_J2EE
+   rAttr = new RenderAttribute();
+#endif
rAttr.name = name;
rAttr.value = value;
rAttr.key = key;
@@ -328,6 +331,9 @@
_styleList = rAttrArr;
}
RenderStyle rAttr;
+#if TARGET_J2EE
+   rAttr = new RenderStyle();
+#endif
rAttr.name = name;
rAttr.value = value;
rAttr.key = key;
@@ -512,6 +518,9 @@
System.Array.Copy(_endTags, temp, (int) _endTags.Length);
_endTags = temp;
}
+#if TARGET_J2EE
+   _endTags[_endTagCount] = new TagStackEntry();
+#endif
_endTags[_endTagCount].tagKey = _tagKey;
_endTags[_endTagCount].endTagText = endTag;
_endTagCount++;
@@ -1059,7 +1068,11 @@
 
 } //HtmlTextWriter
 
+#if TARGET_J2EE
+class AttributeInformation {
+#else  
 struct AttributeInformation {
+#endif 
public bool encode;
public string name;
 
@@ -1069,20 +1082,32 @@
}
 } 
  
+#if TARGET_J2EE
+class RenderAttribute {
+#else  
 struct RenderAttribute {
+#endif 
public bool encode;
public HtmlTextWriterAttribute key;
public string name;
public string value;
 } 
  
+#if TARGET_J2EE
+class RenderStyle {
+#else  
 struct RenderStyle {
+#endif 
public HtmlTextWriterStyle key;
public string name;
public string value;
 } 
  
+#if TARGET_J2EE
+class TagInformation {
+#else  
 struct TagInformation {
+#endif 
public string closingTag;
public string name;
public TagType tagType;
@@ -1094,7 +1119,11 @@
}
 } 
  
+#if TARGET_J2EE
+class TagStackEntry {
+#else  
 struct TagStackEntry {
+#endif 
public string endTagText;
public HtmlTextWriterTag tagKey;
 } 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list