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 230189
Collapse All | Expand All

(-)src/org/eclipse/pde/api/tools/builder/tests/usage/UsageTest.java (-1 / +1 lines)
Lines 94-100 Link Here
94
				typename, 
94
				typename, 
95
				true, 
95
				true, 
96
				(inc ? IncrementalProjectBuilder.INCREMENTAL_BUILD : IncrementalProjectBuilder.FULL_BUILD), 
96
				(inc ? IncrementalProjectBuilder.INCREMENTAL_BUILD : IncrementalProjectBuilder.FULL_BUILD), 
97
				true);
97
				getExpectedProblemIds().length > 0);
98
	}
98
	}
99
	
99
	
100
	/**
100
	/**
(-)src/org/eclipse/pde/api/tools/builder/tests/usage/InterfaceUsageTests.java (-20 / +48 lines)
Lines 26-32 Link Here
26
26
27
	protected static final String INTERFACE_NAME = "InterfaceUsageInterface";
27
	protected static final String INTERFACE_NAME = "InterfaceUsageInterface";
28
	protected static final String INNER_I_NAME = "Iinner";
28
	protected static final String INNER_I_NAME = "Iinner";
29
	private int pid = -1;
30
	
29
	
31
	/**
30
	/**
32
	 * Constructor
31
	 * Constructor
Lines 41-54 Link Here
41
	 */
40
	 */
42
	@Override
41
	@Override
43
	protected int getDefaultProblemId() {
42
	protected int getDefaultProblemId() {
44
		if(pid == -1) {
43
		return -1;
45
			pid = ApiProblemFactory.createProblemId(
44
	}
46
					IApiProblem.CATEGORY_USAGE, 
45
	
47
					IElementDescriptor.TYPE, 
46
	private int getProblemId(int kind, int flags) {		
48
					IApiProblem.ILLEGAL_IMPLEMENT, 
47
		return ApiProblemFactory.createProblemId(
49
					IApiProblem.NO_FLAGS);
48
				IApiProblem.CATEGORY_USAGE, 
50
		}
49
				IElementDescriptor.TYPE, 
51
		return pid;
50
				kind, 
51
				flags);
52
	}
52
	}
53
	
53
	
54
	/**
54
	/**
Lines 64-70 Link Here
64
	}
64
	}
65
65
66
	/**
66
	/**
67
	 * Tests that extending an @noimplement interface properly reports the usage problems
67
	 * Tests that extending an @noimplement interface properly reports no usage problems
68
	 * using a full build 
68
	 * using a full build 
69
	 */
69
	 */
70
	public void testInterfaceUsageTests1F() {
70
	public void testInterfaceUsageTests1F() {
Lines 72-78 Link Here
72
	}
72
	}
73
	
73
	
74
	/**
74
	/**
75
	 * Tests that extending an @noimplement interface properly reports the usage problems
75
	 * Tests that extending an @noimplement interface properly reports no usage problems
76
	 * using an incremental build 
76
	 * using an incremental build 
77
	 */
77
	 */
78
	public void testInterfaceUsageTests1I() {
78
	public void testInterfaceUsageTests1I() {
Lines 80-93 Link Here
80
	}
80
	}
81
	
81
	
82
	private void x1(boolean inc) {
82
	private void x1(boolean inc) {
83
		setExpectedProblemIds(getDefaultProblemIdSet(3));
83
		expectingNoProblems();
84
		String typename = "testI1";
84
		deployTest("testI1", inc);
85
		setExpectedMessageArgs(new String[][] {
86
				{INNER_I_NAME, INNER_NAME1},
87
				{INTERFACE_NAME, typename},
88
				{INNER_I_NAME, OUTER_INAME}
89
		});
90
		deployTest(typename, inc);
91
	}
85
	}
92
	
86
	
93
	/**
87
	/**
Lines 107-113 Link Here
107
	}
101
	}
108
	
102
	
109
	private void x2(boolean inc) {
103
	private void x2(boolean inc) {
110
		setExpectedProblemIds(getDefaultProblemIdSet(3));
104
		setExpectedProblemIds(new int[] {
105
				getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.NO_FLAGS),
106
				getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.NO_FLAGS),
107
				getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.NO_FLAGS)
108
		});
111
		String typename = "testI2";
109
		String typename = "testI2";
112
		setExpectedMessageArgs(new String[][] {
110
		setExpectedMessageArgs(new String[][] {
113
				{INNER_I_NAME, INNER_NAME1},
111
				{INNER_I_NAME, INNER_NAME1},
Lines 116-119 Link Here
116
		});
114
		});
117
		deployTest(typename, inc);
115
		deployTest(typename, inc);
118
	}
116
	}
117
	
118
	/**
119
	 * Tests that extending an @noextend interface properly reports the usage problems
120
	 * using a full build
121
	 */
122
	public void testIllegalExtendInterfaceF() {
123
		x3(false);
124
	}
125
	
126
	/**
127
	 * Tests that extending an @noextend interface properly reports the usage problems
128
	 * using an incremental build
129
	 */
130
	public void testIllegalExtendInterfaceI() {
131
		x3(true);
132
	}
133
	
134
	private void x3(boolean inc) {
135
		setExpectedProblemIds(new int[] {
136
				getProblemId(IApiProblem.ILLEGAL_EXTEND, IApiProblem.INDIRECT_REFERENCE),
137
				getProblemId(IApiProblem.ILLEGAL_EXTEND, IApiProblem.INDIRECT_REFERENCE),
138
				getProblemId(IApiProblem.ILLEGAL_EXTEND, IApiProblem.INDIRECT_REFERENCE)
139
		});
140
		String typename = "testI3";
141
		setExpectedMessageArgs(new String[][] {
142
				{INNER_I_NAME, INNER_NAME1},
143
				{"InterfaceUsageInterface2", typename},
144
				{INNER_I_NAME, OUTER_INAME}
145
		});
146
	}
119
}
147
}
(-)src/org/eclipse/pde/api/tools/builder/tests/usage/ClassUsageTests.java (-10 / +151 lines)
Lines 47-58 Link Here
47
	 * @param kind
47
	 * @param kind
48
	 * @return the problem id
48
	 * @return the problem id
49
	 */
49
	 */
50
	private int getProblemId(int kind) {
50
	private int getProblemId(int kind, int flags) {
51
		return ApiProblemFactory.createProblemId(
51
		return ApiProblemFactory.createProblemId(
52
				IApiProblem.CATEGORY_USAGE, 
52
				IApiProblem.CATEGORY_USAGE, 
53
				IElementDescriptor.TYPE, 
53
				IElementDescriptor.TYPE, 
54
				kind, 
54
				kind, 
55
				IApiProblem.NO_FLAGS);
55
				flags);
56
	}
56
	}
57
	
57
	
