Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 87280 invoked from network); 10 Dec 2008 19:30:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Dec 2008 19:30:26 -0000 Received: (qmail 82135 invoked by uid 500); 10 Dec 2008 19:30:39 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 82056 invoked by uid 500); 10 Dec 2008 19:30:39 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 82045 invoked by uid 99); 10 Dec 2008 19:30:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Dec 2008 11:30:39 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of james.strachan@gmail.com designates 74.125.46.154 as permitted sender) Received: from [74.125.46.154] (HELO yw-out-1718.google.com) (74.125.46.154) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Dec 2008 19:30:24 +0000 Received: by yw-out-1718.google.com with SMTP id 6so264581ywa.86 for ; Wed, 10 Dec 2008 11:30:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=9ouoyDluNQFwTGSeSg2OZCOLdTsKQDCdpohe6BhATvw=; b=Ko6D/VsCm9d5qGUYq2V/T2PtmlsO+e4qRXt7ZfsRxgH4WXmEl2+N8mcdHjsRKNLdGh vc/m2UewhlG68+tP1tcovUSMuddMvTdYI8qQ+w671TmokU7tcxRmS7BtoLJLjgdwhjHA OGoMYVfGOdWnIxPBJj7RYXL7YveVel8jyLccc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=tgcNGHCN7kfHm7kB7Z/4U/L1UvVJS7ESzzgYdD0uIOS9Bebf3RqAw+fnB5uRLrgBbb e5Z+Wn9GFoVosU6sT0zUDif5PQdHHyOiGKwE24B9knaV5logoqPdF9GhFt4kmtXdems2 P8SD1nSBYX30A2xegC9+GllkWvafW7e3NYEeI= Received: by 10.150.50.1 with SMTP id x1mr2694169ybx.13.1228937403216; Wed, 10 Dec 2008 11:30:03 -0800 (PST) Received: by 10.151.119.3 with HTTP; Wed, 10 Dec 2008 11:30:03 -0800 (PST) Message-ID: Date: Wed, 10 Dec 2008 19:30:03 +0000 From: "James Strachan" To: camel-dev@activemq.apache.org Subject: Re: svn commit: r725343 - in /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel: component/file/FileComponent.java component/file/strategy/RenameFileProcessStrategy.java util/ObjectHelper.java In-Reply-To: <20081210170923.149C123888E6@eris.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081210170923.149C123888E6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org I get build failures in camel-ftp now - do you? /mnt/builds/camel/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java:[28,0] cannot find symbol symbol : static isNotNullAndNonEmpty location: class org.apache.camel.util.ObjectHelper /mnt/builds/camel/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpProducer.java:[96,51] cannot find symbol symbol : method isNotNullAndNonEmpty(java.lang.String) location: class org.apache.camel.util.ObjectHelper /mnt/builds/camel/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java:[55,12] cannot find symbol symbol : method isNotNullAndNonEmpty(java.lang.String) location: class org.apache.camel.component.file.remote.SftpEndpoint /mnt/builds/camel/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java:[58,16] cannot find symbol symbol : method isNotNullAndNonEmpty(java.lang.String) location: class org.apache.camel.component.file.remote.SftpEndpoint /mnt/builds/camel/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java:[66,12] cannot find symbol symbol : method isNotNullAndNonEmpty(java.lang.String) location: class org.apache.camel.component.file.remote.SftpEndpoint /mnt/builds/camel/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpProducer.java:[95,51] cannot find symbol symbol : method isNotNullAndNonEmpty(java.lang.String) location: class org.apache.camel.util.ObjectHelper 2008/12/10 : > Author: davsclaus > Date: Wed Dec 10 09:09:21 2008 > New Revision: 725343 > > URL: http://svn.apache.org/viewvc?rev=725343&view=rev > Log: > CAMEL-1155: Refactored ObjectHelper to use isEmpty, isNotEmpty for null and empty string tests. > > Modified: > activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileComponent.java > activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/RenameFileProcessStrategy.java > activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java > > Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileComponent.java > URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileComponent.java?rev=725343&r1=725342&r2=725343&view=diff > ============================================================================== > --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileComponent.java (original) > +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileComponent.java Wed Dec 10 09:09:21 2008 > @@ -94,7 +94,7 @@ > boolean ignoreCase = reminder.startsWith("ignoreCase:"); > reminder = ignoreCase ? ifStartsWithReturnRemainder("ignoreCase:", reminder) : reminder; > > - ObjectHelper.notNull(reminder, "sortBy expression"); > + ObjectHelper.notEmpty(reminder, "sortBy expression", this); > > // recursive add nested sorters > return DefaultFileSorter.sortByFileLanguage(reminder, reverse, ignoreCase, createSortByComparator(it)); > > Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/RenameFileProcessStrategy.java > URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/RenameFileProcessStrategy.java?rev=725343&r1=725342&r2=725343&view=diff > ============================================================================== > --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/RenameFileProcessStrategy.java (original) > +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/RenameFileProcessStrategy.java Wed Dec 10 09:09:21 2008 > @@ -62,7 +62,6 @@ > > if (beginRenamer != null) { > File newName = beginRenamer.renameFile(exchange, file); > - // deleting any existing files before renaming > File to = renameFile(file, newName); > exchange.setFile(to); > } > > Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java > URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java?rev=725343&r1=725342&r2=725343&view=diff > ============================================================================== > --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java (original) > +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java Wed Dec 10 09:09:21 2008 > @@ -157,33 +157,64 @@ > } > > /** > - * Asserts whether the value is not null or an empty string. > + * Asserts whether the value is not null > * > * @param value the value to test > * @param name the key that resolved the value > + * @throws IllegalArgumentException is thrown if assertion fails > */ > public static void notNull(Object value, String name) { > - if (isEmpty(value)) { > + if (value == null) { > throw new IllegalArgumentException(name + " must be specified"); > } > } > > /** > - * Asserts whether the value is not null or an empty string. > + * Asserts whether the value is not null > * > * @param value the value to test > * @param on additional description to indicate where this problem occured (appended as toString()) > * @param name the key that resolved the value > + * @throws IllegalArgumentException is thrown if assertion fails > */ > public static void notNull(Object value, String name, Object on) { > if (on == null) { > notNull(value, name); > - } else if (isEmpty(value)) { > + } else if (value == null) { > throw new IllegalArgumentException(name + " must be specified on: " + on); > } > } > > /** > + * Asserts whether the string is not empty. > + * > + * @param value the string to test > + * @param name the key that resolved the value > + * @throws IllegalArgumentException is thrown if assertion fails > + */ > + public static void notEmpty(String value, String name) { > + if (isEmpty(value)) { > + throw new IllegalArgumentException(name + " must be specified and not empty"); > + } > + } > + > + /** > + * Asserts whether the string is not empty. > + * > + * @param value the string to test > + * @param on additional description to indicate where this problem occured (appended as toString()) > + * @param name the key that resolved the value > + * @throws IllegalArgumentException is thrown if assertion fails > + */ > + public static void notEmpty(String value, String name, Object on) { > + if (on == null) { > + notNull(value, name); > + } else if (isEmpty(value)) { > + throw new IllegalArgumentException(name + " must be specified and not empty on: " + on); > + } > + } > + > + /** > * Tests whether the value is null or an empty string. > * > * @param value the value, if its a String it will be tested for text length as well > > > -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/