List Info

Thread: java usage question...




java usage question...
user name
2006-09-25 10:00:27
On Sun, 2006-09-24 at 01:28 +0200, pol-adminuni-duisburg-essen.de
wrote:
[...]
> 
> how about
> 
> if (someParameterOfObscureOrigin == null
>      || someParameterOfObscureOrigin = "") {
>  
doSomethingSensibleWithTheFactThatWeAreMissingAParameter();
> }

Instead of 
    string.equals("") 
you can also use 
    string.length()==0
for a slight performance optimization 

josias


> 
> ?
> 
> the reason i'm after making this more robust is that i
can trigger loads
> of these NPEs by incorrectly modifying usecase views,
and i still think
> that people who work with the sitemaps and the template
views should not
> have to dive in to the depths of java... which implies
that the java code
> should be made robust towards shotgun-style trial and
error hacking of
> those.
> imho sitemaps and views are lenya's "user
interface", and playing with
> them should be easier than it is now. so i'd like to
reduce the number of
> NPEs (even if they are clearly caused by programming
errors).
> 
> > Such a thing can easily lead to passing null
values to methods.
> >
> > I'm clearly favouring
> > http:/
/c2.com/cgi/wiki?NoNullBeyondMethodScope
> 
> interesting article. looks like i need to think about
this some more.
> thanks for the pointer.
> 
> jörn
> 
> 
> 
> 
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
> For additional commands, e-mail: dev-helplenya.apache.org
> 
> 


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )