[jboss-user] [JBoss Tools (users)] - Re: WTP2.0.1, JBossAS-Tools-1.0.0.beta4 not publishing corre

rob.stryker@jboss.com do-not-reply at jboss.com
Fri Oct 12 17:42:21 EDT 2007



>> I still don't understand the "copied = copied && fileSafeCopy(etc)"

assume: fileSafeCopy returns true or false;
prime copied:  			boolean copied = true;

in a loop: 
    copied = copied && fileSafeCopy(next file)

which means    
    new value of copied = old value of coppied && the result of the function

Therefore:
  if fileSafeCopy returns true:
         newCopied = oldCopied && true
         newCopied = true && true
         newCopied = true

  if fileSafeCopy returns false:
         newCopied = oldCopied && false
         newCopied = true && false
         newCopied = false

The only difference is that we're assigning the result to the same variable that we're checking.  It's very similar to saying:  i = i + 1, except instead of the + operator, we're using the && operator.

x = x && true
x = x && false
i = i + 1
i = i - 1

It's the same idea. 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094806#4094806

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094806



More information about the jboss-user mailing list