dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET Class Library (pnetlib)


From: Heiko Weiss
Subject: [dotgnu-pnet-commits] [SCM] DotGNU Portable.NET Class Library (pnetlib) branch, master, updated. cd095f1a2c551fa008b5e5932d57b97ded43db64
Date: Mon, 01 Feb 2010 13:29:10 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "DotGNU Portable.NET Class Library (pnetlib)".

The branch, master has been updated
       via  cd095f1a2c551fa008b5e5932d57b97ded43db64 (commit)
      from  dec18aa49f435d7f64e399a24c825858468550c1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/pnetlib.git/commit/?id=cd095f1a2c551fa008b5e5932d57b97ded43db64

commit cd095f1a2c551fa008b5e5932d57b97ded43db64
Author: Heiko Weiss <address@hidden>
Date:   Mon Feb 1 14:28:09 2010 +0100

    fix cctor crash with try catch

diff --git a/runtime/System/Text/Encoding.cs b/runtime/System/Text/Encoding.cs
index 2529c1c..1fc1e14 100644
--- a/runtime/System/Text/Encoding.cs
+++ b/runtime/System/Text/Encoding.cs
@@ -44,79 +44,86 @@ public abstract class Encoding
        // static constructor
        static Encoding()
                        {
-                               Assembly i18nAssembly;
-
-                               // Find or load the "I18N" assembly.
-                               try
+                               try 
                                {
+                                       Assembly i18nAssembly;
+       
+                                       // Find or load the "I18N" assembly.
                                        try
                                        {
-                                               i18nAssembly = 
Assembly.Load("I18N");
+                                               try
+                                               {
+                                                       i18nAssembly = 
Assembly.Load("I18N");
+                                               }
+                                               catch(NotImplementedException)
+                                               {
+                                                       // Assembly loading 
unsupported by the engine.
+                                                       return;
+                                               }
+                                               catch(FileNotFoundException)
+                                               {
+                                                       // Could not locate the 
I18N assembly.
+                                                       return;
+                                               }
+                                               catch(BadImageFormatException)
+                                               {
+                                                       // Something was wrong 
with the I18N assembly.
+                                                       return;
+                                               }
+                                               catch(SecurityException)
+                                               {
+                                                       // The engine refused 
to load I18N.
+                                                       return;
+                                               }
+                                       }
+                                       catch(SystemException)
+                                       {
+                                               return;
+                                       }
+       
+                                       // Find the "I18N.Common.Manager" class.
+                                       try
+                                       {
+                                               managerClass = 
i18nAssembly.GetType("I18N.Common.Manager");
                                        }
                                        catch(NotImplementedException)
                                        {
-                                               // Assembly loading unsupported 
by the engine.
+                                               // "GetType" is not supported 
by the engine.
+                                               managerClass = null;
                                                return;
                                        }
-                                       catch(FileNotFoundException)
+                                       if(managerClass == null)
                                        {
-                                               // Could not locate the I18N 
assembly.
                                                return;
                                        }
-                                       catch(BadImageFormatException)
+       
+                                       // Get the value of the 
"PrimaryManager" property.
+                                       try
+                                       {
+                                               manager = 
managerClass.InvokeMember
+                                                                       
("PrimaryManager",
+                                                                       
BindingFlags.GetProperty |
+                                                                               
BindingFlags.Static |
+                                                                               
BindingFlags.Public,
+                                                                       null, 
null, null, null, null, null);
+                                       }
+                                       catch(MissingMethodException)
                                        {
-                                               // Something was wrong with the 
I18N assembly.
                                                return;
                                        }
                                        catch(SecurityException)
                                        {
-                                               // The engine refused to load 
I18N.
+                                               return;
+                                       }
+                                       catch(NotImplementedException)
+                                       {
+                                               // "InvokeMember" is not 
supported by the engine.
                                                return;
                                        }
                                }
-                               catch(SystemException)
-                               {
-                                       return;
-                               }
-
-                               // Find the "I18N.Common.Manager" class.
-                               try
-                               {
-                                       managerClass = 
i18nAssembly.GetType("I18N.Common.Manager");
-                               }
-                               catch(NotImplementedException)
-                               {
-                                       // "GetType" is not supported by the 
engine.
-                                       managerClass = null;
-                                       return;
-                               }
-                               if(managerClass == null)
-                               {
-                                       return;
-                               }
-
-                               // Get the value of the "PrimaryManager" 
property.
-                               try
-                               {
-                                       manager = managerClass.InvokeMember
-                                                               
("PrimaryManager",
-                                                                
BindingFlags.GetProperty |
-                                                                       
BindingFlags.Static |
-                                                                       
BindingFlags.Public,
-                                                                null, null, 
null, null, null, null);
-                               }
-                               catch(MissingMethodException)
-                               {
-                                       return;
-                               }
-                               catch(SecurityException)
-                               {
-                                       return;
-                               }
-                               catch(NotImplementedException)
+                               catch 
                                {
-                                       // "InvokeMember" is not supported by 
the engine.
-                                       return;
+                                       // avoid cctor to fail !
                                }
                        }
 #endif

-----------------------------------------------------------------------

Summary of changes:
 runtime/System/Text/Encoding.cs |  113 +++++++++++++++++++++------------------
 1 files changed, 60 insertions(+), 53 deletions(-)


hooks/post-receive
-- 
DotGNU Portable.NET Class Library (pnetlib)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]