58
	public static Test suite() {
58
	public static Test suite() {
Lines 85-94 Link Here
85
	
85
	
86
	private void x1(boolean inc) {
86
	private void x1(boolean inc) {
87
		setExpectedProblemIds(new int[] {
87
		setExpectedProblemIds(new int[] {
88
				getProblemId(IApiProblem.ILLEGAL_EXTEND),
88
				getProblemId(IApiProblem.ILLEGAL_EXTEND, IApiProblem.NO_FLAGS),
89
				getProblemId(IApiProblem.ILLEGAL_EXTEND),
89
				getProblemId(IApiProblem.ILLEGAL_EXTEND, IApiProblem.NO_FLAGS),
90
				getProblemId(IApiProblem.ILLEGAL_EXTEND),
90
				getProblemId(IApiProblem.ILLEGAL_EXTEND, IApiProblem.NO_FLAGS),
91
				getProblemId(IApiProblem.ILLEGAL_EXTEND)
91
				getProblemId(IApiProblem.ILLEGAL_EXTEND, IApiProblem.NO_FLAGS)
92
		});
92
		});
93
		String typename = "testC1";
93
		String typename = "testC1";
94
		setExpectedMessageArgs(new String[][] {
94
		setExpectedMessageArgs(new String[][] {
Lines 118-127 Link Here
118
	
118
	
119
	private void x2(boolean inc) {
119
	private void x2(boolean inc) {
120
		setExpectedProblemIds(new int[] {
120
		setExpectedProblemIds(new int[] {
121
				getProblemId(IApiProblem.ILLEGAL_INSTANTIATE),
121
				getProblemId(IApiProblem.ILLEGAL_INSTANTIATE, IApiProblem.NO_FLAGS),
122
				getProblemId(IApiProblem.ILLEGAL_INSTANTIATE),
122
				getProblemId(IApiProblem.ILLEGAL_INSTANTIATE, IApiProblem.NO_FLAGS),
123
				getProblemId(IApiProblem.ILLEGAL_INSTANTIATE),
123
				getProblemId(IApiProblem.ILLEGAL_INSTANTIATE, IApiProblem.NO_FLAGS),
124
				getProblemId(IApiProblem.ILLEGAL_INSTANTIATE)
124
				getProblemId(IApiProblem.ILLEGAL_INSTANTIATE, IApiProblem.NO_FLAGS)
125
		});
125
		});
126
		String typename = "testC2";
126
		String typename = "testC2";
127
		setExpectedMessageArgs(new String[][] {
127
		setExpectedMessageArgs(new String[][] {
Lines 132-135 Link Here
132
		});
132
		});
133
		deployTest(typename, inc);
133
		deployTest(typename, inc);
134
	}
134
	}
135
	
136
	/**
137
	 * Tests that indirect illegal implementing is properly 
138
	 * detected for one class and an extension interface using a full build
139
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
140
	 */
141
	public void testClassIndirectImplements1F() {
142
		x3(false);
143
	}
144
	
145
	/**
146
	 * Tests that indirect illegal implementing is properly 
147
	 * detected for one class and an extension interface using an incremental build
148
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
149
	 */
150
	public void testClassIndirectImplements1I() {
151
		x3(true);
152
	}
153
	
154
	private void x3(boolean inc) {
155
		setExpectedProblemIds(new int[] {
156
				getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_REFERENCE)
157
		});
158
		String typename = "testC3";
159
		setExpectedMessageArgs(new String[][] {
160
				{"IExtInterface1", "INoImpl1", typename},
161
		});
162
		deployTest(typename, inc);
163
	}
164
	
165
	/**
166
	 * Tests that an indirect illegal implement is ignored when there is a
167
	 * parent class that implements the @noimplement interface using 
168
	 * a full build
169
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
170
	 */
171
	public void testClassIndirectImplements2F() {
172
		x4(false);
173
	}
174
	
175
	/**
176
	 * Tests that an indirect illegal implement is ignored when there is a
177
	 * parent class that implements the @noimplement interface using 
178
	 * an incremental build
179
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
180
	 */
181
	public void testClassIndirectImplements2I() {
182
		x4(true);
183
	}
184
	
185
	private void x4(boolean inc) {
186
		expectingNoProblems();
187
		deployTest("testC4", inc);
188
	}
189
	
190
	/**
191
	 * Tests that multiple indirect illegal implements are detected when there is no
192
	 * parent class that implements the @noimplement interfaces using 
193
	 * a full build
194
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
195
	 */
196
	public void testClassIndirectImplements3F() {
197
		x5(false);
198
	}
199
	
200
	/**
201
	 * Tests that multiple indirect illegal implements are detected when there is no
202
	 * parent class that implements the @noimplement interfaces using 
203
	 * an incremental build
204
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
205
	 */
206
	public void testClassIndirectImplements3I() {
207
		x5(true);
208
	}
209
	
210
	private void x5(boolean inc) {
211
		setExpectedProblemIds(new int[] {
212
				getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_REFERENCE),
213
				getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_REFERENCE),
214
				getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_REFERENCE),
215
				getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_REFERENCE)
216
		});
217
		String typename = "testC5";
218
		setExpectedMessageArgs(new String[][] {
219
				{"IExtInterface1", "INoImpl1", typename},
220
				{"IExtInterface2", "INoImpl1", typename},
221
				{"IExtInterface3", "INoImpl1", typename},
222
				{"IExtInterface4", "INoImpl4", typename}
223
		});
224
		deployTest(typename, inc);
225
	}
226
	
227
	/**
228
	 * Tests that multiple indirect illegal implements are detected when there is a
229
	 * parent class that implements the @noimplement interfaces using 
230
	 * a full build
231
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
232
	 */
233
	public void testClassIndirectImplements4F() {
234
		x6(false);
235
	}
236
	
237
	/**
238
	 * Tests that multiple indirect illegal implements are detected when there is a
239
	 * parent class that implements the @noimplement interfaces using 
240
	 * an incremental build
241
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
242
	 */
243
	public void testClassIndirectImplements4I() {
244
		x6(true);
245
	}
246
	
247
	private void x6(boolean inc) {
248
		expectingNoProblems();
249
		deployTest("testC6", inc);
250
	}
251
	
252
	/**
253
	 * Tests that an indirect illegal implements is detected when there is a
254
	 * parent class N levels indirected that implements the @noimplement interfaces using 
255
	 * a full build
256
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
257
	 */
258
	public void testClassIndirectImplements5F() {
259
		x7(false);
260
	}
261
	
262
	/**
263
	 * Tests that an indirect illegal implements is detected when there is a
264
	 * parent class N levels indirected that implements the @noimplement interfaces using 
265
	 * an incremental build
266
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
267
	 */
268
	public void testClassIndirectImplements5I() {
269
		x7(true);
270
	}
271
	
272
	private void x7(boolean inc) {
273
		expectingNoProblems();
274
		deployTest("testC7", inc);
275
	}
135
}
276
}
(-)test-builder/tags/interface/test16.java (-1 lines)
Lines 14-20 Link Here
14
 * Test unsupported tags on an interface
14
 * Test unsupported tags on an interface
15
 * @noreference
15
 * @noreference
16
 * @nooverride
16
 * @nooverride
17
 * @noextend
18
 * @noinstantiate
17
 * @noinstantiate
19
 */
18
 */
20
public interface test16 {
19
public interface test16 {
(-)test-builder/tags/interface/test9.java (-48 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package a.b.c;
12
13
/**
14
 * Tests invalid @noextend tags on nested inner interfaces
15
 * @noextend
16
 */
17
public interface test9 {
18
19
	/**
20
	 * @noextend
21
	 */
22
	interface inner {
23
		
24
	}
25
	
26
	interface inner1 {
27
		/**
28
		 * @noextend
29
		 */
30
		interface inner2 {
31
			
32
		}
33
	}
34
	
35
	interface inner2 {
36
		
37
	}
38
}
39
40
interface outer {
41
	
42
	/**
43
	 * @noextend
44
	 */
45
	interface inner {
46
		
47
	}
48
}
(-)test-builder/tags/interface/test8.java (-24 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package a.b.c;
12
13
/**
14
 * Tests an invalid @noextend tag on a member interface
15
 */
16
public interface test8 {
17
18
	/**
19
	 * @noextend
20
	 */
21
	interface inner {
22
		
23
	}
24
}
(-)test-builder/tags/interface/test19.java (-4 lines)
Lines 14-20 Link Here
14
 * Tests invalid tags on nested inner interfaces
14
 * Tests invalid tags on nested inner interfaces
15
 * @noreference
15
 * @noreference
16
 * @nooverride
16
 * @nooverride
17
 * @noextend
18
 * @noinstantiate
17
 * @noinstantiate
19
 */
18
 */
20
public interface test19 {
19
public interface test19 {
Lines 22-28 Link Here
22
	/**
21
	/**
23
	 * @noreference
22
	 * @noreference
24
	 * @nooverride
23
	 * @nooverride
25
	 * @noextend
26
	 * @noinstantiate
24
	 * @noinstantiate
27
	 */
25
	 */
28
	interface inner {
26
	interface inner {
Lines 33-39 Link Here
33
		/**
31
		/**
34
		 * @noreference
32
		 * @noreference
35
		 * @nooverride
33
		 * @nooverride
36
		 * @noextend
37
		 * @noinstantiate
34
		 * @noinstantiate
38
		 */
35
		 */
39
		interface inner2 {
36
		interface inner2 {
Lines 51-57 Link Here
51
	/**
48
	/**
52
	 * @noreference
49
	 * @noreference
53
	 * @nooverride
50
	 * @nooverride
54
	 * @noextend
55
	 * @noinstantiate
51
	 * @noinstantiate
56
	 */
52
	 */
57
	interface inner {
53
	interface inner {
(-)test-builder/tags/interface/test10.java (-19 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
12
13
/**
14
 * Test unsupported @noextend tag on an interface in the default package
15
 * @noextend
16
 */
17
public interface test10 {
18
19
}
(-)test-builder/tags/interface/test7.java (-25 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package a.b.c;
12
13
/**
14
 * Tests invalid @noextend tag on an outer interface
15
 */
16
public interface test7 {
17
18
}
19
20
/**
21
 * @noextend
22
 */
23
interface outer {
24
	
25
}
(-)test-builder/tags/interface/test18.java (-1 lines)
Lines 18-24 Link Here
18
	/**
18
	/**
19
	 * @noreference
19
	 * @noreference
20
	 * @nooverride
20
	 * @nooverride
21
	 * @noextend
22
	 * @noinstantiate
21
	 * @noinstantiate
23
	 */
22
	 */
24
	interface inner {
23
	interface inner {
(-)test-builder/tags/interface/test20.java (-1 lines)
Lines 14-20 Link Here
14
 * Test unsupported @noreference tag on an interface in the default package
14
 * Test unsupported @noreference tag on an interface in the default package
15
 * @noreference
15
 * @noreference
16
 * @nooverride
16
 * @nooverride
17
 * @noextend
18
 * @noinstantiate
17
 * @noinstantiate
19
 */
18
 */
20
public interface test20 {
19
public interface test20 {
(-)test-builder/tags/interface/test17.java (-1 lines)
Lines 20-26 Link Here
20
/**
20
/**
21
 * @noreference
21
 * @noreference
22
 * @nooverride
22
 * @nooverride
23
 * @noextend
24
 * @noinstantiate
23
 * @noinstantiate
25
 */
24
 */
26
interface outer {
25
interface outer {
(-)test-builder/tags/interface/test6.java (-19 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package a.b.c;
12
13
/**
14
 * Test unsupported @noextend tag on an interface
15
 * @noextend
16
 */
17
public interface test6 {
18
19
}
(-)src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidInterfaceTagTests.java (-100 / +10 lines)
Lines 157-252 Link Here
157
	}
157
	}
158
	
158
	
159
	/**
159
	/**
160
	 * Tests having an @noextend tag on an interface in package a.b.c
161
	 * using an incremental build
162
	 */
163
	public void testInvalidInterfaceTag6I() {
164
		setExpectedProblemIds(getDefaultProblemSet(1));
165
		deployTagTest(TESTING_PACKAGE, "test6", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
166
	}
167
	
168
	/**
169
	 * Tests having an @noextend tag on an interface in package a.b.c
170
	 * using a full build
171
	 */
172
	public void testInvalidInterfaceTag6F() {
173
		setExpectedProblemIds(getDefaultProblemSet(1));
174
		deployTagTest(TESTING_PACKAGE, "test6", true, IncrementalProjectBuilder.FULL_BUILD, true);
175
	}
176
177
	/**
178
	 * Tests having an @noextend tag on an outer interface in package a.b.c
179
	 * using an incremental build
180
	 */
181
	public void testInvalidInterfaceTag7I() {
182
		setExpectedProblemIds(getDefaultProblemSet(1));
183
		deployTagTest(TESTING_PACKAGE, "test7", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
184
	}
185
	
186
	/**
187
	 * Tests having an @noextend tag on an outer interface in package a.b.c
188
	 * using a full build
189
	 */
190
	public void testInvalidInterfaceTag7F() {
191
		setExpectedProblemIds(getDefaultProblemSet(1));
192
		deployTagTest(TESTING_PACKAGE, "test7", true, IncrementalProjectBuilder.FULL_BUILD, true);
193
	}
194
	
195
	/**
196
	 * Tests having an @noextend tag on an inner interface in package a.b.c
197
	 * using an incremental build
198
	 */
199
	public void testInvalidInterfaceTag8I() {
200
		setExpectedProblemIds(getDefaultProblemSet(1));
201
		deployTagTest(TESTING_PACKAGE, "test8", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
202
	}
203
	
204
	/**
205
	 * Tests having an @noextend tag on an inner interface in package a.b.c
206
	 * using a full build
207
	 */
208
	public void testInvalidInterfaceTag8F() {
209
		setExpectedProblemIds(getDefaultProblemSet(1));
210
		deployTagTest(TESTING_PACKAGE, "test8", true, IncrementalProjectBuilder.FULL_BUILD, true);
211
	}
212
	
213
	/**
214
	 * Tests having an @noextend tag on a variety of inner / outer / top-level interfaces in package a.b.c
215
	 * using an incremental build
216
	 */
217
	public void testInvalidInterfaceTag9I() {
218
		setExpectedProblemIds(getDefaultProblemSet(4));
219
		deployTagTest(TESTING_PACKAGE, "test9", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
220
	}
221
	
222
	/**
223
	 * Tests having an @noextend tag on a variety of inner / outer / top-level interfaces in package a.b.c
224
	 * using a full build
225
	 */
226
	public void testInvalidInterfaceTag9F() {
227
		setExpectedProblemIds(getDefaultProblemSet(4));
228
		deployTagTest(TESTING_PACKAGE, "test9", true, IncrementalProjectBuilder.FULL_BUILD, true);
229
	}
230
	
231
	/**
232
	 * Tests having an @noextend tag on an interface in the default package
233
	 * using an incremental build
234
	 */
235
	public void testInvalidInterfaceTag10I() {
236
		setExpectedProblemIds(getDefaultProblemSet(1));
237
		deployTagTest(TESTING_PACKAGE, "test10", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
238
	}
239
	
240
	/**
241
	 * Tests having an @noextend tag on an interface in the default package
242
	 * using a full build
243
	 */
244
	public void testInvalidInterfaceTag10F() {
245
		setExpectedProblemIds(getDefaultProblemSet(1));
246
		deployTagTest(TESTING_PACKAGE, "test10", true, IncrementalProjectBuilder.FULL_BUILD, true);
247
	}
248
	
249
	/**
250
	 * Tests having an @nooverride tag on an interface in package a.b.c
160
	 * Tests having an @nooverride tag on an interface in package a.b.c
251
	 * using an incremental build
161
	 * using an incremental build
252
	 */
162
	 */
Lines 341-347 Link Here
341
	 * using an incremental build
251
	 * using an incremental build
342
	 */
252
	 */
343
	public void testInvalidInterfaceTag16I() {
253
	public void testInvalidInterfaceTag16I() {
344
		setExpectedProblemIds(getDefaultProblemSet(4));
254
		setExpectedProblemIds(getDefaultProblemSet(3));
345
		deployTagTest(TESTING_PACKAGE, "test16", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
255
		deployTagTest(TESTING_PACKAGE, "test16", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
346
	}
256
	}
347
	
257
	
Lines 350-356 Link Here
350
	 * using a full build
260
	 * using a full build
351
	 */
261
	 */
352
	public void testInvalidInterfaceTag16F() {
262
	public void testInvalidInterfaceTag16F() {
353
		setExpectedProblemIds(getDefaultProblemSet(4));
263
		setExpectedProblemIds(getDefaultProblemSet(3));
354
		deployTagTest(TESTING_PACKAGE, "test16", true, IncrementalProjectBuilder.FULL_BUILD, true);
264
		deployTagTest(TESTING_PACKAGE, "test16", true, IncrementalProjectBuilder.FULL_BUILD, true);
355
	}
265
	}
356
	
266
	
Lines 359-365 Link Here
359
	 * using an incremental build
269
	 * using an incremental build
360
	 */
270
	 */
361
	public void testInvalidInterfaceTag17I() {
271
	public void testInvalidInterfaceTag17I() {
362
		setExpectedProblemIds(getDefaultProblemSet(4));
272
		setExpectedProblemIds(getDefaultProblemSet(3));
363
		deployTagTest(TESTING_PACKAGE, "test17", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
273
		deployTagTest(TESTING_PACKAGE, "test17", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
364
	}
274
	}
365
	
275
	
Lines 368-374 Link Here
368
	 * using a full build
278
	 * using a full build
369
	 */
279
	 */
370
	public void testInvalidInterfaceTag17F() {
280
	public void testInvalidInterfaceTag17F() {
371
		setExpectedProblemIds(getDefaultProblemSet(4));
281
		setExpectedProblemIds(getDefaultProblemSet(3));
372
		deployTagTest(TESTING_PACKAGE, "test17", true, IncrementalProjectBuilder.FULL_BUILD, true);
282
		deployTagTest(TESTING_PACKAGE, "test17", true, IncrementalProjectBuilder.FULL_BUILD, true);
373
	}
283
	}
374
	
284
	
Lines 377-383 Link Here
377
	 * using an incremental build
287
	 * using an incremental build
378
	 */
288
	 */
379
	public void testInvalidInterfaceTag18I() {
289
	public void testInvalidInterfaceTag18I() {
380
		setExpectedProblemIds(getDefaultProblemSet(4));
290
		setExpectedProblemIds(getDefaultProblemSet(3));
381
		deployTagTest(TESTING_PACKAGE, "test18", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
291
		deployTagTest(TESTING_PACKAGE, "test18", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
382
	}
292
	}
383
	
293
	
Lines 386-392 Link Here
386
	 * using a full build
296
	 * using a full build
387
	 */
297
	 */
388
	public void testInvalidInterfaceTag18F() {
298
	public void testInvalidInterfaceTag18F() {
389
		setExpectedProblemIds(getDefaultProblemSet(4));
299
		setExpectedProblemIds(getDefaultProblemSet(3));
390
		deployTagTest(TESTING_PACKAGE, "test18", true, IncrementalProjectBuilder.FULL_BUILD, true);
300
		deployTagTest(TESTING_PACKAGE, "test18", true, IncrementalProjectBuilder.FULL_BUILD, true);
391
	}
301
	}
392
	
302
	
Lines 395-401 Link Here
395
	 * using an incremental build
305
	 * using an incremental build
396
	 */
306
	 */
397
	public void testInvalidInterfaceTag19I() {
307
	public void testInvalidInterfaceTag19I() {
398
		setExpectedProblemIds(getDefaultProblemSet(16));
308
		setExpectedProblemIds(getDefaultProblemSet(12));
399
		deployTagTest(TESTING_PACKAGE, "test19", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
309
		deployTagTest(TESTING_PACKAGE, "test19", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
400
	}
310
	}
401
	
311
	
Lines 404-410 Link Here
404
	 * using a full build
314
	 * using a full build
405
	 */
315
	 */
406
	public void testInvalidInterfaceTag19F() {
316
	public void testInvalidInterfaceTag19F() {
407
		setExpectedProblemIds(getDefaultProblemSet(16));
317
		setExpectedProblemIds(getDefaultProblemSet(12));
408
		deployTagTest(TESTING_PACKAGE, "test19", true, IncrementalProjectBuilder.FULL_BUILD, true);
318
		deployTagTest(TESTING_PACKAGE, "test19", true, IncrementalProjectBuilder.FULL_BUILD, true);
409
	}
319
	}
410
	
320
	
Lines 413-419 Link Here
413
	 * using an incremental build
323
	 * using an incremental build
414
	 */
324
	 */
415
	public void testInvalidInterfaceTag20I() {
325
	public void testInvalidInterfaceTag20I() {
416
		setExpectedProblemIds(getDefaultProblemSet(4));
326
		setExpectedProblemIds(getDefaultProblemSet(3));
417
		deployTagTest(TESTING_PACKAGE, "test20", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
327
		deployTagTest(TESTING_PACKAGE, "test20", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
418
	}
328
	}
419
	
329
	
Lines 422-428 Link Here
422
	 * using a full build
332
	 * using a full build
423
	 */
333
	 */
424
	public void testInvalidInterfaceTag20F() {
334
	public void testInvalidInterfaceTag20F() {
425
		setExpectedProblemIds(getDefaultProblemSet(4));
335
		setExpectedProblemIds(getDefaultProblemSet(3));
426
		deployTagTest(TESTING_PACKAGE, "test20", true, IncrementalProjectBuilder.FULL_BUILD, true);
336
		deployTagTest(TESTING_PACKAGE, "test20", true, IncrementalProjectBuilder.FULL_BUILD, true);
427
	}
337
	}
428
	
338
	
(-)src/org/eclipse/pde/api/tools/builder/tests/tags/ValidInterfaceTagTests.java (+32 lines)
Lines 123-126 Link Here
123
	public void testValidInterfaceTag5F() {
123
	public void testValidInterfaceTag5F() {
124
		deployTagTest(TESTING_PACKAGE, "test5", false, IncrementalProjectBuilder.FULL_BUILD, true);
124
		deployTagTest(TESTING_PACKAGE, "test5", false, IncrementalProjectBuilder.FULL_BUILD, true);
125
	}
125
	}
126
	
127
	/**
128
	 * Tests having an @noextend tag on an interface in package a.b.c
129
	 * using an incremental build
130
	 */
131
	public void testInvalidInterfaceTag6I() {
132
		deployTagTest(TESTING_PACKAGE, "test6", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
133
	}
134
	
135
	/**
136
	 * Tests having an @noextend tag on an interface in package a.b.c
137
	 * using a full build
138
	 */
139
	public void testInvalidInterfaceTag6F() {
140
		deployTagTest(TESTING_PACKAGE, "test6", true, IncrementalProjectBuilder.FULL_BUILD, true);
141
	}
142
143
	/**
144
	 * Tests having an @noextend tag on an outer interface in package a.b.c
145
	 * using an incremental build
146
	 */
147
	public void testInvalidInterfaceTag7I() {
148
		deployTagTest(TESTING_PACKAGE, "test7", true, IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
149
	}
150
	
151
	/**
152
	 * Tests having an @noextend tag on an outer interface in package a.b.c
153
	 * using a full build
154
	 */
155
	public void testInvalidInterfaceTag7F() {
156
		deployTagTest(TESTING_PACKAGE, "test7", true, IncrementalProjectBuilder.FULL_BUILD, true);
157
	}
126
}
158
}
(-)src/org/eclipse/pde/api/tools/comparator/tests/FieldDeltaTests.java (+59 lines)
Lines 875-880 Link Here
875
		assertTrue("Is visible", Util.isVisible(child));
875
		assertTrue("Is visible", Util.isVisible(child));
876
		assertEquals("Wrong flag", IDelta.FIELD, child.getFlags());
876
		assertEquals("Wrong flag", IDelta.FIELD, child.getFlags());
877
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
877
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
878
		assertTrue("Should not be compatible", !DeltaProcessor.isCompatible(child));
879
		child = allLeavesDeltas[1];
880
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
881
		assertTrue("Is visible", Util.isVisible(child));
882
		assertEquals("Wrong flag", IDelta.FIELD, child.getFlags());
883
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
884
		assertFalse("Is compatible", DeltaProcessor.isCompatible(child));
885
	}
886
	
887
	/**
888
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
889
	 */
890
	public void test71() {
891
		deployBundles("test71");
892
		IApiBaseline before = getBeforeState();
893
		IApiBaseline after = getAfterState();
894
		IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);
895
		assertNotNull("no api component", beforeApiComponent);
896
		IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);
897
		assertNotNull("no api component", afterApiComponent);
898
		IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after);
899
		assertNotNull("No delta", delta);
900
		IDelta[] allLeavesDeltas = collectLeaves(delta);
901
		assertEquals("Wrong size", 2, allLeavesDeltas.length);
902
		IDelta child = allLeavesDeltas[0];
903
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
904
		assertTrue("Is visible", Util.isVisible(child));
905
		assertEquals("Wrong flag", IDelta.FIELD, child.getFlags());
906
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
878
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child));
907
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child));
879
		child = allLeavesDeltas[1];
908
		child = allLeavesDeltas[1];
880
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
909
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
Lines 883-888 Link Here
883
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
912
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
884
		assertFalse("Is compatible", DeltaProcessor.isCompatible(child));
913
		assertFalse("Is compatible", DeltaProcessor.isCompatible(child));
885
	}
914
	}
915
	
916
	/**
917
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
918
	 */
919
	public void test72() {
920
		deployBundles("test72");
921
		IApiBaseline before = getBeforeState();
922
		IApiBaseline after = getAfterState();
923
		IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);
924
		assertNotNull("no api component", beforeApiComponent);
925
		IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);
926
		assertNotNull("no api component", afterApiComponent);
927
		IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after);
928
		assertNotNull("No delta", delta);
929
		IDelta[] allLeavesDeltas = collectLeaves(delta);
930
		assertEquals("Wrong size", 2, allLeavesDeltas.length);
931
		IDelta child = allLeavesDeltas[0];
932
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
933
		assertTrue("Is visible", Util.isVisible(child));
934
		assertEquals("Wrong flag", IDelta.FIELD, child.getFlags());
935
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
936
		assertTrue("Should not be compatible", !DeltaProcessor.isCompatible(child));
937
		child = allLeavesDeltas[1];
938
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
939
		assertTrue("Is visible", Util.isVisible(child));
940
		assertEquals("Wrong flag", IDelta.FIELD, child.getFlags());
941
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
942
		assertFalse("Is compatible", DeltaProcessor.isCompatible(child));
943
	}
944
	
886
	/**
945
	/**
887
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=222905
946
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=222905
888
	 */
947
	 */
(-)src/org/eclipse/pde/api/tools/comparator/tests/InterfaceDeltaTests.java (-4 / +210 lines)
Lines 365-374 Link Here
365
		assertTrue("Not implement restrictions", RestrictionModifiers.isImplementRestriction(child.getRestrictions()));
365
		assertTrue("Not implement restrictions", RestrictionModifiers.isImplementRestriction(child.getRestrictions()));
366
		assertEquals("Wrong flag", IDelta.FIELD, child.getFlags());
366
		assertEquals("Wrong flag", IDelta.FIELD, child.getFlags());
367
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
367
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
368
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child));
368
		assertTrue("Should not be compatible", !DeltaProcessor.isCompatible(child));
369
	}
369
	}
370
370
371
	/**
371
	/**
372
	 * Addition of a field in an interface that cannot be extended
373
	 */
374
	public void test30() {
375
		deployBundles("test30");
376
		IApiBaseline before = getBeforeState();
377
		IApiBaseline after = getAfterState();
378
		IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);
379
		assertNotNull("no api component", beforeApiComponent);
380
		IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);
381
		assertNotNull("no api component", afterApiComponent);
382
		IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after);
383
		assertNotNull("No delta", delta);
384
		IDelta[] allLeavesDeltas = collectLeaves(delta);
385
		assertEquals("Wrong size", 1, allLeavesDeltas.length);
386
		IDelta child = allLeavesDeltas[0];
387
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
388
		assertTrue("Not extend restrictions", RestrictionModifiers.isExtendRestriction(child.getRestrictions()));
389
		assertEquals("Wrong flag", IDelta.FIELD, child.getFlags());
390
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
391
		assertTrue("Should not be compatible", !DeltaProcessor.isCompatible(child));
392
	}
393
	
394
	/**
395
	 * Addition of a field in an interface that cannot be extended
396
	 */
397
	public void test31() {
398
		deployBundles("test31");
399
		IApiBaseline before = getBeforeState();
400
		IApiBaseline after = getAfterState();
401
		IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);
402
		assertNotNull("no api component", beforeApiComponent);
403
		IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);
404
		assertNotNull("no api component", afterApiComponent);
405
		IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after);
406
		assertNotNull("No delta", delta);
407
		IDelta[] allLeavesDeltas = collectLeaves(delta);
408
		assertEquals("Wrong size", 1, allLeavesDeltas.length);
409
		IDelta child = allLeavesDeltas[0];
410
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
411
		assertTrue("Not implement restrictions", RestrictionModifiers.isImplementRestriction(child.getRestrictions()));
412
		assertEquals("Wrong flag", IDelta.FIELD, child.getFlags());
413
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
414
		assertTrue("Should be compatible", DeltaProcessor.isCompatible(child));
415
	}
416
	
417
	/**
372
	 * Addition of a field in an interface that can be implemented
418
	 * Addition of a field in an interface that can be implemented
373
	 */
419
	 */
374
	public void test15() {
420
	public void test15() {
Lines 392-398 Link Here
392
	}
438
	}
393
439
394
	/**
440
	/**
395
	 * Move method up in hierarchy
441
	 * Move method up in hierarchy with noimplement only
396
	 */
442
	 */
397
	public void test16() {
443
	public void test16() {
398
		deployBundles("test16");
444
		deployBundles("test16");
Lines 411-417 Link Here
411
		assertTrue("Not implement restrictions", RestrictionModifiers.isImplementRestriction(child.getRestrictions()));
457
		assertTrue("Not implement restrictions", RestrictionModifiers.isImplementRestriction(child.getRestrictions()));
412
		assertEquals("Wrong flag", IDelta.METHOD, child.getFlags());
458
		assertEquals("Wrong flag", IDelta.METHOD, child.getFlags());
413
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
459
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
460
		assertTrue("Method Add not compatible", !DeltaProcessor.isCompatible(child));
461
		child = allLeavesDeltas[1];
462
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
463
		assertEquals("Wrong flag", IDelta.METHOD_MOVED_UP, child.getFlags());
464
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
465
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child));
466
	}
467
	
468
	/**
469
	 * Move method up in hierarchy with noextend only
470
	 */
471
	public void test32() {
472
		deployBundles("test32");
473
		IApiBaseline before = getBeforeState();
474
		IApiBaseline after = getAfterState();
475
		IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);
476
		assertNotNull("no api component", beforeApiComponent);
477
		IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);
478
		assertNotNull("no api component", afterApiComponent);
479
		IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after);
480
		assertNotNull("No delta", delta);
481
		IDelta[] allLeavesDeltas = collectLeaves(delta);
482
		assertEquals("Wrong size", 2, allLeavesDeltas.length);
483
		IDelta child = allLeavesDeltas[0];
484
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
485
		assertTrue("Not extend restrictions", RestrictionModifiers.isExtendRestriction(child.getRestrictions()));
486
		assertEquals("Wrong flag", IDelta.METHOD, child.getFlags());
487
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
488
		assertTrue("Method Add not compatible", !DeltaProcessor.isCompatible(child));
489
		child = allLeavesDeltas[1];
490
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
491
		assertEquals("Wrong flag", IDelta.METHOD_MOVED_UP, child.getFlags());
492
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
414
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child));
493
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child));
494
	}
495
	
496
	/**
497
	 * Move method up in hierarchy with noextend and noimplement
498
	 */
499
	public void test33() {
500
		deployBundles("test33");
501
		IApiBaseline before = getBeforeState();
502
		IApiBaseline after = getAfterState();
503
		IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);
504
		assertNotNull("no api component", beforeApiComponent);
505
		IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);
506
		assertNotNull("no api component", afterApiComponent);
507
		IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after);
508
		assertNotNull("No delta", delta);
509
		IDelta[] allLeavesDeltas = collectLeaves(delta);
510
		assertEquals("Wrong size", 2, allLeavesDeltas.length);
511
		IDelta child = allLeavesDeltas[0];
512
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
513
		assertTrue("Not implement restrictions", RestrictionModifiers.isImplementRestriction(child.getRestrictions()));
514
		assertEquals("Wrong flag", IDelta.METHOD, child.getFlags());
515
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
516
		assertTrue("Method Add compatible", DeltaProcessor.isCompatible(child));
415
		child = allLeavesDeltas[1];
517
		child = allLeavesDeltas[1];
416
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
518
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
417
		assertEquals("Wrong flag", IDelta.METHOD_MOVED_UP, child.getFlags());
519
		assertEquals("Wrong flag", IDelta.METHOD_MOVED_UP, child.getFlags());
Lines 673-684 Link Here
673
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
775
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
674
		assertEquals("Wrong flag", IDelta.SUPER_INTERFACE_WITH_METHODS, child.getFlags());
776
		assertEquals("Wrong flag", IDelta.SUPER_INTERFACE_WITH_METHODS, child.getFlags());
675
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
777
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
676
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child));
778
		assertTrue("Method Add not compatible", !DeltaProcessor.isCompatible(child));
677
		child = allLeavesDeltas[1];
779
		child = allLeavesDeltas[1];
678
		assertEquals("Wrong kind", IDelta.CHANGED, child.getKind());
780
		assertEquals("Wrong kind", IDelta.CHANGED, child.getKind());
679
		assertEquals("Wrong flag", IDelta.EXPANDED_SUPERINTERFACES_SET, child.getFlags());
781
		assertEquals("Wrong flag", IDelta.EXPANDED_SUPERINTERFACES_SET, child.getFlags());
680
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
782
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
681
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child));
783
		assertTrue("Changed superinterfaces set not compatible", DeltaProcessor.isCompatible(child));
