EgorKulikov / idea-chelper

Automatically exported from code.google.com/p/idea-chelper
112 stars 58 forks source link

Stripping off enums if not used directly in code from Main.java #38

Open shankyty opened 8 years ago

shankyty commented 8 years ago

Plugin is stripping off enum from code if not reffered directly in main.java Below is example Task file ` public class Task {

 public void solve(int testNumber, Scanner in, PrintWriter out) {
    int day1 = Days.valueOf(in.nextLine()).ordinal() + 1;
    int day2 = Days.valueOf(in.nextLine()).ordinal() + 1;
    if ((1 + day1) + 1 % 7 == day2
            || ((6 + day1) % 7+1) == day2
            || ((2 + day1) % 7 +1)== day2) {
        out.write("YES");
        return;
    }
    out.write("NO");
}
enum Days {
    monday, tuesday, wednesday, thursday, friday, saturday, sunday
}

}`

Main.java `public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); Task solver = new Task(); solver.solve(1, in, out); out.close(); }

static class Task {
    public void solve(int testNumber, Scanner in, PrintWriter out) {
        int day1 = Task.Days.valueOf(in.nextLine()).ordinal() + 1;
        int day2 = Task.Days.valueOf(in.nextLine()).ordinal() + 1;
        if ((1 + day1) + 1 % 7 == day2
                || ((6 + day1) % 7 + 1) == day2
                || ((2 + day1) % 7 + 1) == day2) {
            out.write("YES");
            return;
        }
        out.write("NO");
    }

    enum Days {
    }

}

}`