vesperin / vesper

source code curation library for Java 1.6 and above
1 stars 0 forks source link

inline and block comments are deleted when exec Rename/Remove/Clip #32

Open hsanchez opened 9 years ago

hsanchez commented 9 years ago

Examples

Original

class Quicksort {
  public static void qsort(int[] a, int si, int ei) {
    //base case
    if (ei <= si || si >= ei) {
    }

    else {
      int pivot = a[si];
      int i = si + 1;
      int tmp;

      //partition array 
      for (int j = si + 1; j <= ei; j++) {
        if (pivot > a[j]) {
          tmp = a[j];
          a[j] = a[i];
          a[i] = tmp;

          i++;
        }
      }

      //put pivot in right position
      a[si] = a[i - 1];
      a[i - 1] = pivot;

      //call qsort on right and left sides of pivot
      qsort(a, si, i - 2);
      qsort(a, i, ei);
    }
  }
}

after clip

class Quicksort {
  public static void qsort(int[] array, int si, int ei) {
    if (ei <= si || si >= ei) {
    } else {
      int pivot = array[si];
      int i = si + 1;
      int tmp;
      for (int j = si + 1; j <= ei; j++) {
        if (pivot > array[j]) {
          tmp = array[j];
          array[j] = array[i];
          array[i] = tmp;
          i++;
        }
      }
      array[si] = array[i - 1];
      array[i - 1] = pivot;
      qsort(array, si, i - 2);
      qsort(array, i, ei);
    }
  }
}
hsanchez commented 9 years ago

delaying the fix of this issue. there are not Higher priority changes that must be addressed before this one can be tackled.