Ticket #2520: persistenceutil_attic12.patch
File persistenceutil_attic12.patch, 2.6 KB (added by abeham, 5 years ago) |
---|
-
HeuristicLab.Clients.Hive/3.3/HeuristicLab.Clients.Hive-3.3.csproj
106 106 <Prefer32Bit>false</Prefer32Bit> 107 107 </PropertyGroup> 108 108 <ItemGroup> 109 <Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> 110 <SpecificVersion>False</SpecificVersion> 111 <HintPath>..\..\bin\Google.Protobuf.dll</HintPath> 112 <Private>False</Private> 113 </Reference> 109 114 <Reference Include="System" /> 110 115 <Reference Include="System.Configuration" /> 111 116 <Reference Include="System.Core" /> -
HeuristicLab.Clients.Hive/3.3/Plugin.cs.frame
40 40 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 41 41 [PluginDependency("HeuristicLab.Optimization", "3.3")] 42 42 [PluginDependency("HeuristicLab.Persistence", "3.3")] 43 [PluginDependency("HeuristicLab.Protobuf", "3.6.1")] 43 44 public class HeuristicLabClientsHivePlugin : PluginBase { 44 45 } 45 46 } -
HeuristicLab.Clients.Hive/3.3/Util/PersistenceUtil.cs
22 22 using System; 23 23 using System.Collections.Generic; 24 24 using System.IO; 25 using Google.Protobuf; 25 26 using HEAL.Attic; 26 27 using HeuristicLab.Persistence.Default.Xml; 27 28 … … 43 44 var ser = new ProtoBufSerializer(); 44 45 try { 45 46 return (T)ser.Deserialize(sjob); 46 } catch (Exception) { 47 // retry with old persistence 48 using (MemoryStream memStream = new MemoryStream(sjob)) { 49 return XmlParser.Deserialize<T>(memStream); 50 } 47 } catch (PersistenceException e) { 48 if (e.InnerException is InvalidProtocolBufferException 49 || e.InnerException is InvalidDataException) { 50 // retry with old persistence 51 using (MemoryStream memStream = new MemoryStream(sjob)) { 52 return XmlParser.Deserialize<T>(memStream); 53 } 54 } else throw; 51 55 } 52 56 } 53 57 }