Return-Path: X-Original-To: apmail-lucene-lucene-net-commits-archive@www.apache.org Delivered-To: apmail-lucene-lucene-net-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BA99CD54F for ; Mon, 30 Jul 2012 22:30:17 +0000 (UTC) Received: (qmail 62334 invoked by uid 500); 30 Jul 2012 22:30:17 -0000 Delivered-To: apmail-lucene-lucene-net-commits-archive@lucene.apache.org Received: (qmail 62288 invoked by uid 500); 30 Jul 2012 22:30:17 -0000 Mailing-List: contact lucene-net-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucene.apache.org Delivered-To: mailing list lucene-net-commits@lucene.apache.org Received: (qmail 62280 invoked by uid 99); 30 Jul 2012 22:30:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jul 2012 22:30:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jul 2012 22:30:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A63BA23888FE; Mon, 30 Jul 2012 22:29:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1367342 - in /incubator/lucene.net/trunk/src/core/Index: CompoundFileWriter.cs MergePolicy.cs Date: Mon, 30 Jul 2012 22:29:32 -0000 To: lucene-net-commits@lucene.apache.org From: synhershko@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120730222932.A63BA23888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: synhershko Date: Mon Jul 30 22:29:32 2012 New Revision: 1367342 URL: http://svn.apache.org/viewvc?rev=1367342&view=rev Log: Throw the appropriate exceptions Modified: incubator/lucene.net/trunk/src/core/Index/CompoundFileWriter.cs incubator/lucene.net/trunk/src/core/Index/MergePolicy.cs Modified: incubator/lucene.net/trunk/src/core/Index/CompoundFileWriter.cs URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Index/CompoundFileWriter.cs?rev=1367342&r1=1367341&r2=1367342&view=diff ============================================================================== --- incubator/lucene.net/trunk/src/core/Index/CompoundFileWriter.cs (original) +++ incubator/lucene.net/trunk/src/core/Index/CompoundFileWriter.cs Mon Jul 30 22:29:32 2012 @@ -78,9 +78,9 @@ namespace Lucene.Net.Index internal CompoundFileWriter(Directory dir, System.String name, SegmentMerger.CheckAbort checkAbort) { if (dir == null) - throw new System.NullReferenceException("directory cannot be null"); + throw new ArgumentNullException("dir"); if (name == null) - throw new System.NullReferenceException("name cannot be null"); + throw new ArgumentNullException("name"); this.checkAbort = checkAbort; directory = dir; fileName = name; @@ -112,10 +112,10 @@ namespace Lucene.Net.Index public void AddFile(String file) { if (merged) - throw new SystemException("Can't add extensions after merge has been called"); + throw new InvalidOperationException("Can't add extensions after merge has been called"); if (file == null) - throw new NullReferenceException("file cannot be null"); + throw new ArgumentNullException("file"); try { Modified: incubator/lucene.net/trunk/src/core/Index/MergePolicy.cs URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Index/MergePolicy.cs?rev=1367342&r1=1367341&r2=1367342&view=diff ============================================================================== --- incubator/lucene.net/trunk/src/core/Index/MergePolicy.cs (original) +++ incubator/lucene.net/trunk/src/core/Index/MergePolicy.cs Mon Jul 30 22:29:32 2012 @@ -88,7 +88,7 @@ namespace Lucene.Net.Index public OneMerge(SegmentInfos segments, bool useCompoundFile) { if (0 == segments.Count) - throw new System.SystemException("segments must include at least one segment"); + throw new ArgumentException("segments must include at least one segment", "segments"); this.segments = segments; this.useCompoundFile = useCompoundFile; } @@ -145,9 +145,9 @@ namespace Lucene.Net.Index } } - internal virtual System.String SegString(Directory dir) + internal virtual String SegString(Directory dir) { - System.Text.StringBuilder b = new System.Text.StringBuilder(); + var b = new System.Text.StringBuilder(); int numSegments = segments.Count; for (int i = 0; i < numSegments; i++) { @@ -189,9 +189,9 @@ namespace Lucene.Net.Index merges.Add(merge); } - public virtual System.String SegString(Directory dir) + public virtual String SegString(Directory dir) { - System.Text.StringBuilder b = new System.Text.StringBuilder(); + var b = new System.Text.StringBuilder(); b.Append("MergeSpec:\n"); int count = merges.Count; for (int i = 0; i < count; i++) @@ -206,7 +206,7 @@ namespace Lucene.Net.Index [Serializable] public class MergeException:System.SystemException { - private Directory dir; + private readonly Directory dir; public MergeException(System.String message, Directory dir):base(message) {