784
	}
785
	/**
786
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
787
	 */
788
	public void test34() {
789
		deployBundles("test34");
790
		IApiBaseline before = getBeforeState();
791
		IApiBaseline after = getAfterState();
792
		IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);
793
		assertNotNull("no api component", beforeApiComponent);
794
		IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);
795
		assertNotNull("no api component", afterApiComponent);
796
		IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after);
797
		assertNotNull("No delta", delta);
798
		IDelta[] allLeavesDeltas = collectLeaves(delta);
799
		assertEquals("Wrong size", 2, allLeavesDeltas.length);
800
		IDelta child = allLeavesDeltas[0];
801
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
802
		assertEquals("Wrong flag", IDelta.SUPER_INTERFACE_WITH_METHODS, child.getFlags());
803
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
804
		assertTrue("Method Add not compatible", !DeltaProcessor.isCompatible(child));
805
		child = allLeavesDeltas[1];
806
		assertEquals("Wrong kind", IDelta.CHANGED, child.getKind());
807
		assertEquals("Wrong flag", IDelta.EXPANDED_SUPERINTERFACES_SET, child.getFlags());
808
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
809
		assertTrue("Changed superinterfaces set not compatible", DeltaProcessor.isCompatible(child));
810
	}
811
	/**
812
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
813
	 */
