View | Details | Raw Unified | Return to bug 279715 | Differences between
and this patch

Collapse All | Expand All

(-)test cases/org/eclipse/jdt/ui/tests/refactoring/InlineConstantTests.java (+4 lines)
Lines 292-297 Link Here
292
		helper1("p.A", 4, 23, 4, 28, true, true);
292
		helper1("p.A", 4, 23, 4, 28, true, true);
293
	}
293
	}
294
	
294
	
295
	public void test33() throws Exception { // test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=279715
296
		helper1("p.A", 5, 29, 5, 30, true, true);
297
	}
298
	
295
	// -- testing failing preconditions
299
	// -- testing failing preconditions
296
300
297
	public void testFail0() throws Exception {
301
	public void testFail0() throws Exception {
(-)resources/InlineConstant/canInline/test33/in/A.java (+18 lines)
Added Link Here
1
package p;
2
3
class A {
4
    public static final int B= 12;
5
    public static final int C= B - 1; //inline C
6
    public static final int K= 99;
7
8
    public static void main(String[] args) {
9
        int f1= K - 1 - C;
10
        int f2= K - C - C - C;
11
12
        int x1= K + C;
13
        int x2= K - C;
14
        int x3= K + 1 - C;
15
        int x4= K - 1 + C;
16
        int x5= K + 1 + C - C - C;
17
    }
18
}
(-)resources/InlineConstant/canInline/test33/out/A.java (+17 lines)
Added Link Here
1
package p;
2
3
class A {
4
    public static final int B= 12;
5
    public static final int K= 99;
6
7
    public static void main(String[] args) {
8
        int f1= K - 1 - (B - 1);
9
        int f2= K - (B - 1) - (B - 1) - (B - 1);
10
11
        int x1= K + (B - 1);
12
        int x2= K - (B - 1);
13
        int x3= K + 1 - (B - 1);
14
        int x4= K - 1 + (B - 1);
15
        int x5= K + 1 + (B - 1) - (B - 1) - (B - 1);
16
    }
17
}

Return to bug 279715