Hello,

I sometimes (even now) would find it really cool to have the ability to 
inverse a boolean value.

1) If/else statements
=====================
I needed to transform following code

  if (!isSomething()) {
    return someOther;
  }

  return someOther2;

into

  if (!isSomething()) {
    return someOther;
  }
  else {
   return someOther2;
  }

Since this looks odd, it would be cool, if IDEA could switch it around:

  if (isSomething()) {
    return someOther2;
  }
  else {
   return someOther;
  }

2) Return values
================
A method isFalse() returned an value that was used on some other parts of 
our project.
Now I wanted to reverse it's result (and rename it to isTrue()).

IDEA should be able to toggle the used results around. Example: Anywhere 
following lines existed:

   if (isFalse()) {
     doThis();
   }

No it should look like this:

   if (!isTrue()) {
     doThis();
   }

3) Simplify some boolean expressions
====================================
On really bad code I found following:

if (!(a == b)) {
}

This should be simplified (or made better readable) to:

if (a != b) {
}

Or less readable:

if (!(a == b || c == d)) {
}

could be better transformed to:

if (a != b && c != d) {
}


Best regards
Thomas Singer


_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features

Reply via email to