814
	public void test35() {
815
		deployBundles("test35");
816
		IApiBaseline before = getBeforeState();
817
		IApiBaseline after = getAfterState();
818
		IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);
819
		assertNotNull("no api component", beforeApiComponent);
820
		IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);
821
		assertNotNull("no api component", afterApiComponent);
822
		IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after);
823
		assertNotNull("No delta", delta);
824
		IDelta[] allLeavesDeltas = collectLeaves(delta);
825
		assertEquals("Wrong size", 2, allLeavesDeltas.length);
826
		IDelta child = allLeavesDeltas[0];
827
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
828
		assertEquals("Wrong flag", IDelta.SUPER_INTERFACE_WITH_METHODS, child.getFlags());
829
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
830
		assertTrue("Method Add compatible", DeltaProcessor.isCompatible(child));
831
		child = allLeavesDeltas[1];
832
		assertEquals("Wrong kind", IDelta.CHANGED, child.getKind());
833
		assertEquals("Wrong flag", IDelta.EXPANDED_SUPERINTERFACES_SET, child.getFlags());
834
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
835
		assertTrue("Changed superinterfaces set not compatible", DeltaProcessor.isCompatible(child));
682
	}
836
	}
683
	/**
837
	/**
684
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=244984
838
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=244984
Lines 730-736 Link Here
730
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
884
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
731
		assertEquals("Wrong flag", IDelta.METHOD, child.getFlags());
885
		assertEquals("Wrong flag", IDelta.METHOD, child.getFlags());
732
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
886
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
887
		assertTrue("Method Add compatible", !DeltaProcessor.isCompatible(child));
888
		child = allLeavesDeltas[1];
889
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
890
		assertEquals("Wrong flag", IDelta.METHOD_MOVED_UP, child.getFlags());
891
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
892
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child));
893
	}
894
	/**
895
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
896
	 */
897
	public void test36() {
898
		deployBundles("test36");
899
		IApiBaseline before = getBeforeState();
900
		IApiBaseline after = getAfterState();
901
		IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);
902
		assertNotNull("no api component", beforeApiComponent);
903
		IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);
904
		assertNotNull("no api component", afterApiComponent);
905
		IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after);
906
		assertNotNull("No delta", delta);
907
		IDelta[] allLeavesDeltas = collectLeaves(delta);
908
		assertEquals("Wrong size", 2, allLeavesDeltas.length);
909
		IDelta child = allLeavesDeltas[0];
910
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
911
		assertEquals("Wrong flag", IDelta.METHOD, child.getFlags());
912
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
913
		assertTrue("Method Add compatible", !DeltaProcessor.isCompatible(child));
914
		child = allLeavesDeltas[1];
915
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
916
		assertEquals("Wrong flag", IDelta.METHOD_MOVED_UP, child.getFlags());
917
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
733
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child));
918
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child));
919
	}
920
	/**
921
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=230189
922
	 */
923
	public void test37() {
924
		deployBundles("test37");
925
		IApiBaseline before = getBeforeState();
926
		IApiBaseline after = getAfterState();
927
		IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);
928
		assertNotNull("no api component", beforeApiComponent);
929
		IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);
930
		assertNotNull("no api component", afterApiComponent);
931
		IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after);
932
		assertNotNull("No delta", delta);
933
		IDelta[] allLeavesDeltas = collectLeaves(delta);
934
		assertEquals("Wrong size", 2, allLeavesDeltas.length);
935
		IDelta child = allLeavesDeltas[0];
936
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind());
937
		assertEquals("Wrong flag", IDelta.METHOD, child.getFlags());
938
		assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType());
939
		assertTrue("Method Add not compatible", DeltaProcessor.isCompatible(child));
734
		child = allLeavesDeltas[1];
940
		child = allLeavesDeltas[1];
735
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
941
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind());
736
		assertEquals("Wrong flag", IDelta.METHOD_MOVED_UP, child.getFlags());
942
		assertEquals("Wrong flag", IDelta.METHOD_MOVED_UP, child.getFlags());
(-)src/org/eclipse/pde/api/tools/builder/tests/compatibility/InterfaceCompatibilityMemberTests.java (-3 / +170 lines)
Lines 105-111 Link Here
105
	 */
105
	 */
106
	private void xAddFieldNoImplement(boolean incremental) throws Exception {
106
	private void xAddFieldNoImplement(boolean incremental) throws Exception {
107
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddFieldNoImplement.java");
107
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddFieldNoImplement.java");
108
		// no problems expected
108
		int[] ids = new int[] {
109
				ApiProblemFactory.createProblemId(
110
						IApiProblem.CATEGORY_COMPATIBILITY,
111
						IDelta.INTERFACE_ELEMENT_TYPE,
112
						IDelta.ADDED,
113
						IDelta.FIELD)
114
		};
115
		setExpectedProblemIds(ids);
116
		String[][] args = new String[1][];
117
		args[0] = new String[]{PACKAGE_PREFIX + "AddField", "ADDED_FIELD"};
109
		performCompatibilityTest(filePath, incremental);
118
		performCompatibilityTest(filePath, incremental);
110
	}
119
	}
111
	
120
	
Lines 118-123 Link Here
118
	}
127
	}
119
128
120
	/**
129
	/**
130
	 * Tests adding a field to a noextend interface
131
	 */
132
	private void xAddFieldNoExtend(boolean incremental) throws Exception {
133
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddFieldNoExtend.java");
134
		int[] ids = new int[] {
135
				ApiProblemFactory.createProblemId(
136
						IApiProblem.CATEGORY_COMPATIBILITY,
137
						IDelta.INTERFACE_ELEMENT_TYPE,
138
						IDelta.ADDED,
139
						IDelta.FIELD)
140
		};
141
		setExpectedProblemIds(ids);
142
		String[][] args = new String[1][];
143
		args[0] = new String[]{PACKAGE_PREFIX + "AddFieldNoExtend", "ADDED_FIELD"};
144
		setExpectedMessageArgs(args);
145
		performCompatibilityTest(filePath, incremental);
146
	}
147
	
148
	public void testAddFieldNoExtendI() throws Exception {
149
		xAddFieldNoExtend(true);
150
	}	
151
	
152
	public void testAddFieldNoExtendF() throws Exception {
153
		xAddFieldNoExtend(false);
154
	}
155
	
156
	/**
157
	 * Tests adding a field to a noextend / noimplement interface
158
	 */
159
	private void xAddFieldNoExtendNoImplement(boolean incremental) throws Exception {
160
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddFieldNoExtendNoImplement.java");
161
		//expecting no problems
162
		performCompatibilityTest(filePath, incremental);
163
	}
164
	
165
	public void testAddFieldNoExtendNoImplementI() throws Exception {
166
		xAddFieldNoExtendNoImplement(true);
167
	}	
168
	
169
	public void testAddFieldNoExtendNoImplementF() throws Exception {
170
		xAddFieldNoExtendNoImplement(false);
171
	}
172
	
173
	/**
121
	 * Tests adding a method to an interface
174
	 * Tests adding a method to an interface
122
	 */
175
	 */
123
	private void xAddMethod(boolean incremental) throws Exception {
176
	private void xAddMethod(boolean incremental) throws Exception {
Lines 149-155 Link Here
149
	 */
202
	 */
150
	private void xAddMethodNoImplement(boolean incremental) throws Exception {
203
	private void xAddMethodNoImplement(boolean incremental) throws Exception {
151
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddMethodNoImplement.java");
204
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddMethodNoImplement.java");
152
		// no problems expected
205
		int[] ids = new int[] {
206
				ApiProblemFactory.createProblemId(
207
						IApiProblem.CATEGORY_COMPATIBILITY,
208
						IDelta.INTERFACE_ELEMENT_TYPE,
209
						IDelta.ADDED,
210
						IDelta.METHOD)
211
		};
212
		setExpectedProblemIds(ids);
213
		String[][] args = new String[1][];
214
		args[0] = new String[]{PACKAGE_PREFIX + "AddMethodNoImplement", "addMethod(String)"};
215
		setExpectedMessageArgs(args);
153
		performCompatibilityTest(filePath, incremental);
216
		performCompatibilityTest(filePath, incremental);
154
	}
217
	}
155
	
218
	
Lines 162-167 Link Here
162
	}
225
	}
163
226
164
	/**
227
	/**
228
	 * Tests adding a method to a noimplement interface
229
	 */
230
	private void xAddMethodNoExtend(boolean incremental) throws Exception {
231
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddMethodNoExtend.java");
232
		int[] ids = new int[] {
233
				ApiProblemFactory.createProblemId(
234
						IApiProblem.CATEGORY_COMPATIBILITY,
235
						IDelta.INTERFACE_ELEMENT_TYPE,
236
						IDelta.ADDED,
237
						IDelta.METHOD)
238
		};
239
		setExpectedProblemIds(ids);
240
		String[][] args = new String[1][];
241
		args[0] = new String[]{PACKAGE_PREFIX + "AddMethodNoExtend", "addMethod(String)"};
242
		setExpectedMessageArgs(args);
243
		performCompatibilityTest(filePath, incremental);
244
	}
245
	
246
	public void testAddMethodNoExtendI() throws Exception {
247
		xAddMethodNoExtend(true);
248
	}	
249
	
250
	public void testAddMethodNoExtendF() throws Exception {
251
		xAddMethodNoExtend(false);
252
	}
253
	
254
	/**
255
	 * Tests adding a method to a noimplement interface
256
	 */
257
	private void xAddMethodNoExtendNoImplement(boolean incremental) throws Exception {
258
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddMethodNoExtendNoImplement.java");
259
		//expecting no problems
260
		performCompatibilityTest(filePath, incremental);
261
	}
262
	
263
	public void testAddMethodNoExtendNoImplementI() throws Exception {
264
		xAddMethodNoExtendNoImplement(true);
265
	}	
266
	
267
	public void testAddMethodNoExtendNoImplementF() throws Exception {
268
		xAddMethodNoExtendNoImplement(false);
269
	}
270
	
271
	/**
165
	 * Tests adding a  member type to an interface
272
	 * Tests adding a  member type to an interface
166
	 */
273
	 */
167
	private void xAddMemberType(boolean incremental) throws Exception {
274
	private void xAddMemberType(boolean incremental) throws Exception {
Lines 303-309 Link Here
303
	 */
410
	 */
304
	private void xAddSuperInterfaceANoImplement(boolean incremental) throws Exception {
411
	private void xAddSuperInterfaceANoImplement(boolean incremental) throws Exception {
305
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddInterfaceANoImplement.java");
412
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddInterfaceANoImplement.java");
306
		// no problems expected
413
		int[] ids = new int[] {
414
				ApiProblemFactory.createProblemId(
415
						IApiProblem.CATEGORY_COMPATIBILITY,
416
						IDelta.INTERFACE_ELEMENT_TYPE,
417
						IDelta.ADDED,
418
						IDelta.SUPER_INTERFACE_WITH_METHODS)
419
		};
420
		setExpectedProblemIds(ids);
421
		String[][] args = new String[1][];
422
		args[0] = new String[]{
423
				PACKAGE_PREFIX + "AddInterfaceANoImplement",
424
				"a.classes.hierarchy.InterfaceA",
425
				"methodA()"};
426
		setExpectedMessageArgs(args);
307
		performCompatibilityTest(filePath, incremental);
427
		performCompatibilityTest(filePath, incremental);
308
	}
428
	}
309
	
429
	
Lines 316-321 Link Here
316
	}	
436
	}	
317
	
437
	
318
	/**
438
	/**
439
	 * Tests adding a super interface to a noimplement interface
440
	 */
441
	private void xAddSuperInterfaceANoExtend(boolean incremental) throws Exception {
442
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddInterfaceANoExtend.java");
443
		int[] ids = new int[] {
444
				ApiProblemFactory.createProblemId(
445
						IApiProblem.CATEGORY_COMPATIBILITY,
446
						IDelta.INTERFACE_ELEMENT_TYPE,
447
						IDelta.ADDED,
448
						IDelta.SUPER_INTERFACE_WITH_METHODS)
449
		};
450
		setExpectedProblemIds(ids);
451
		String[][] args = new String[1][];
452
		args[0] = new String[]{
453
				PACKAGE_PREFIX + "AddInterfaceANoExtend",
454
				"a.classes.hierarchy.InterfaceA",
455
				"methodA()"};
456
		setExpectedMessageArgs(args);
457
		performCompatibilityTest(filePath, incremental);
458
	}
459
	
460
	public void testAddSuperInterfaceANoExtendI() throws Exception {
461
		xAddSuperInterfaceANoExtend(true);
462
	}	
463
	
464
	public void testAddSuperInterfaceANoExtendF() throws Exception {
465
		xAddSuperInterfaceANoExtend(false);
466
	}	
