Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 406786 | Differences between
and this patch

Collapse All | Expand All

(-)resources/ExtractMethodWorkSpace/ExtractMethodTests/defaultMethods18_in/A_test5.java (+11 lines)
Added Link Here
1
package defaultMethods_in;
2
3
public interface A_test5 {
4
	default int foo() {
5
		/*[*/return 0;/*]*/
6
	}
7
	
8
	static int foo() {
9
		return 0;
10
	}
11
}
(-)resources/ExtractMethodWorkSpace/ExtractMethodTests/defaultMethods18_out/A_test5.java (+15 lines)
Added Link Here
1
package defaultMethods_out;
2
3
public interface A_test5 {
4
	default int foo() {
5
		return extracted();
6
	}
7
8
	static int extracted() {
9
		/*[*/return 0;/*]*/
10
	}
11
	
12
	static int foo() {
13
		return extracted();
14
	}
15
}
(-)test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests18.java (-1 / +5 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2013 IBM Corporation and others.
2
 * Copyright (c) 2013, 2014 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 83-88 Link Here
83
		defaultMethodsTest(1, Modifier.PUBLIC);
83
		defaultMethodsTest(1, Modifier.PUBLIC);
84
	}
84
	}
85
85
86
	public void test5() throws Exception {
87
		defaultMethodsTest(0, Modifier.PUBLIC);
88
	}
89
86
	//====================================================================================
90
	//====================================================================================
87
	// Testing Static Methods
91
	// Testing Static Methods
88
	//====================================================================================
92
	//====================================================================================
(-)core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2013 IBM Corporation and others.
2
 * Copyright (c) 2000, 2014 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 1009-1015 Link Here
1009
			currentParent= currentParent.getParent();
1009
			currentParent= currentParent.getParent();
1010
		} while (!shouldBeStatic && currentParent != null && currentParent != fDestination);
1010
		} while (!shouldBeStatic && currentParent != null && currentParent != fDestination);
1011
1011
1012
		if (shouldBeStatic || fAnalyzer.getForceStatic()) {
1012
		if (shouldBeStatic || fAnalyzer.getForceStatic() || forceStatic()) {
1013
			modifiers|= Modifier.STATIC;
1013
			modifiers|= Modifier.STATIC;
1014
		} else if (isDestinationInterface) {
1014
		} else if (isDestinationInterface) {
1015
			modifiers|= Modifier.DEFAULT;
1015
			modifiers|= Modifier.DEFAULT;

Return to bug 406786