lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <ysee...@gmail.com>
Subject Re: svn commit: r777525 - /lucene/java/trunk/src/java/org/apache/lucene/util/AttributeSource.java
Date Fri, 22 May 2009 14:16:48 GMT
Why do stuff like this?  Null params are almost never valid unless
documented... I dislike cluttering up code with validity checks,
slightly penalizing users who use the APIs correctly.  I recognize
that I may be in the minority though.

But in this specific instance, the caller will get an immediate NPE if
they pass a null anyway.

-Yonik
http://www.lucidimagination.com

>   public AttributeSource(AttributeSource input) {
> +    if (input == null) {
> +      throw new IllegalArgumentException("input AttributeSource must not be null");
> +    }
>     this.attributes = input.attributes;
>   }

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message