467
	
468
	/**
469
	 * Tests adding a super interface to a noimplement interface
470
	 */
471
	private void xAddSuperInterfaceANoExtendNoImplement(boolean incremental) throws Exception {
472
		IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddInterfaceANoExtendNoImplement.java");
473
		// no problems expected
474
		performCompatibilityTest(filePath, incremental);
475
	}
476
	
477
	public void testAddSuperInterfaceANoExtendNoImplementI() throws Exception {
478
		xAddSuperInterfaceANoExtendNoImplement(true);
479
	}	
480
	
481
	public void testAddSuperInterfaceANoExtendNoImplementF() throws Exception {
482
		xAddSuperInterfaceANoExtendNoImplement(false);
483
	}	
484
	
485
	/**
319
	 * Tests removing a super interface
486
	 * Tests removing a super interface
320
	 */
487
	 */
321
	private void xReduceSuperInterfaceABtoA(boolean incremental) throws Exception {
488
	private void xReduceSuperInterfaceABtoA(boolean incremental) throws Exception {
(-)src/org/eclipse/pde/api/tools/builder/tests/compatibility/InterfaceCompatibilityRestrictionTests.java (+112 lines)
Lines 114-117 Link Here
114
		setExpectedMessageArgs(args);
114
		setExpectedMessageArgs(args);
115
		performCompatibilityTest(filePath, incremental);
115
		performCompatibilityTest(filePath, incremental);
116
	}
116
	}
117
	
118
	/**
119
	 * Tests removing a noextend annotation using an incremental build 
120
	 */
121
	public void testRemoveNoExtendI() {
122
		xRemoveNoExtend(true);
123
	}
124
	
125
	/**
126
	 * Tests removing a noextend annotation using a full build
127
	 */
128
	public void testRemoveNoExtendF() {
129
		xRemoveNoExtend(false);
130
	}
131
	
132
	private void xRemoveNoExtend(boolean inc) {
133
		try {
134
			IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("RemoveNoExtend.java");
135
			// no problem expected
136
			performCompatibilityTest(filePath, inc);
137
		}
138
		catch(Exception e) {
139
			fail(e.getMessage());
140
		}
141
	}
142
	
143
	/**
144
	 * Tests adding a noextend annotation using an incremental build
145
	 */
146
	public void testAddNoExtendI() {
147
		xAddNoExtend(true);
148
	}
149
	
150
	/**
151
	 * Tests adding a noextend annotation using a full build
152
	 */
153
	public void testAddNoExtendF() {
154
		xAddNoExtend(false);
155
	}
156
	
157
	private void xAddNoExtend(boolean inc) {
158
		try {
159
			IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddNoExtend.java");
160
			int[] ids = new int[] {
161
					getDefaultProblemId()
162
			};
163
			setExpectedProblemIds(ids);
164
			String[][] args = new String[1][];
165
			args[0] = new String[]{PACKAGE_PREFIX + "AddNoExtend"};
166
			setExpectedMessageArgs(args);
167
			performCompatibilityTest(filePath, inc);
168
		}
169
		catch(Exception e) {
170
			fail(e.getMessage());
171
		}
172
	}
173
	
174
	/**
175
	 * Tests adding both noextend and noimplement annotations using an incremental build
176
	 */
177
	public void testAddNoExtendNoImplementI() {
178
		xAddNoExtendNoImplement(true);
179
	}
180
	
181
	/**
182
	 * Tests adding both noextend and noimplement annotations using a full build
183
	 */
184
	public void testAddNoExtendNoImplementF() {
185
		xAddNoExtendNoImplement(false);
186
	}
187
	
188
	private void xAddNoExtendNoImplement(boolean inc) {
189
		try {
190
			IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddNoExtendNoImplement.java");
191
			int[] ids = new int[] {
192
					getDefaultProblemId()
193
			};
194
			setExpectedProblemIds(ids);
195
			String[][] args = new String[1][];
196
			args[0] = new String[]{PACKAGE_PREFIX + "AddNoExtendNoImplement"};
197
			setExpectedMessageArgs(args);
198
			performCompatibilityTest(filePath, inc);
199
		}
200
		catch(Exception e) {
201
			fail(e.getMessage());
202
		}
203
	}
204
	
205
	/**
206
	 * Tests removing both noextend and noimplement annotations using an incremental build
207
	 */
208
	public void testRemoveNoExtendNoImplementI() {
209
		xRemoveNoExtendNoImplement(true);
210
	}
211
	
212
	/**
213
	 * Tests removing both noextend and noimplement annotations using a full build
214
	 */
215
	public void testRemoveNoExtendNoImplementF() {
216
		xRemoveNoExtendNoImplement(false);
217
	}
218
	
219
	private void xRemoveNoExtendNoImplement(boolean inc) {
220
		try {
221
			IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("RemoveNoExtendNoImplement.java");
222
			// no problem expected
223
			performCompatibilityTest(filePath, inc);
224
		}
225
		catch(Exception e) {
226
			fail(e.getMessage());
227
		}
228
	}
