From bfb5b03231ff3339d66cdf92d55916c8254b9919 Mon Sep 17 00:00:00 2001 From: ddur Date: Mon, 18 Jan 2016 21:31:21 +0100 Subject: [PATCH 1/5] Bug 183311 --- main/OpenCover.Framework/Persistance/BasePersistance.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/OpenCover.Framework/Persistance/BasePersistance.cs b/main/OpenCover.Framework/Persistance/BasePersistance.cs index 60ea42a81..8bcf0630b 100644 --- a/main/OpenCover.Framework/Persistance/BasePersistance.cs +++ b/main/OpenCover.Framework/Persistance/BasePersistance.cs @@ -663,7 +663,7 @@ private static void TransformSequences_RemoveCompilerGeneratedBranches (IEnumera var sourceLineOrderedSps = method.SequencePoints.OrderBy(sp => sp.StartLine).ThenBy(sp => sp.StartColumn).Where(sp => sp.FileId == method.FileRef.UniqueId).ToArray(); // find getter/setter/static-method "{" offset - if (sourceRepository.IsLeftCurlyBraceSequencePoint(sourceLineOrderedSps[0])) { + if (sourceLineOrderedSps.Length > 0 && sourceRepository.IsLeftCurlyBraceSequencePoint(sourceLineOrderedSps[0])) { startOffset = sourceLineOrderedSps[0].Offset; // find method "}" offset if (sourceLineOrderedSps.Length > 1 && sourceRepository.IsRightCurlyBraceSequencePoint(sourceLineOrderedSps.Last())) { From 8f6b00ac277c50986adcf6739009694a6489f331 Mon Sep 17 00:00:00 2001 From: sawilde Date: Tue, 19 Jan 2016 07:39:42 +1100 Subject: [PATCH 2/5] create sonarqube specific targets #481 --- default.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/default.build b/default.build index 65617a930..bdf9e1fdd 100644 --- a/default.build +++ b/default.build @@ -82,6 +82,11 @@ + + + + + From 98d1ff7a7bc0bf7ac96dc39bb03282dafddfdd38 Mon Sep 17 00:00:00 2001 From: sawilde Date: Tue, 19 Jan 2016 08:05:05 +1100 Subject: [PATCH 3/5] Change crashreporter to return message in exception Do not throw exception in thread, instead allow to exit #491 --- main/OpenCover.Console/Program.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/main/OpenCover.Console/Program.cs b/main/OpenCover.Console/Program.cs index 78bde4bf8..5e8076555 100644 --- a/main/OpenCover.Console/Program.cs +++ b/main/OpenCover.Console/Program.cs @@ -98,12 +98,15 @@ static int Main(string[] args) private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) { var ex = (Exception)unhandledExceptionEventArgs.ExceptionObject; - Logger.Fatal("At: CurrentDomainOnUnhandledException"); - Logger.FatalFormat("An {0} occured: {1}", ex.GetType(), ex.Message); - Logger.FatalFormat("stack: {0}", ex.StackTrace); - Logger.FatalFormat("A report has been sent to the OpenCover development team..."); + //if (!(ex is ExitApplicationWithoutReportingException)) + { + Logger.Fatal("At: CurrentDomainOnUnhandledException"); + Logger.FatalFormat("An {0} occured: {1}", ex.GetType(), ex.Message); + Logger.FatalFormat("stack: {0}", ex.StackTrace); + Logger.FatalFormat("A report has been sent to the OpenCover development team..."); - ReportCrash((Exception)unhandledExceptionEventArgs.ExceptionObject); + ReportCrash((Exception)unhandledExceptionEventArgs.ExceptionObject); + } Environment.Exit(0); } @@ -124,7 +127,7 @@ private static void ReportCrash(Exception exception) } }; - uploader.SendAnonymousReport(SendRequestState.GetClientLib(), state.GetApplication(), state.GetExceptionDescription(true)); + uploader.SendAnonymousReport(SendRequestState.GetClientLib(), state.GetApplication(), state.GetExceptionDescription(false)); } } catch (Exception) @@ -375,10 +378,9 @@ private static int RunProcess(CommandLineParser parser, Action } catch (Exception ex) { - ex.InformUser(); Logger.ErrorFormat("Failed to execute the following command '{0} {1}'", startInfo.FileName, startInfo.Arguments); - throw new ExitApplicationWithoutReportingException(); } + return 1; } private static void DisplayResults(CoverageSession coverageSession, ICommandLine parser, ILog logger) From 8647570ea8b0b3771275c31126e31bc8a949e8cc Mon Sep 17 00:00:00 2001 From: sawilde Date: Tue, 19 Jan 2016 08:18:58 +1100 Subject: [PATCH 4/5] tiny refactor around SharpDevelop warning #491 --- main/OpenCover.Framework/Manager/ProfilerManager.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main/OpenCover.Framework/Manager/ProfilerManager.cs b/main/OpenCover.Framework/Manager/ProfilerManager.cs index 4d214e345..d10db9a74 100644 --- a/main/OpenCover.Framework/Manager/ProfilerManager.cs +++ b/main/OpenCover.Framework/Manager/ProfilerManager.cs @@ -126,10 +126,11 @@ private WaitCallback SetProfilerAttributes(Action> proc { process(dictionary => { - if (dictionary == null) return; - SetProfilerAttributesOnDictionary(profilerKey, profilerNamespace, dictionary); - - environmentKeyRead.Set(); + if (dictionary != null) + { + SetProfilerAttributesOnDictionary(profilerKey, profilerNamespace, dictionary); + environmentKeyRead.Set(); + } }); } finally From 2f615d5563bcaff2d84201ffab5def2befb82d59 Mon Sep 17 00:00:00 2001 From: ddur Date: Mon, 18 Jan 2016 23:12:28 +0100 Subject: [PATCH 5/5] yet another build target --- default.build | 1 + 1 file changed, 1 insertion(+) diff --git a/default.build b/default.build index bdf9e1fdd..5edc0bbb1 100644 --- a/default.build +++ b/default.build @@ -86,6 +86,7 @@ +