117
}
229
}
(-)tests-deltas/interface/test30/before/p/I.java (+4 lines)
Added Link Here
1
package p;
2
3
public interface I {
4
}
(-)tests-deltas/interface/test31/before/p/I.java (+4 lines)
Added Link Here
1
package p;
2
3
public interface I {
4
}
(-)tests-deltas/interface/test32/before/I.java (+3 lines)
Added Link Here
1
public interface I extends J {
2
	void foo();
3
}
(-)tests-deltas/interface/test32/resources/.api_description (+9 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
 <plugin id="deltatest" />
4
5
 <package name="">
6
 	<type name="I" extend="false"/>
7
 	<type name="J" extend="false"/>
8
 </package>
9
</component>
(-)test-builder/baseline/bundle.a/src/a/interfaces/members/AddMethodNoExtendNoImplement.java (+9 lines)
Added Link Here
1
package a.interfaces.members;
2
3
/**
4
 * @noimplement This interface is not intended to be implemented by clients.
5
 * @noextend
6
 */
7
public interface AddMethodNoExtendNoImplement {
8
9
}
(-)tests-deltas/interface/test36/after/p/J.java (+6 lines)
Added Link Here
1
package p;
2
3
public interface J {
4
	void bar();
5
	void foo2(String s);
6
}
(-)test-builder/baseline/bundle.a/src/a/interfaces/restrictions/RemoveNoExtendNoImplement.java (+9 lines)
Added Link Here
1
package a.interfaces.restrictions;
2
3
/**
4
 * @noextend This interface is not to be extended by clients.
5
 * @noimplement This interface is not intended to be implemented by clients.
6
 */
7
public interface RemoveNoExtendNoImplement {
8
9
}
(-)tests-deltas/interface/test34/before/p/I.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface I {
4
	void foo();
5
}
(-)tests-deltas/interface/test35/before/p/I.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface I {
4
	void foo();
5
}
(-)tests-deltas/interface/test35/after/p/I.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface I extends J {
4
	void foo();
5
}
(-)tests-deltas/interface/test36/before/p/I.java (+6 lines)
Added Link Here
1
package p;
2
3
public interface I extends J {
4
	void foo();
5
	void foo2(String s);
6
}
(-)test-builder/compat/interface/members/AddInterfaceANoExtend.java (+10 lines)
Added Link Here
1
package a.interfaces.members;
2
3
import a.classes.hierarchy.InterfaceA;
4
5
/**
6
 * @noextend
7
 */
8
public interface AddInterfaceANoExtend extends InterfaceA {
9
10
}
(-)test-builder/usage/class/testC7.java (+8 lines)
Added Link Here
1
package x.y.z;
2
3
import i.IExtInterface1;
4
import c.BaseImplExt;
5
6
public class testC7 extends BaseImplExt implements IExtInterface1 {
7
8
}
(-)tests-deltas/interface/test37/before/p/I.java (+6 lines)
Added Link Here
1
package p;
2
3
public interface I extends J {
4
	void foo();
5
	void foo2(String s);
6
}
(-)tests-deltas/field/test72/resources/.api_description (+8 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
<plugin id="deltatest" />
4
5
<package name="">
6
	<type name="I" extend="false"/>
7
</package>
8
</component>
(-)tests-deltas/interface/test31/after/p/I.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface I {
4
	int i = 0;
5
}
(-)test-builder/usage/class/testC3.java (+11 lines)
Added Link Here
1
package x.y.z;
2
3
import i.IExtInterface1;
4
5
/**
6
 * Indirectly implements INoImpl1 with no 
7
 * parent implementing class
8
 */
9
public class testC3 implements IExtInterface1 {
10
11
}
(-)tests-deltas/interface/test36/resources/after/META-INF/MANIFEST.MF (+9 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Ant-Version: Apache Ant 1.7.0
3
Created-By: 1.6.0_05-ea-b04 (Sun Microsystems Inc.)
4
Bundle-ManifestVersion: 2
5
Bundle-Name: deltatest Plug-in
6
Bundle-SymbolicName: deltatest
7
Bundle-Version: 2.0.0
8
Bundle-RequiredExecutionEnvironment: J2SE-1.4
9
Export-Package: p
(-)test-builder/tags/interface/valid/test6.java (+48 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package a.b.c;
12
13
/**
14
 * Test supported @noextend tag on an interface
15
 * @noextend
16
 */
17
public interface test6 {
18
19
	/**
20
	 * @noextend
21
	 */
22
	interface inner {
23
		
24
	}
25
	
26
	interface inner1 {
27
		/**
28
		 * @noextend
29
		 */
30
		interface inner2 {
31
			
32
		}
33
	}
34
	
35
	interface inner2 {
36
		
37
	}
38
}
39
40
interface outer {
41
	
42
	/**
43
	 * @noextend
44
	 */
45
	interface inner {
46
		
47
	}
48
}
(-)test-builder/compat/interface/restrictions/RemoveNoExtendNoImplement.java (+5 lines)
Added Link Here
1
package a.interfaces.restrictions;
2
3
public interface RemoveNoExtendNoImplement {
4
5
}
(-)test-builder/baseline/bundle.a/src/a/interfaces/restrictions/AddNoExtendNoImplement.java (+7 lines)
Added Link Here
1
package a.interfaces.restrictions;
2
3
/**
4
 */
5
public interface AddNoExtendNoImplement {
6
7
}
(-)tests-deltas/interface/test34/resources/after/.api_description (+7 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
<plugin id="deltatest" />
4
<package name="p">
5
	<type name="I" extend="false"/>
6
</package>
7
</component>
(-)test-builder/usageprojects/refproject/src/i/IExtInterface2.java (+5 lines)
Added Link Here
1
package i;
2
3
public interface IExtInterface2 extends IExtInterface1 {
4
5
}
(-)test-builder/compat/interface/members/AddInterfaceANoExtendNoImplement.java (+12 lines)
Added Link Here
1
package a.interfaces.members;
2
3
import a.classes.hierarchy.InterfaceA;
4
5
6
/**
7
 * @noimplement This interface is not intended to be implemented by clients.
8
 * @noextend
9
 */
10
public interface AddInterfaceANoExtendNoImplement extends InterfaceA {
11
12
}
(-)test-builder/baseline/bundle.a/src/a/interfaces/members/AddFieldNoExtend.java (+8 lines)
Added Link Here
1
package a.interfaces.members;
2
3
/**
4
 * @noextend
5
 */
6
public interface AddFieldNoExtend {
7
8
}
(-)tests-deltas/interface/test34/resources/before/META-INF/MANIFEST.MF (+9 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Ant-Version: Apache Ant 1.7.0
3
Created-By: 1.6.0_05-ea-b04 (Sun Microsystems Inc.)
4
Bundle-ManifestVersion: 2
5
Bundle-Name: deltatest Plug-in
6
Bundle-SymbolicName: deltatest
7
Bundle-Version: 1.0.0
8
Bundle-RequiredExecutionEnvironment: J2SE-1.4
9
Export-Package: p
(-)test-builder/baseline/bundle.a/src/a/interfaces/restrictions/RemoveNoExtend.java (+8 lines)
Added Link Here
1
package a.interfaces.restrictions;
2
3
/**
4
 * @noextend This interface is not to be extended by clients.
5
 */
6
public interface RemoveNoExtend {
7
8
}
(-)test-builder/baseline/bundle.a/src/a/interfaces/members/AddMethodNoExtend.java (+8 lines)
Added Link Here
1
package a.interfaces.members;
2
3
/**
4
 * @noextend
5
 */
6
public interface AddMethodNoExtend {
7
8
}
(-)tests-deltas/interface/test36/resources/before/META-INF/MANIFEST.MF (+9 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Ant-Version: Apache Ant 1.7.0
3
Created-By: 1.6.0_05-ea-b04 (Sun Microsystems Inc.)
4
Bundle-ManifestVersion: 2
5
Bundle-Name: deltatest Plug-in
6
Bundle-SymbolicName: deltatest
7
Bundle-Version: 1.0.0
8
Bundle-RequiredExecutionEnvironment: J2SE-1.4
9
Export-Package: p
(-)test-builder/usageprojects/refproject/src/c/BaseImpl1.java (+7 lines)
Added Link Here
1
package c;
2
3
import i.INoImpl1;
4
5
public class BaseImpl1 implements INoImpl1 {
6
7
}
(-)test-builder/usageprojects/refproject/src/i/INoImpl1.java (+8 lines)
Added Link Here
1
package i;
2
3
/**
4
 * @noimplement This interface is not intended to be implemented by clients.
5
 */
6
public interface INoImpl1 {
7
8
}
(-)tests-deltas/interface/test35/resources/before/.api_description (+7 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
<plugin id="deltatest" />
4
<package name="p">
5
	<type name="I" implement="false" extend="false"/>
6
</package>
7
</component>
(-)tests-deltas/interface/test37/resources/before/.api_description (+7 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
<plugin id="deltatest" />
4
<package name="p">
5
	<type name="J" implement="false" extend="false"/>
6
</package>
7
</component>
(-)tests-deltas/interface/test32/before/J.java (+1 lines)
Added Link Here
1
public interface J {}
(-)tests-deltas/interface/test34/before/p/J.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface J {
4
	void foo2(String s);
5
}
(-)tests-deltas/interface/test31/resources/.api_description (+8 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
 <plugin id="deltatest" />
4
5
 <package name="p">
6
 	<type name="I" extend="false" implement="false"/>
7
 </package>
8
</component>
(-)tests-deltas/interface/test35/before/p/J.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface J {
4
	void foo2(String s);
5
}
(-)tests-deltas/interface/test35/after/p/J.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface J {
4
	void foo2(String s);
5
}
(-)tests-deltas/interface/test36/before/p/J.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface J {
4
	void bar();
5
}
(-)test-builder/baseline/bundle.a/src/a/interfaces/members/AddFieldNoExtendNoImplement.java (+9 lines)
Added Link Here
1
package a.interfaces.members;
2
3
/**
4
 * @noimplement This interface is not intended to be implemented by clients.
5
 * @noextend
6
 */
7
public interface AddFieldNoExtendNoImplement {
8
9
}
(-)tests-deltas/interface/test37/before/p/J.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface J {
4
	void bar();
5
}
(-)test-builder/compat/interface/restrictions/AddNoExtendNoImplement.java (+9 lines)
Added Link Here
1
package a.interfaces.restrictions;
2
3
/**
4
 * @noimplement This interface is not intended to be implemented by clients.
5
 * @noextend This interface is not intended to be extended by clients.
6
 */
7
public interface AddNoExtendNoImplement {
8
9
}
(-)tests-deltas/interface/test34/after/p/I.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface I extends J {
4
	void foo();
5
}
(-)tests-deltas/field/test71/resources/.api_description (+8 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
<plugin id="deltatest" />
4
5
<package name="">
6
	<type name="I" implement="false" extend="false"/>
7
</package>
8
</component>
(-)test-builder/usage/class/testC4.java (+12 lines)
Added Link Here
1
package x.y.z;
2
3
import i.IExtInterface1;
4
import c.BaseImpl1;
5
6
/**
7
 * Indirectly implements a @noimplement interface with a parent class that 
8
 * implements the @noimplement interface
9
 */
10
public class testC4 extends BaseImpl1 implements IExtInterface1 {
11
12
}
(-)tests-deltas/interface/test32/after/I.java (+2 lines)
Added Link Here
1
public interface I extends J {
2
}
(-)tests-deltas/interface/test37/resources/after/META-INF/MANIFEST.MF (+9 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Ant-Version: Apache Ant 1.7.0
3
Created-By: 1.6.0_05-ea-b04 (Sun Microsystems Inc.)
4
Bundle-ManifestVersion: 2
5
Bundle-Name: deltatest Plug-in
6
Bundle-SymbolicName: deltatest
7
Bundle-Version: 2.0.0
8
Bundle-RequiredExecutionEnvironment: J2SE-1.4
9
Export-Package: p
(-)test-builder/tags/interface/valid/test7.java (+47 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
12
13
/**
14
 * Test supported @noextend tag on an interface in the default package
15
 * @noextend
16
 */
17
public interface test7 {
18
	/**
19
	 * @noextend
20
	 */
21
	interface inner {
22
		
23
	}
24
	
25
	interface inner1 {
26
		/**
27
		 * @noextend
28
		 */
29
		interface inner2 {
30
			
31
		}
32
	}
33
	
34
	interface inner2 {
35
		
36
	}
37
}
38
39
interface outer {
40
	
41
	/**
42
	 * @noextend
43
	 */
44
	interface inner {
45
		
46
	}
47
}
(-)tests-deltas/interface/test30/after/p/I.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface I {
4
	int i = 0;
5
}
(-)test-builder/compat/interface/restrictions/RemoveNoExtend.java (+5 lines)
Added Link Here
1
package a.interfaces.restrictions;
2
3
public interface RemoveNoExtend {
4
5
}
(-)test-builder/baseline/bundle.a/src/a/interfaces/members/AddInterfaceANoExtend.java (+8 lines)
Added Link Here
1
package a.interfaces.members;
2
3
/**
4
 * @noextend
5
 */
6
public interface AddInterfaceANoExtend {
7
8
}
(-)tests-deltas/interface/test35/resources/after/.api_description (+7 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
<plugin id="deltatest" />
4
<package name="p">
5
	<type name="I" implement="false" extend="false"/>
6
</package>
7
</component>
(-)test-builder/usageprojects/refproject/src/i/IExtInterface3.java (+5 lines)
Added Link Here
1
package i;
2
3
public interface IExtInterface3 extends IExtInterface2 {
4
5
}
(-)test-builder/compat/interface/restrictions/AddNoExtend.java (+8 lines)
Added Link Here
1
package a.interfaces.restrictions;
2
3
/**
4
 * @noextend This interface is not to be extended by clients.
5
 */
6
public interface AddNoExtend {
7
8
}
(-)test-builder/compat/interface/members/AddFieldNoExtendNoImplement.java (+11 lines)
Added Link Here
1
package a.interfaces.members;
2
3
/**
4
 * @noimplement This interface is not intended to be implemented by clients.
5
 * @noextend
6
 */
7
public interface AddFieldNoExtendNoImplement {
8
9
	public static final String ADDED_FIELD = "ADDED";
10
	
11
}
(-)test-builder/usageprojects/refproject/src/i/INoImpl2.java (+8 lines)
Added Link Here
1
package i;
2
3
/**
4
 * @noimplement This interface is not intended to be implemented by clients.
5
 */
6
public interface INoImpl2 {
7
8
}
(-)test-builder/usageprojects/refproject/src/c/BaseImpl1_2_3_4.java (+10 lines)
Added Link Here
1
package c;
2
3
import i.INoImpl1;
4
import i.INoImpl2;
5
import i.INoImpl3;
6
import i.INoImpl4;
7
8
public class BaseImpl1_2_3_4 implements INoImpl1, INoImpl2, INoImpl3, INoImpl4 {
9
10
}
(-)tests-deltas/interface/test37/after/p/I.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface I extends J {
4
	void foo();
5
}
(-)tests-deltas/interface/test33/before/I.java (+3 lines)
Added Link Here
1
public interface I extends J {
2
	void foo();
3
}
(-)tests-deltas/interface/test30/resources/.api_description (+8 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
 <plugin id="deltatest" />
4
5
 <package name="p">
6
 	<type name="I" extend="false"/>
7
 </package>
8
</component>
(-)tests-deltas/interface/test34/after/p/J.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface J {
4
	void foo2(String s);
5
}
(-)test-builder/usage/class/testC5.java (+14 lines)
Added Link Here
1
package x.y.z;
2
3
import i.IExtInterface1;
4
import i.IExtInterface2;
5
import i.IExtInterface3;
6
import i.IExtInterface4;
7
8
/**
9
 * Indirectly implements 4 @noimplement interfaces with no 
10
 * parent class that implements them
11
 */
12
public class testC5 implements IExtInterface1, IExtInterface2, IExtInterface3, IExtInterface4 {
13
14
}
(-)tests-deltas/interface/test32/after/J.java (+3 lines)
Added Link Here
1
public interface J {
2
	void foo();
3
}
(-)tests-deltas/interface/test33/after/I.java (+2 lines)
Added Link Here
1
public interface I extends J {
2
}
(-)test-builder/baseline/bundle.a/src/a/interfaces/members/AddInterfaceANoExtendNoImplement.java (+10 lines)
Added Link Here
1
package a.interfaces.members;
2
3
4
/**
5
 * @noimplement This interface is not intended to be implemented by clients.
6
 * @noextend
7
 */
8
public interface AddInterfaceANoExtendNoImplement {
9
10
}
(-)tests-deltas/interface/test34/resources/after/META-INF/MANIFEST.MF (+9 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Ant-Version: Apache Ant 1.7.0
3
Created-By: 1.6.0_05-ea-b04 (Sun Microsystems Inc.)
4
Bundle-ManifestVersion: 2
5
Bundle-Name: deltatest Plug-in
6
Bundle-SymbolicName: deltatest
7
Bundle-Version: 2.0.0
8
Bundle-RequiredExecutionEnvironment: J2SE-1.4
9
Export-Package: p
(-)test-builder/usageprojects/refproject/src/c/BaseImplExt.java (+5 lines)
Added Link Here
1
package c;
2
3
public class BaseImplExt extends BaseImpl1 {
4
5
}
(-)test-builder/compat/interface/members/AddMethodNoExtendNoImplement.java (+11 lines)
Added Link Here
1
package a.interfaces.members;
2
3
/**
4
 * @noimplement This interface is not intended to be implemented by clients.
5
 * @noextend
6
 */
7
public interface AddMethodNoExtendNoImplement {
8
9
	public int addMethod(String foo);
10
	
11
}
(-)test-builder/usage/interface/testI3.java (+27 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package x.y.z;
12
13
import i.InterfaceUsageInterface2;
14
15
/**
16
 * 
17
 */
18
public interface testI1 extends InterfaceUsageInterface2 {
19
20
	interface inner extends InterfaceUsageInterface2.Iinner {
21
		
22
	}
23
}
24
25
interface Iouter extends InterfaceUsageInterface2.Iinner {
26
	
27
}
(-)tests-deltas/interface/test36/resources/after/.api_description (+7 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
<plugin id="deltatest" />
4
<package name="p">
5
	<type name="J" extend="false"/>
6
</package>
7
</component>
(-)test-builder/usageprojects/refproject/src/i/IExtInterface4.java (+5 lines)
Added Link Here
1
package i;
2
3
public interface IExtInterface4 extends INoImpl4 {
4
5
}
(-)tests-deltas/interface/test35/resources/before/META-INF/MANIFEST.MF (+9 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Ant-Version: Apache Ant 1.7.0
3
Created-By: 1.6.0_05-ea-b04 (Sun Microsystems Inc.)
4
Bundle-ManifestVersion: 2
5
Bundle-Name: deltatest Plug-in
6
Bundle-SymbolicName: deltatest
7
Bundle-Version: 1.0.0
8
Bundle-RequiredExecutionEnvironment: J2SE-1.4
9
Export-Package: p
(-)tests-deltas/interface/test37/resources/before/META-INF/MANIFEST.MF (+9 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Ant-Version: Apache Ant 1.7.0
3
Created-By: 1.6.0_05-ea-b04 (Sun Microsystems Inc.)
4
Bundle-ManifestVersion: 2
5
Bundle-Name: deltatest Plug-in
6
Bundle-SymbolicName: deltatest
7
Bundle-Version: 1.0.0
8
Bundle-RequiredExecutionEnvironment: J2SE-1.4
9
Export-Package: p
(-)test-builder/usageprojects/refproject/src/i/INoImpl3.java (+8 lines)
Added Link Here
1
package i;
2
3
/**
4
 * @noimplement This interface is not intended to be implemented by clients.
5
 */
6
public interface INoImpl3 {
7
8
}
(-)tests-deltas/interface/test34/resources/before/.api_description (+7 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
<plugin id="deltatest" />
4
<package name="p">
5
	<type name="I" extend="false"/>
6
</package>
7
</component>
(-)test-builder/compat/interface/members/AddFieldNoExtend.java (+10 lines)
Added Link Here
1
package a.interfaces.members;
2
3
/**
4
 * @noextend
5
 */
6
public interface AddFieldNoExtend {
7
8
	public static final String ADDED_FIELD = "ADDED";
9
	
10
}
(-)tests-deltas/interface/test36/resources/before/.api_description (+7 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
<plugin id="deltatest" />
4
<package name="p">
5
	<type name="J" extend="false"/>
6
</package>
7
</component>
(-)tests-deltas/interface/test33/resources/.api_description (+9 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
 <plugin id="deltatest" />
4
5
 <package name="">
6
 	<type name="I" extend="false" implement="false"/>
7
 	<type name="J" extend="false" implement="false"/>
8
 </package>
9
</component>
(-)tests-deltas/interface/test37/after/p/J.java (+6 lines)
Added Link Here
1
package p;
2
3
public interface J {
4
	void bar();
5
	void foo2(String s);
6
}
(-)tests-deltas/interface/test33/before/J.java (+1 lines)
Added Link Here
1
public interface J {}
(-)test-builder/usageprojects/refproject/src/i/InterfaceUsageInterface2.java (+24 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package i;
12
13
/**
14
 * @noextend
15
 */
16
public interface InterfaceUsageInterface2 {
17
18
	/**
19
	 * @noextend
20
	 */
21
	interface Iinner {
22
		
23
	}
24
}
(-)tests-deltas/interface/test36/after/p/I.java (+5 lines)
Added Link Here
1
package p;
2
3
public interface I extends J {
4
	void foo();
5
}
(-)test-builder/usage/class/testC6.java (+17 lines)
Added Link Here
1
package x.y.z;
2
3
import i.IExtInterface1;
4
import i.IExtInterface2;
5
import i.IExtInterface3;
6
import i.IExtInterface4;
7
import c.BaseImpl1_2_3_4;
8
9
/**
10
 * Multi-indirect implementations with an 
11
 * implementing parent class that implements all @noimplement
12
 * interfaces
13
 */
14
public class testC6 extends BaseImpl1_2_3_4 implements IExtInterface1,
15
		IExtInterface2, IExtInterface3, IExtInterface4 {
16
17
}
(-)tests-deltas/interface/test33/after/J.java (+3 lines)
Added Link Here
1
public interface J {
2
	void foo();
3
}
(-)test-builder/baseline/bundle.a/src/a/interfaces/restrictions/AddNoExtend.java (+7 lines)
Added Link Here
1
package a.interfaces.restrictions;
2
3
/**
4
 */
5
public interface AddNoExtend {
6
7
}
(-)tests-deltas/interface/test35/resources/after/META-INF/MANIFEST.MF (+9 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Ant-Version: Apache Ant 1.7.0
3
Created-By: 1.6.0_05-ea-b04 (Sun Microsystems Inc.)
4
Bundle-ManifestVersion: 2
5
Bundle-Name: deltatest Plug-in
6
Bundle-SymbolicName: deltatest
7
Bundle-Version: 2.0.0
8
Bundle-RequiredExecutionEnvironment: J2SE-1.4
9
Export-Package: p
(-)test-builder/compat/interface/members/AddMethodNoExtend.java (+10 lines)
Added Link Here
1
package a.interfaces.members;
2
3
/**
4
 * @noextend
5
 */
6
public interface AddMethodNoExtend {
7
8
	public int addMethod(String foo);
9
	
10
}
(-)tests-deltas/interface/test37/resources/after/.api_description (+7 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<component name="deltatest">
3
<plugin id="deltatest" />
4
<package name="p">
5
	<type name="J" implement="false" extend="false"/>
6
</package>
7
</component>
(-)test-builder/usageprojects/refproject/src/i/IExtInterface1.java (+5 lines)
Added Link Here
1
package i;
2
3
public interface IExtInterface1 extends INoImpl1 {
4
5
}
(-)test-builder/usageprojects/refproject/src/i/INoImpl4.java (+8 lines)
Added Link Here
1
package i;
2
3
/**
4
 * @noimplement This interface is not intended to be implemented by clients.
5
 */
6
public interface INoImpl4 {
7
8
}
(-)src/org/eclipse/pde/api/tools/internal/problems/problemmessages.properties (-1 / +2 lines)
Lines 9-15 Link Here
9
#     IBM Corporation - initial API and implementation
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
10
###############################################################################
11
# the slot 107 has been removed. So it is open again for another message
11
# the slot 107 has been removed. So it is open again for another message
12
# remove messages for 24, 25, 28, 30, 31, 38, 42,
12
# remove messages for 25, 28, 30, 31, 38, 42,
13
# 45, 46, 47, 48, 49, 50, 51, 52, 53, 57, 58, 59, 60, 62, 63, 65, 68, 70, 71, 74, 75, 80,
13
# 45, 46, 47, 48, 49, 50, 51, 52, 53, 57, 58, 59, 60, 62, 63, 65, 68, 70, 71, 74, 75, 80,
14
# 82, 83, 88, 90, 93, 05, 99, 103, 124
14
# 82, 83, 88, 90, 93, 05, 99, 103, 124
15
#api profile
15
#api profile
Lines 131-136 Link Here
131
#{0} = Javadoc tag name, {1} = java member (class, field, method, etc)
131
#{0} = Javadoc tag name, {1} = java member (class, field, method, etc)
132
112 = Tag ''{0}'' is unsupported on {1}
132
112 = Tag ''{0}'' is unsupported on {1}
133
22 = Tag ''{0}'' is already defined on this element
133
22 = Tag ''{0}'' is already defined on this element
134
24 = {2} illegally implements {1} via {0}
134
106 = The type argument {1} has been added for {0}
135
106 = The type argument {1} has been added for {0}
135
107 = The type argument {1} has been removed for {0}
136
107 = The type argument {1} has been removed for {0}
136
131 = The superclass hierarchy for {0} has been reduced
137
131 = The superclass hierarchy for {0} has been reduced
(-)src/org/eclipse/pde/api/tools/internal/problems/ApiProblemFactory.java (-1 / +7 lines)
Lines 380-386 Link Here
380
			}
380
			}
381
			case IApiProblem.CATEGORY_USAGE: {
381
			case IApiProblem.CATEGORY_USAGE: {
382
				switch(kind) {
382
				switch(kind) {
383
					case IApiProblem.ILLEGAL_IMPLEMENT: return 8;
383
					case IApiProblem.ILLEGAL_IMPLEMENT: {
384
						switch(flags) {
385
							case IApiProblem.NO_FLAGS: return 8;
386
							case IApiProblem.INDIRECT_REFERENCE: return 24;
387
						}
388
						break;
389
					}
384
					case IApiProblem.ILLEGAL_EXTEND: return 9;
390
					case IApiProblem.ILLEGAL_EXTEND: return 9;
385
					case IApiProblem.ILLEGAL_INSTANTIATE: return 10;
391
					case IApiProblem.ILLEGAL_INSTANTIATE: return 10;
386
					case IApiProblem.ILLEGAL_OVERRIDE: return 11;
392
					case IApiProblem.ILLEGAL_OVERRIDE: return 11;
(-)src/org/eclipse/pde/api/tools/internal/util/Util.java (+3 lines)
Lines 1324-1329 Link Here
1324
					case IApiProblem.NO_FLAGS: {
1324
					case IApiProblem.NO_FLAGS: {
1325
						return "NO_FLAGS"; //$NON-NLS-1$
1325
						return "NO_FLAGS"; //$NON-NLS-1$
1326
					}
1326
					}
1327
					case IApiProblem.INDIRECT_REFERENCE: {
1328
						return "INDIRECT_REFERENCE"; //$NON-NLS-1$
1329
					}
1327
				}
1330
				}
1328
			}
1331
			}
1329
		}
1332
		}
(-)src/org/eclipse/pde/api/tools/internal/provisional/scanner/ApiDescriptionProcessor.java (-6 / +6 lines)
Lines 336-342 Link Here
336
				case IApiJavadocTag.MEMBER_FIELD :
336
				case IApiJavadocTag.MEMBER_FIELD :
337
					if(RestrictionModifiers.isReferenceRestriction(res)) {
337
					if(RestrictionModifiers.isReferenceRestriction(res)) {
338
						if(!containsRestrictionTag(tags, "@noreference")) { //$NON-NLS-1$
338
						if(!containsRestrictionTag(tags, "@noreference")) { //$NON-NLS-1$
339
							IApiJavadocTag tag = jtm.getTag("org.eclipse.pde.api.tools.noreference"); //$NON-NLS-1$
339
							IApiJavadocTag tag = jtm.getTag(IApiJavadocTag.NO_REFERENCE_TAG_ID);
340
							missing.add(tag.getCompleteTag(type, member));
340
							missing.add(tag.getCompleteTag(type, member));
341
						}
341
						}
342
					}
342
					}
Lines 344-356 Link Here
344
				case IApiJavadocTag.MEMBER_METHOD :
344
				case IApiJavadocTag.MEMBER_METHOD :
345
					if(RestrictionModifiers.isReferenceRestriction(res)) {
345
					if(RestrictionModifiers.isReferenceRestriction(res)) {
346
						if(!containsRestrictionTag(tags, "@noreference")) { //$NON-NLS-1$
346
						if(!containsRestrictionTag(tags, "@noreference")) { //$NON-NLS-1$
347
							IApiJavadocTag tag = jtm.getTag("org.eclipse.pde.api.tools.noreference"); //$NON-NLS-1$
347
							IApiJavadocTag tag = jtm.getTag(IApiJavadocTag.NO_REFERENCE_TAG_ID);
348
							missing.add(tag.getCompleteTag(type, member));
348
							missing.add(tag.getCompleteTag(type, member));
349
						}
349
						}
350
					}
350
					}
351
					if(RestrictionModifiers.isOverrideRestriction(res)) {
351
					if(RestrictionModifiers.isOverrideRestriction(res)) {
352
						if(!containsRestrictionTag(tags, "@nooverride")) { //$NON-NLS-1$
352
						if(!containsRestrictionTag(tags, "@nooverride")) { //$NON-NLS-1$
353
							IApiJavadocTag tag = jtm.getTag("org.eclipse.pde.api.tools.nooverride"); //$NON-NLS-1$
353
							IApiJavadocTag tag = jtm.getTag(IApiJavadocTag.NO_OVERRIDE_TAG_ID);
354
							missing.add(tag.getCompleteTag(type, member));
354
							missing.add(tag.getCompleteTag(type, member));
355
						}
355
						}
356
					}
356
					}
Lines 358-376 Link Here
358
				case IApiJavadocTag.MEMBER_NONE :
358
				case IApiJavadocTag.MEMBER_NONE :
359
					if(RestrictionModifiers.isImplementRestriction(res)) {
359
					if(RestrictionModifiers.isImplementRestriction(res)) {
360
						if(!containsRestrictionTag(tags, "@noimplement")) { //$NON-NLS-1$
360
						if(!containsRestrictionTag(tags, "@noimplement")) { //$NON-NLS-1$
361
							IApiJavadocTag tag = jtm.getTag("org.eclipse.pde.api.tools.noimplement"); //$NON-NLS-1$
361
							IApiJavadocTag tag = jtm.getTag(IApiJavadocTag.NO_IMPLEMENT_TAG_ID);
362
							missing.add(tag.getCompleteTag(type, member));
362
							missing.add(tag.getCompleteTag(type, member));
363
						}
363
						}
364
					}
364
					}
365
					if(RestrictionModifiers.isInstantiateRestriction(res)) {
365
					if(RestrictionModifiers.isInstantiateRestriction(res)) {
366
						if(!containsRestrictionTag(tags, "@noinstantiate")) { //$NON-NLS-1$
366
						if(!containsRestrictionTag(tags, "@noinstantiate")) { //$NON-NLS-1$
367
							IApiJavadocTag tag = jtm.getTag("org.eclipse.pde.api.tools.noinstantiate"); //$NON-NLS-1$
367
							IApiJavadocTag tag = jtm.getTag(IApiJavadocTag.NO_INSTANTIATE_TAG_ID);
368
							missing.add(tag.getCompleteTag(type, member));
368
							missing.add(tag.getCompleteTag(type, member));
369
						}
369
						}
370
					}
370
					}
371
					if(RestrictionModifiers.isExtendRestriction(res)) {
371
					if(RestrictionModifiers.isExtendRestriction(res)) {
372
						if(!containsRestrictionTag(tags, "@noextend")) { //$NON-NLS-1$
372
						if(!containsRestrictionTag(tags, "@noextend")) { //$NON-NLS-1$
373
							IApiJavadocTag tag = jtm.getTag("org.eclipse.pde.api.tools.noextend"); //$NON-NLS-1$
373
							IApiJavadocTag tag = jtm.getTag(IApiJavadocTag.NO_EXTEND_TAG_ID);
374
							missing.add(tag.getCompleteTag(type, member));
374
							missing.add(tag.getCompleteTag(type, member));
375
						}
375
						}
376
					}
376
					}
(-)src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java (-2 / +2 lines)
Lines 997-1004 Link Here
997
						// adding/removing no extend on a final class is ok
997
						// adding/removing no extend on a final class is ok
998
						// adding/removing no instantiate on an abstract class is ok
998
						// adding/removing no instantiate on an abstract class is ok
999
						if (this.type1.isInterface()) {
999
						if (this.type1.isInterface()) {
1000
							if (RestrictionModifiers.isImplementRestriction(restrictions2)
1000
							if ((RestrictionModifiers.isImplementRestriction(restrictions2) && !RestrictionModifiers.isImplementRestriction(restrictions)) ||
1001
									&& !RestrictionModifiers.isImplementRestriction(restrictions)) {
1001
								(RestrictionModifiers.isExtendRestriction(restrictions2) && !RestrictionModifiers.isExtendRestriction(restrictions))) {
1002
							this.addDelta(
1002
							this.addDelta(
1003
									getElementType(this.type1),
1003
									getElementType(this.type1),
1004
									IDelta.ADDED,
1004
									IDelta.ADDED,
(-)src/org/eclipse/pde/api/tools/internal/provisional/problems/IApiProblem.java (+9 lines)
Lines 319-324 Link Here
319
	 * @see #getFlags()
319
	 * @see #getFlags()
320
	 */
320
	 */
321
	public static final int FIELD = 9;
321
	public static final int FIELD = 9;
322
	
323
	/**
324
	 * Flags to indicate an indirect reference
325
	 * <br>
326
	 * Value is: <code>10</code>
327
	 * 
328
	 * @see #getFlags()
329
	 */
330
	public static final int INDIRECT_REFERENCE = 10;
322
331
323
	/**
332
	/**
324
	 * Constant representing the value of a default API profile {@link IApiProblem} kind.
333
	 * Constant representing the value of a default API profile {@link IApiProblem} kind.
(-)src/org/eclipse/pde/api/tools/internal/ApiAnnotations.java (-20 / +2 lines)
Lines 11-18 Link Here
11
package org.eclipse.pde.api.tools.internal;
11
package org.eclipse.pde.api.tools.internal;
12
12
13
import org.eclipse.pde.api.tools.internal.provisional.IApiAnnotations;
13
import org.eclipse.pde.api.tools.internal.provisional.IApiAnnotations;
14
import org.eclipse.pde.api.tools.internal.provisional.RestrictionModifiers;
15
import org.eclipse.pde.api.tools.internal.provisional.VisibilityModifiers;
14
import org.eclipse.pde.api.tools.internal.provisional.VisibilityModifiers;
15
import org.eclipse.pde.api.tools.internal.util.Util;
16
16
17
/**
17
/**
18
 * Base implementation of the {@linkplain IApiAnnotations} interface
18
 * Base implementation of the {@linkplain IApiAnnotations} interface
Lines 107-131 Link Here
107
		buffer.append(visibility);
107
		buffer.append(visibility);
108
		buffer.append(" / "); //$NON-NLS-1$
108
		buffer.append(" / "); //$NON-NLS-1$
109
		int restrictions = getRestrictions();
109
		int restrictions = getRestrictions();
110
		if (restrictions == RestrictionModifiers.NO_RESTRICTIONS) {
110
		buffer.append(Util.getRestrictionKind(restrictions));
111
			buffer.append("<no restrictions>"); //$NON-NLS-1$
112
		} else {
113
			if (RestrictionModifiers.isExtendRestriction(restrictions)) {
114
				buffer.append("@noextend "); //$NON-NLS-1$
115
			}
116
			if (RestrictionModifiers.isImplementRestriction(restrictions)) {
117
				buffer.append("@noimplement "); //$NON-NLS-1$
118
			}
119
			if (RestrictionModifiers.isInstantiateRestriction(restrictions)) {
120
				buffer.append("@noinstantiate "); //$NON-NLS-1$
121
			}
122
			if (RestrictionModifiers.isReferenceRestriction(restrictions)) {
123
				buffer.append("@noreference "); //$NON-NLS-1$
124
			}
125
			if(RestrictionModifiers.isOverrideRestriction(restrictions)) {
126
				buffer.append("@nooverride"); //$NON-NLS-1$
127
			}
128
		}
129
		return buffer.toString();
111
		return buffer.toString();
130
	}
112
	}
131
113
(-)src/org/eclipse/pde/api/tools/internal/JavadocTagManager.java (-2 / +2 lines)
Lines 68-77 Link Here
68
			newtag.setApplicableTo(IApiJavadocTag.TYPE_CLASS, 
68
			newtag.setApplicableTo(IApiJavadocTag.TYPE_CLASS, 
69
					IApiJavadocTag.MEMBER_NONE, 
69
					IApiJavadocTag.MEMBER_NONE, 
70
					"This class is not intended to be subclassed by clients.");  //$NON-NLS-1$
70
					"This class is not intended to be subclassed by clients.");  //$NON-NLS-1$
71
			/*newtag.setApplicableTo(IApiJavadocTag.TYPE_INTERFACE, 
71
			newtag.setApplicableTo(IApiJavadocTag.TYPE_INTERFACE, 
72
					IApiJavadocTag.MEMBER_NONE, 
72
					IApiJavadocTag.MEMBER_NONE, 
73
					"This interface is not intended to be extended by clients.");  //$NON-NLS-1$
73
					"This interface is not intended to be extended by clients.");  //$NON-NLS-1$
74
*/			tagcache.put(newtag.getTagId(), newtag);
74
			tagcache.put(newtag.getTagId(), newtag);
75
			list.add(newtag);
75
			list.add(newtag);
76
			
76
			
77
			//nooverride tag
77
			//nooverride tag
(-)src/org/eclipse/pde/api/tools/internal/provisional/comparator/DeltaProcessor.java (-2 / +4 lines)
Lines 136-142 Link Here
136
				switch(delta.getFlags()) {
136
				switch(delta.getFlags()) {
137
					case IDelta.FIELD :
137
					case IDelta.FIELD :
138
					case IDelta.METHOD :
138
					case IDelta.METHOD :
139
						return RestrictionModifiers.isImplementRestriction(delta.getRestrictions());
139
						return RestrictionModifiers.isImplementRestriction(delta.getRestrictions()) &&
140
							   RestrictionModifiers.isExtendRestriction(delta.getRestrictions());
140
					case IDelta.TYPE_PARAMETER :
141
					case IDelta.TYPE_PARAMETER :
141
					case IDelta.METHOD_WITHOUT_DEFAULT_VALUE :
142
					case IDelta.METHOD_WITHOUT_DEFAULT_VALUE :
142
						return false;
143
						return false;
Lines 470-476 Link Here
470
					case IDelta.FIELD :
471
					case IDelta.FIELD :
471
					case IDelta.METHOD :
472
					case IDelta.METHOD :
472
					case IDelta.SUPER_INTERFACE_WITH_METHODS :
473
					case IDelta.SUPER_INTERFACE_WITH_METHODS :
473
						return RestrictionModifiers.isImplementRestriction(delta.getRestrictions());
474
						return RestrictionModifiers.isImplementRestriction(delta.getRestrictions()) &&
475
						       RestrictionModifiers.isExtendRestriction(delta.getRestrictions());
474
					case IDelta.TYPE_PARAMETER :
476
					case IDelta.TYPE_PARAMETER :
475
						return false;
477
						return false;
476
					case IDelta.RESTRICTIONS :
478
					case IDelta.RESTRICTIONS :
(-)src/org/eclipse/pde/api/tools/internal/search/AbstractIllegalTypeReference.java (+9 lines)
Lines 63-68 Link Here
63
		return false;
63
		return false;
64
	}	
64
	}	
65
	
65
	
66
	/**
67
	 * Returns if the mapping contains the referenced type name
68
	 * @param reference
69
	 * @return true of the mapping contains the key false otherwise
70
	 */
71
	protected boolean isIllegalType(IReference reference) {
72
		return fIllegalTypes.containsKey(reference.getReferencedTypeName());
73
	}
74
	
66
	/* (non-Javadoc)
75
	/* (non-Javadoc)
67
	 * @see org.eclipse.pde.api.tools.internal.search.AbstractProblemDetector#isProblem(org.eclipse.pde.api.tools.internal.provisional.model.IReference)
76
	 * @see org.eclipse.pde.api.tools.internal.search.AbstractProblemDetector#isProblem(org.eclipse.pde.api.tools.internal.provisional.model.IReference)
68
	 */
77
	 */
(-)src/org/eclipse/pde/api/tools/internal/search/IllegalImplementsProblemDetector.java (-1 / +140 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.pde.api.tools.internal.search;
11
package org.eclipse.pde.api.tools.internal.search;
12
12
13
import java.util.HashMap;
14
15
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.pde.api.tools.internal.provisional.ApiPlugin;
17
import org.eclipse.pde.api.tools.internal.provisional.Factory;
18
import org.eclipse.pde.api.tools.internal.provisional.IApiAnnotations;
19
import org.eclipse.pde.api.tools.internal.provisional.IApiComponent;
20
import org.eclipse.pde.api.tools.internal.provisional.RestrictionModifiers;
21
import org.eclipse.pde.api.tools.internal.provisional.model.IApiElement;
22
import org.eclipse.pde.api.tools.internal.provisional.model.IApiMember;
23
import org.eclipse.pde.api.tools.internal.provisional.model.IApiType;
24
import org.eclipse.pde.api.tools.internal.provisional.model.IReference;
13
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblem;
25
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblem;
14
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblemTypes;
26
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblemTypes;
15
import org.eclipse.pde.api.tools.internal.provisional.search.ReferenceModifiers;
27
import org.eclipse.pde.api.tools.internal.provisional.search.ReferenceModifiers;
Lines 21-31 Link Here
21
 */
33
 */
22
public class IllegalImplementsProblemDetector extends AbstractIllegalTypeReference {
34
public class IllegalImplementsProblemDetector extends AbstractIllegalTypeReference {
23
35
36
	/**
37
	 * Map of directly implemented interfaces to implement restricted super-interfaces
38
	 */
39
	private HashMap fRestrictedInterfaces = new HashMap();
40
	
24
	/* (non-Javadoc)
41
	/* (non-Javadoc)
25
	 * @see org.eclipse.pde.api.tools.internal.provisional.search.IApiProblemDetector#getReferenceKinds()
42
	 * @see org.eclipse.pde.api.tools.internal.provisional.search.IApiProblemDetector#getReferenceKinds()
26
	 */
43
	 */
27
	public int getReferenceKinds() {
44
	public int getReferenceKinds() {
28
		return ReferenceModifiers.REF_EXTENDS | ReferenceModifiers.REF_IMPLEMENTS;
45
		return ReferenceModifiers.REF_IMPLEMENTS;
29
	}
46
	}
30
47
31
	/* (non-Javadoc)
48
	/* (non-Javadoc)
Lines 41-44 Link Here
41
	protected String getSeverityKey() {
58
	protected String getSeverityKey() {
42
		return IApiProblemTypes.ILLEGAL_IMPLEMENT;
59
		return IApiProblemTypes.ILLEGAL_IMPLEMENT;
43
	}	
60
	}	
61
	
62
	/* (non-Javadoc)
63
	 * @see org.eclipse.pde.api.tools.internal.search.AbstractIllegalTypeReference#considerReference(org.eclipse.pde.api.tools.internal.provisional.model.IReference)
64
	 */
65
	public boolean considerReference(IReference reference) {
66
		try {
67
			if(isIllegalType(reference)) {
68
				retainReference(reference);
69
				return true;
70
			}
71
			IApiType type = (IApiType) reference.getMember();
72
			IApiType[] inters = type.getSuperInterfaces();
73
			IApiType inter = null;
74
			for (int j = 0; j < inters.length; j++) {
75
				if(inters[j].getName().equals(reference.getReferencedTypeName())) {
76
					inter = inters[j];
77
					break;
78
				}
79
			}
80
			if(inter != null && findRestrictedSuperinterfaces(reference.getReferencedTypeName(), inter)) {
81
				retainReference(reference);
82
				return true;
83
			}
84
		}
85
		catch(CoreException ce) {
86
			ApiPlugin.log(ce);
87
		}
88
		return super.considerReference(reference);
89
	}
90
	
91
	/* (non-Javadoc)
92
	 * @see org.eclipse.pde.api.tools.internal.search.AbstractIllegalTypeReference#isProblem(org.eclipse.pde.api.tools.internal.provisional.model.IReference)
93
	 */
94
	protected boolean isProblem(IReference reference) {
95
		try {
96
			if(isIllegalType(reference)) {
97
				return super.isProblem(reference);
98
			}
99
			if(fRestrictedInterfaces.size() > 0) {
100
				IApiMember member = reference.getMember();
101
				if(member.getType() == IApiElement.TYPE) {
102
					IApiType itype = (IApiType) fRestrictedInterfaces.get(reference.getReferencedTypeName());
103
					return itype != null && !isImplemented(((IApiType) member).getSuperclass(), itype.getName());
104
				}
105
			}
106
			return true;
107
		}
108
		catch(CoreException ce) {
109
			ApiPlugin.log(ce);
110
		}
111
		return super.isProblem(reference);
112
	}
113
	/* (non-Javadoc)
114
	 * @see org.eclipse.pde.api.tools.internal.search.AbstractIllegalTypeReference#getMessageArgs(org.eclipse.pde.api.tools.internal.provisional.model.IReference)
115
	 */
116
	protected String[] getMessageArgs(IReference reference) throws CoreException {
117
		if(isIllegalType(reference)) {
118
			return super.getMessageArgs(reference);
119
		}
120
		if(fRestrictedInterfaces.size() > 0) {
121
			IApiType type = (IApiType) reference.getResolvedReference();
122
			IApiType inter = (IApiType) fRestrictedInterfaces.get(type.getName());
123
			if(inter != null) {
124
				return new String[] {getSimpleTypeName(type), inter.getSimpleName(), getSimpleTypeName(reference.getMember())};
125
			}
126
		}
127
		return super.getMessageArgs(reference);
128
	}
129
	
130
	/* (non-Javadoc)
131
	 * @see org.eclipse.pde.api.tools.internal.search.AbstractIllegalTypeReference#getProblemFlags(org.eclipse.pde.api.tools.internal.provisional.model.IReference)
132
	 */
133
	protected int getProblemFlags(IReference reference) {
134
		if(isIllegalType(reference)) {
135
			return super.getProblemFlags(reference);
136
		}
137
		return IApiProblem.INDIRECT_REFERENCE;
138
	}
139
140
	/**
141
	 * Returns if the given type implements any of the given interfaces anywhere in its lineage
142
	 * @param type
143
	 * @param iname
144
	 * @return true if all of the interfaces are implemented, false otherwise
145
	 * @throws CoreException
146
	 */
147
	private boolean isImplemented(IApiType type, final String iname) throws CoreException {
148
		if(type == null) {
149
			return false;
150
		}
151
		IApiType[] sinters = type.getSuperInterfaces();
152
		for (int i = 0; i < sinters.length; i++) {
153
			if(sinters[i].getName().equals(iname)) {
154
				return true;
155
			}
156
		}
157
		return isImplemented(type.getSuperclass(), iname);
158
	}
159
	
160
	/**
161
	 * Finds all of the implements restricted interfaces in the hierarchy of this given type
162
	 * @param entryinterface
163
	 * @param type
164
	 * @throws CoreException
165
	 */
166
	private boolean findRestrictedSuperinterfaces(final String entryinterface, IApiType type) throws CoreException {
167
		IApiType[] inters = type.getSuperInterfaces();
168
		IApiAnnotations annot = null;
169
		IApiComponent comp = null;
170
		for (int i = 0; i < inters.length; i++) {
171
			comp = inters[i].getApiComponent();
172
			if(comp == null) {
173
				continue;
174
			}
175
			annot = comp.getApiDescription().resolveAnnotations(Factory.typeDescriptor(inters[i].getName()));
176
			if(annot != null && RestrictionModifiers.isImplementRestriction(annot.getRestrictions())) {
177
				return fRestrictedInterfaces.put(entryinterface, inters[i]) == null;
178
			}
179
			return findRestrictedSuperinterfaces( entryinterface, inters[i]);
180
		}
181
		return false;
182
	}
44
}
183
}
(-)src/org/eclipse/pde/api/tools/internal/model/ApiType.java (-1 / +1 lines)
Lines 215-221 Link Here
215
	public IApiType[] getSuperInterfaces() throws CoreException {
215
	public IApiType[] getSuperInterfaces() throws CoreException {
216
		String[] names = getSuperInterfaceNames();
216
		String[] names = getSuperInterfaceNames();
217
		if (names == null) {
217
		if (names == null) {
218
			return null;
218
			return EMPTY_TYPES;
219
		}
219
		}
220
		if (fSuperInterfaces == null) {
220
		if (fSuperInterfaces == null) {
221
			IApiType[] interfaces = new IApiType[names.length];
221
			IApiType[] interfaces = new IApiType[names.length];

Return to bug 230189