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

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/SelectionRequestor.java (+22 lines)
Lines 211-216 Link Here
211
	}
211
	}
212
}
212
}
213
/**
213
/**
214
 * Resolve the type.
215
 */
216
public void acceptType(IType type) {
217
	String key = type.getKey();
218
	if(type.isBinary()) {
219
		ResolvedBinaryType resolvedType = new ResolvedBinaryType((JavaElement)type.getParent(), type.getElementName(), key);
220
		resolvedType.occurrenceCount = type.getOccurrenceCount();
221
		type = resolvedType;
222
	} else {
223
		ResolvedSourceType resolvedType = new ResolvedSourceType((JavaElement)type.getParent(), type.getElementName(), key);
224
		resolvedType.occurrenceCount = type.getOccurrenceCount();
225
		type = resolvedType;
226
	}
227
228
	addElement(type);
229
	if(SelectionEngine.DEBUG){
230
		System.out.print("SELECTION - accept type("); //$NON-NLS-1$
231
		System.out.print(type.toString());
232
		System.out.println(")"); //$NON-NLS-1$
233
	}
234
}
235
/**
214
 * @see ISelectionRequestor#acceptError
236
 * @see ISelectionRequestor#acceptError
215
 */
237
 */
216
public void acceptError(CategorizedProblem error) {
238
public void acceptError(CategorizedProblem error) {
(-)model/org/eclipse/jdt/internal/core/Openable.java (-1 / +1 lines)
Lines 157-163 Link Here
157
	}
157
	}
158
158
159
	// fix for 1FVXGDK
159
	// fix for 1FVXGDK
160
	SelectionEngine engine = new SelectionEngine(environment, requestor, project.getOptions(true));
160
	SelectionEngine engine = new SelectionEngine(environment, requestor, project.getOptions(true), owner);
161
	engine.select(cu, offset, offset + length - 1);
161
	engine.select(cu, offset, offset + length - 1);
162
162
163
	if(performanceStats != null) {
163
	if(performanceStats != null) {
(-)model/org/eclipse/jdt/internal/core/NamedMember.java (-1 / +1 lines)
Lines 287-293 Link Here
287
		}
287
		}
288
		TypeResolveRequestor requestor = new TypeResolveRequestor();
288
		TypeResolveRequestor requestor = new TypeResolveRequestor();
289
		SelectionEngine engine =
289
		SelectionEngine engine =
290
			new SelectionEngine(environment, requestor, project.getOptions(true));
290
			new SelectionEngine(environment, requestor, project.getOptions(true), owner);
291
291
292
		engine.selectType(typeName.toCharArray(), (IType) this);
292
		engine.selectType(typeName.toCharArray(), (IType) this);
293
		if (NameLookup.VERBOSE) {
293
		if (NameLookup.VERBOSE) {
(-)model/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.java (-1 / +2 lines)
Lines 132-138 Link Here
132
		offset + length - 1,
132
		offset + length - 1,
133
		environment,
133
		environment,
134
		requestor,
134
		requestor,
135
		this.project.getOptions(true)
135
		this.project.getOptions(true),
136
		owner
136
	);
137
	);
137
	return requestor.getElements();
138
	return requestor.getElements();
138
}
139
}
(-)codeassist/org/eclipse/jdt/internal/codeassist/SelectionEngine.java (-1 / +206 lines)
Lines 14-24 Link Here
14
import java.util.Map;
14
import java.util.Map;
15
15
16
import org.eclipse.core.resources.IFile;
16
import org.eclipse.core.resources.IFile;
17
import org.eclipse.core.runtime.IProgressMonitor;
18
import org.eclipse.core.runtime.OperationCanceledException;
17
import org.eclipse.jdt.core.IType;
19
import org.eclipse.jdt.core.IType;
18
import org.eclipse.jdt.core.JavaModelException;
20
import org.eclipse.jdt.core.JavaModelException;
19
import org.eclipse.jdt.core.Signature;
21
import org.eclipse.jdt.core.Signature;
22
import org.eclipse.jdt.core.WorkingCopyOwner;
20
import org.eclipse.jdt.core.compiler.*;
23
import org.eclipse.jdt.core.compiler.*;
21
import org.eclipse.jdt.core.search.IJavaSearchConstants;
24
import org.eclipse.jdt.core.search.IJavaSearchConstants;
25
import org.eclipse.jdt.core.search.IJavaSearchScope;
26
import org.eclipse.jdt.core.search.SearchPattern;
27
import org.eclipse.jdt.core.search.TypeNameMatch;
28
import org.eclipse.jdt.core.search.TypeNameMatchRequestor;
22
import org.eclipse.jdt.internal.codeassist.impl.*;
29
import org.eclipse.jdt.internal.codeassist.impl.*;
23
import org.eclipse.jdt.internal.codeassist.select.*;
30
import org.eclipse.jdt.internal.codeassist.select.*;
24
import org.eclipse.jdt.internal.compiler.*;
31
import org.eclipse.jdt.internal.compiler.*;
Lines 29-40 Link Here
29
import org.eclipse.jdt.internal.compiler.lookup.*;
36
import org.eclipse.jdt.internal.compiler.lookup.*;
30
import org.eclipse.jdt.internal.compiler.parser.*;
37
import org.eclipse.jdt.internal.compiler.parser.*;
31
import org.eclipse.jdt.internal.compiler.problem.*;
38
import org.eclipse.jdt.internal.compiler.problem.*;
39
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;
40
import org.eclipse.jdt.internal.compiler.util.ObjectVector;
32
import org.eclipse.jdt.internal.core.BinaryTypeConverter;
41
import org.eclipse.jdt.internal.core.BinaryTypeConverter;
33
import org.eclipse.jdt.internal.core.ClassFile;
42
import org.eclipse.jdt.internal.core.ClassFile;
43
import org.eclipse.jdt.internal.core.JavaModelManager;
34
import org.eclipse.jdt.internal.core.SearchableEnvironment;
44
import org.eclipse.jdt.internal.core.SearchableEnvironment;
35
import org.eclipse.jdt.internal.core.SelectionRequestor;
45
import org.eclipse.jdt.internal.core.SelectionRequestor;
36
import org.eclipse.jdt.internal.core.SourceType;
46
import org.eclipse.jdt.internal.core.SourceType;
37
import org.eclipse.jdt.internal.core.SourceTypeElementInfo;
47
import org.eclipse.jdt.internal.core.SourceTypeElementInfo;
48
import org.eclipse.jdt.internal.core.search.BasicSearchEngine;
49
import org.eclipse.jdt.internal.core.search.TypeNameMatchRequestorWrapper;
38
import org.eclipse.jdt.internal.core.util.ASTNodeFinder;
50
import org.eclipse.jdt.internal.core.util.ASTNodeFinder;
39
import org.eclipse.jdt.internal.core.util.HashSetOfCharArrayArray;
51
import org.eclipse.jdt.internal.core.util.HashSetOfCharArrayArray;
40
52
Lines 48-59 Link Here
48
 * performed instead.
60
 * performed instead.
49
 */
61
 */
50
public final class SelectionEngine extends Engine implements ISearchRequestor {
62
public final class SelectionEngine extends Engine implements ISearchRequestor {
63
	
64
	private class SelectionTypeNameMatchRequestorWrapper extends TypeNameMatchRequestorWrapper {
65
		
66
		class AcceptedType {
67
			public int modifiers;
68
			public char[] packageName;
69
			public char[] simpleTypeName;
70
			public String path;
71
			public AccessRestriction access;
72
			
73
			public AcceptedType(int modifiers, char[] packageName, char[] simpleTypeName, String path, AccessRestriction access) {
74
				this.modifiers = modifiers;
75
				this.packageName = packageName;
76
				this.simpleTypeName = simpleTypeName;
77
				this.path = path;
78
				this.access = access;
79
			}
80
		}
81
		
82
		private ImportReference[] importReferences;
83
		
84
		private boolean importCachesNodeInitialized = false;
85
		private ImportReference[] onDemandImportsNodeCache;
86
		private int onDemandImportsNodeCacheCount;
87
		private char[][][] importsNodeCache;
88
		private int importsNodeCacheCount;
89
		
90
		private HashtableOfObject onDemandFound = new HashtableOfObject();
91
		private ObjectVector notImportedFound = new ObjectVector();
92
		
93
		public SelectionTypeNameMatchRequestorWrapper(TypeNameMatchRequestor requestor, IJavaSearchScope scope, ImportReference[] importReferences) {
94
			super(requestor, scope);
95
			this.importReferences = importReferences;
96
		}
97
		
98
		public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) {
99
			if (enclosingTypeNames != null && enclosingTypeNames.length > 0) return;
100
			
101
			if (!this.importCachesNodeInitialized) initializeImportNodeCaches();
102
			
103
			char[] fullyQualifiedTypeName = CharOperation.concat(packageName, simpleTypeName, '.');
104
			
105
			for (int i = 0; i < this.importsNodeCacheCount; i++) {
106
				char[][] importName = this.importsNodeCache[i];
107
				if (CharOperation.equals(importName[0], simpleTypeName)) {
108
					
109
					if(CharOperation.equals(importName[1], fullyQualifiedTypeName)) {
110
						super.acceptType(modifiers, packageName, simpleTypeName, enclosingTypeNames, path, access);
111
					}
112
					return;
113
				}
114
			}
115
			
116
			for (int i = 0; i < this.onDemandImportsNodeCacheCount; i++) {
117
				char[][] importName = this.onDemandImportsNodeCache[i].tokens;
118
				char[] importFlatName = CharOperation.concatWith(importName, '.');
119
				
120
				if (CharOperation.equals(importFlatName, packageName)) {
121
					
122
					this.onDemandFound.put(simpleTypeName, simpleTypeName);
123
					super.acceptType(modifiers, packageName, simpleTypeName, enclosingTypeNames, path, access);
124
					return;
125
				}
126
			}
127
			
128
			
129
			this.notImportedFound.add(new AcceptedType(modifiers, packageName, simpleTypeName, path, access));
130
		}
131
		
132
		public void acceptNotImported() {
133
			int size = this.notImportedFound.size();
134
			for (int i = 0; i < size; i++) {
135
				AcceptedType acceptedType = (AcceptedType)this.notImportedFound.elementAt(i);
136
				
137
				if (this.onDemandFound.get(acceptedType.simpleTypeName) == null) {
138
					super.acceptType(
139
							acceptedType.modifiers,
140
							acceptedType.packageName,
141
							acceptedType.simpleTypeName,
142
							null,
143
							acceptedType.path,
144
							acceptedType.access);
145
				}
146
			}
147
		}
148
		
149
		public void initializeImportNodeCaches() {
150
			int length = this.importReferences == null ? 0 : this.importReferences.length;
151
			
152
			for (int i = 0; i < length; i++) {
153
				ImportReference importReference = this.importReferences[i];
154
				if((importReference.bits & ASTNode.OnDemand) != 0) {
155
					if(this.onDemandImportsNodeCache == null) {
156
						this.onDemandImportsNodeCache = new ImportReference[length - i];
157
					}
158
					this.onDemandImportsNodeCache[this.onDemandImportsNodeCacheCount++] =
159
						importReference;
160
				} else {
161
					if(this.importsNodeCache == null) {
162
						this.importsNodeCache = new char[length - i][][];
163
					}
164
					
165
					
166
					this.importsNodeCache[this.importsNodeCacheCount++] = new char[][]{
167
							importReference.tokens[importReference.tokens.length - 1],
168
							CharOperation.concatWith(importReference.tokens, '.')
169
						};
170
				}
171
			}
172
			
173
			this.importCachesNodeInitialized = true;
174
		}
175
	}
51
176
52
	public static boolean DEBUG = false;
177
	public static boolean DEBUG = false;
53
	public static boolean PERF = false;
178
	public static boolean PERF = false;
54
179
55
	SelectionParser parser;
180
	SelectionParser parser;
56
	ISelectionRequestor requestor;
181
	ISelectionRequestor requestor;
182
	WorkingCopyOwner owner;
57
183
58
	boolean acceptedAnswer;
184
	boolean acceptedAnswer;
59
185
Lines 97-103 Link Here
97
	public SelectionEngine(
223
	public SelectionEngine(
98
		SearchableEnvironment nameEnvironment,
224
		SearchableEnvironment nameEnvironment,
99
		ISelectionRequestor requestor,
225
		ISelectionRequestor requestor,
100
		Map settings) {
226
		Map settings,
227
		WorkingCopyOwner owner) {
101
228
102
		super(settings);
229
		super(settings);
103
230
Lines 140-145 Link Here
140
		this.lookupEnvironment =
267
		this.lookupEnvironment =
141
			new LookupEnvironment(this, this.compilerOptions, problemReporter, nameEnvironment);
268
			new LookupEnvironment(this, this.compilerOptions, problemReporter, nameEnvironment);
142
		this.parser = new SelectionParser(problemReporter);
269
		this.parser = new SelectionParser(problemReporter);
270
		this.owner = owner;
143
	}
271
	}
144
272
145
	public void acceptType(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, int modifiers, AccessRestriction accessRestriction) {
273
	public void acceptType(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, int modifiers, AccessRestriction accessRestriction) {
Lines 557-562 Link Here
557
685
558
		return false;
686
		return false;
559
	}
687
	}
688
	
689
	/*
690
	 * find all types outside the project scope
691
	 */
692
	private void findAllTypes(char[] prefix) {
693
		try {
694
			IProgressMonitor progressMonitor = new IProgressMonitor() {
695
				boolean isCanceled = false;
696
				public void beginTask(String name, int totalWork) {
697
					// implements interface method
698
				}
699
				public void done() {
700
					// implements interface method
701
				}
702
				public void internalWorked(double work) {
703
					// implements interface method
704
				}
705
				public boolean isCanceled() {
706
					return this.isCanceled;
707
				}
708
				public void setCanceled(boolean value) {
709
					this.isCanceled = value;
710
				}
711
				public void setTaskName(String name) {
712
					// implements interface method
713
				}
714
				public void subTask(String name) {
715
					// implements interface method
716
				}
717
				public void worked(int work) {
718
					// implements interface method
719
				}
720
			};
721
			
722
			TypeNameMatchRequestor typeNameMatchRequestor = new TypeNameMatchRequestor() {
723
				public void acceptTypeNameMatch(TypeNameMatch match) {
724
					if (SelectionEngine.this.requestor instanceof SelectionRequestor) {
725
						SelectionEngine.this.noProposal = false;
726
						((SelectionRequestor)SelectionEngine.this.requestor).acceptType(match.getType());
727
					}
728
				}
729
			};
730
			
731
			IJavaSearchScope scope = BasicSearchEngine.createWorkspaceScope();
732
			
733
			SelectionTypeNameMatchRequestorWrapper requestorWrapper = new SelectionTypeNameMatchRequestorWrapper(typeNameMatchRequestor, scope, this.unitScope.referenceContext.imports);
734
			
735
			org.eclipse.jdt.core.ICompilationUnit[] workingCopies = this.owner == null ? null : JavaModelManager.getJavaModelManager().getWorkingCopies(this.owner, true/*add primary WCs*/);
736
			
737
			try {
738
				new BasicSearchEngine(workingCopies).searchAllTypeNames(
739
					null,
740
					SearchPattern.R_EXACT_MATCH,
741
					CharOperation.toLowerCase(prefix),
742
					SearchPattern.R_EXACT_MATCH,
743
					IJavaSearchConstants.TYPE,
744
					scope,
745
					requestorWrapper,
746
					IJavaSearchConstants.CANCEL_IF_NOT_READY_TO_SEARCH,
747
					progressMonitor);
748
			} catch (OperationCanceledException e) {
749
				// do nothing
750
			}
751
			requestorWrapper.acceptNotImported();
752
		} catch (JavaModelException e) {
753
			// do nothing
754
		}
755
	}
560
756
561
	public AssistParser getParser() {
757
	public AssistParser getParser() {
562
		return this.parser;
758
		return this.parser;
Lines 688-694 Link Here
688
					if ((this.unitScope = parsedUnit.scope)  != null) {
884
					if ((this.unitScope = parsedUnit.scope)  != null) {
689
						try {
885
						try {
690
							this.lookupEnvironment.completeTypeBindings(parsedUnit, true);
886
							this.lookupEnvironment.completeTypeBindings(parsedUnit, true);
887
							
888
							CompilationUnitDeclaration previousUnitBeingCompleted = this.lookupEnvironment.unitBeingCompleted;
889
							this.lookupEnvironment.unitBeingCompleted = parsedUnit;
691
							parsedUnit.scope.faultInTypes();
890
							parsedUnit.scope.faultInTypes();
891
							this.lookupEnvironment.unitBeingCompleted = previousUnitBeingCompleted;
692
							ASTNode node = null;
892
							ASTNode node = null;
693
							if (parsedUnit.types != null)
893
							if (parsedUnit.types != null)
694
								node = parseBlockStatements(parsedUnit, selectionSourceStart);
894
								node = parseBlockStatements(parsedUnit, selectionSourceStart);
Lines 721-726 Link Here
721
				// accept qualified types only if no unqualified type was accepted
921
				// accept qualified types only if no unqualified type was accepted
722
				if(!this.acceptedAnswer) {
922
				if(!this.acceptedAnswer) {
723
					acceptQualifiedTypes();
923
					acceptQualifiedTypes();
924
					
925
					// accept types from all the workspace only if no type was found in the project scope
926
					if (this.noProposal) {
927
						findAllTypes(this.selectedIdentifier);
928
					}
724
				}
929
				}
725
			}
930
			}
726
			if(this.noProposal && this.problem != null) {
931
			if(this.noProposal && this.problem != null) {
(-)eval/org/eclipse/jdt/internal/eval/EvaluationContext.java (-2 / +3 lines)
Lines 566-572 Link Here
566
	int selectionSourceEnd,
566
	int selectionSourceEnd,
567
	SearchableEnvironment environment,
567
	SearchableEnvironment environment,
568
	ISelectionRequestor requestor,
568
	ISelectionRequestor requestor,
569
	Map options) {
569
	Map options,
570
	WorkingCopyOwner owner) {
570
571
571
	final char[] className = "CodeSnippetSelection".toCharArray(); //$NON-NLS-1$
572
	final char[] className = "CodeSnippetSelection".toCharArray(); //$NON-NLS-1$
572
	final CodeSnippetToCuMapper mapper = new CodeSnippetToCuMapper(
573
	final CodeSnippetToCuMapper mapper = new CodeSnippetToCuMapper(
Lines 595-601 Link Here
595
			return null;
596
			return null;
596
		}
597
		}
597
	};
598
	};
598
	SelectionEngine engine = new SelectionEngine(environment, mapper.getSelectionRequestor(requestor), options);
599
	SelectionEngine engine = new SelectionEngine(environment, mapper.getSelectionRequestor(requestor), options, owner);
599
	engine.select(sourceUnit, mapper.startPosOffset + selectionSourceStart, mapper.startPosOffset + selectionSourceEnd);
600
	engine.select(sourceUnit, mapper.startPosOffset + selectionSourceStart, mapper.startPosOffset + selectionSourceEnd);
600
}
601
}
601
/**
602
/**
(-)src/org/eclipse/jdt/core/tests/model/ResolveTests2.java (-2 / +746 lines)
Lines 10-17 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.core.tests.model;
11
package org.eclipse.jdt.core.tests.model;
12
12
13
import org.eclipse.jdt.core.*;
13
import java.io.File;
14
import java.util.HashMap;
14
15
16
import org.eclipse.jdt.core.*;
17
import org.eclipse.jdt.core.tests.util.Util;
15
import junit.framework.*;
18
import junit.framework.*;
16
19
17
public class ResolveTests2 extends ModifyingResourceTests {
20
public class ResolveTests2 extends ModifyingResourceTests {
Lines 68-74 Link Here
68
71
69
		assertElementsEqual(
72
		assertElementsEqual(
70
			"Unexpected elements",
73
			"Unexpected elements",
71
			"",
74
			"Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]", // Object is found in another project with Object on his classpath
72
			elements
75
			elements
73
		);
76
		);
74
	} finally {
77
	} finally {
Lines 192-195 Link Here
192
		this.deleteProject("P1");
195
		this.deleteProject("P1");
193
	}
196
	}
194
}
197
}
198
199
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=232880
200
public void testBug232880a() throws Exception {
201
	String outputDirectory = Util.getOutputDirectory();
202
	String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
203
	String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
204
	try {
205
		
206
		// create external jar 1
207
		Util.createJar(
208
				new String[] {
209
					"test1/IResource.java", //$NON-NLS-1$
210
					"package test1;\n" + //$NON-NLS-1$
211
					"public class IResource {\n" + //$NON-NLS-1$
212
					"}" //$NON-NLS-1$
213
				},
214
				new HashMap(),
215
				externalJar1);
216
		
217
		// create external jar 2
218
		String source2 =
219
			"package test2;\n" + //$NON-NLS-1$
220
			"import test1.IResource;\n" + //$NON-NLS-1$
221
			"public class IJavaElement {\n" + //$NON-NLS-1$
222
			"	IResource foo() {return null;}\n" + //$NON-NLS-1$
223
			"}"; //$NON-NLS-1$
224
		
225
		Util.createJar(
226
				new String[] {
227
					"test2/IJavaElement.java", //$NON-NLS-1$
228
					source2
229
				},
230
				null,
231
				new HashMap(),
232
				new String[]{externalJar1},
233
				externalJar2);
234
235
		// create P1
236
		IJavaProject project1 = this.createJavaProject(
237
			"PS1",
238
			new String[]{"src"},
239
			new String[]{"JCL_LIB", externalJar1, externalJar2},
240
			 "bin");
241
		
242
		this.createFolder("/PS1/attachment/test2");
243
		this.createFile(
244
				"/PS1/attachment/test2/IJavaElement.java",
245
				source2);
246
		
247
		IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
248
		attachSource(root, "/PS1/attachment/", "");
249
250
		waitUntilIndexesReady();
251
252
		// do code select
253
		IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class");
254
		
255
		IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
256
257
		assertElementsEqual(
258
			"Unexpected elements",
259
			"IResource [in IResource.class [in test1 [in "+outputDirectory + File.separator+"bug232880a.jar]]]",
260
			elements
261
		);
262
	} finally {
263
		this.deleteExternalFile(externalJar1);
264
		this.deleteExternalFile(externalJar2);
265
		refreshExternalArchives(getJavaProject("PS1")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
266
		this.deleteProject("PS1");
267
	}
268
}
269
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=232880
270
public void testBug232880b() throws Exception {
271
	String outputDirectory = Util.getOutputDirectory();
272
	String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
273
	String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
274
	try {
275
		
276
		// create external jar 1
277
		Util.createJar(
278
				new String[] {
279
					"test1/IResource.java", //$NON-NLS-1$
280
					"package test1;\n" + //$NON-NLS-1$
281
					"public class IResource {\n" + //$NON-NLS-1$
282
					"}" //$NON-NLS-1$
283
				},
284
				new HashMap(),
285
				externalJar1);
286
		
287
		// create external jar 2
288
		String source2 =
289
			"package test2;\n" + //$NON-NLS-1$
290
			"import test1.IResource;\n" + //$NON-NLS-1$
291
			"public class IJavaElement {\n" + //$NON-NLS-1$
292
			"	IResource foo() {return null;}\n" + //$NON-NLS-1$
293
			"}"; //$NON-NLS-1$
294
		
295
		Util.createJar(
296
				new String[] {
297
					"test2/IJavaElement.java", //$NON-NLS-1$
298
					source2
299
				},
300
				null,
301
				new HashMap(),
302
				new String[]{externalJar1},
303
				externalJar2);
304
305
		// create P1
306
		IJavaProject project1 = this.createJavaProject(
307
			"PS1",
308
			new String[]{"src"},
309
			new String[]{"JCL_LIB", externalJar2},
310
			 "bin");
311
		
312
		this.createFolder("/PS1/attachment/test2");
313
		this.createFile(
314
				"/PS1/attachment/test2/IJavaElement.java",
315
				source2);
316
		
317
		IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
318
		attachSource(root, "/PS1/attachment/", "");
319
320
		waitUntilIndexesReady();
321
322
		// do code select
323
		IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class");
324
		
325
		IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
326
327
		assertElementsEqual(
328
			"Unexpected elements",
329
			"",
330
			elements
331
		);
332
	} finally {
333
		this.deleteExternalFile(externalJar1);
334
		this.deleteExternalFile(externalJar2);
335
		refreshExternalArchives(getJavaProject("PS1")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
336
		this.deleteProject("PS1");
337
	}
338
}
339
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=232880
340
public void testBug232880c() throws Exception {
341
	String outputDirectory = Util.getOutputDirectory();
342
	String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
343
	String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
344
	try {
345
		
346
		// create external jar 1
347
		Util.createJar(
348
				new String[] {
349
					"test1/IResource.java", //$NON-NLS-1$
350
					"package test1;\n" + //$NON-NLS-1$
351
					"public class IResource {\n" + //$NON-NLS-1$
352
					"}" //$NON-NLS-1$
353
				},
354
				new HashMap(),
355
				externalJar1);
356
		
357
		// create external jar 2
358
		String source2 =
359
			"package test2;\n" + //$NON-NLS-1$
360
			"import test1.IResource;\n" + //$NON-NLS-1$
361
			"public class IJavaElement {\n" + //$NON-NLS-1$
362
			"	IResource foo() {return null;}\n" + //$NON-NLS-1$
363
			"}"; //$NON-NLS-1$
364
		
365
		Util.createJar(
366
				new String[] {
367
					"test2/IJavaElement.java", //$NON-NLS-1$
368
					source2
369
				},
370
				null,
371
				new HashMap(),
372
				new String[]{externalJar1},
373
				externalJar2);
374
375
		// create P1
376
		IJavaProject project1 = this.createJavaProject(
377
			"PS1",
378
			new String[]{"src"},
379
			new String[]{"JCL_LIB", externalJar2},
380
			 "bin");
381
		
382
		this.createFolder("/PS1/attachment/test2");
383
		this.createFile(
384
				"/PS1/attachment/test2/IJavaElement.java",
385
				source2);
386
		
387
		IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
388
		attachSource(root, "/PS1/attachment/", "");
389
		
390
		// create P2
391
		this.createJavaProject(
392
			"PS2",
393
			new String[]{"src"},
394
			new String[]{"JCL_LIB", externalJar1},
395
			 "bin");
396
397
		waitUntilIndexesReady();
398
399
		// do code select
400
		IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class");
401
		
402
		IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
403
404
		assertElementsEqual(
405
			"Unexpected elements",
406
			"IResource [in IResource.class [in test1 [in "+outputDirectory+File.separator+"bug232880a.jar]]]",
407
			elements
408
		);
409
	} finally {
410
		this.deleteExternalFile(externalJar1);
411
		this.deleteExternalFile(externalJar2);
412
		refreshExternalArchives(getJavaProject("PS1")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
413
		refreshExternalArchives(getJavaProject("PS2")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
414
		this.deleteProject("PS1");
415
		this.deleteProject("PS2");
416
	}
417
}
418
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=232880
419
public void testBug232880d() throws Exception {
420
	String outputDirectory = Util.getOutputDirectory();
421
	String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
422
	String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
423
	try {
424
		
425
		// create external jar 1
426
		String source1 =
427
			"package test1;\n" + //$NON-NLS-1$
428
			"public class IResource {\n" + //$NON-NLS-1$
429
			"}"; //$NON-NLS-1$
430
			
431
		Util.createJar(
432
				new String[] {
433
					"test1/IResource.java", //$NON-NLS-1$
434
					source1
435
				},
436
				new HashMap(),
437
				externalJar1);
438
		
439
		// create external jar 2
440
		String source2 =
441
			"package test2;\n" + //$NON-NLS-1$
442
			"import test1.IResource;\n" + //$NON-NLS-1$
443
			"public class IJavaElement {\n" + //$NON-NLS-1$
444
			"	IResource foo() {return null;}\n" + //$NON-NLS-1$
445
			"}"; //$NON-NLS-1$
446
		
447
		Util.createJar(
448
				new String[] {
449
					"test2/IJavaElement.java", //$NON-NLS-1$
450
					source2
451
				},
452
				null,
453
				new HashMap(),
454
				new String[]{externalJar1},
455
				externalJar2);
456
457
		// create P1
458
		IJavaProject project1 = this.createJavaProject(
459
			"PS1",
460
			new String[]{"src"},
461
			new String[]{"JCL_LIB", externalJar2},
462
			 "bin");
463
		
464
		this.createFolder("/PS1/attachment/test2");
465
		this.createFile(
466
				"/PS1/attachment/test2/IJavaElement.java",
467
				source2);
468
		
469
		IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
470
		attachSource(root, "/PS1/attachment/", "");
471
		
472
		// create P2
473
		this.createJavaProject(
474
			"PS2",
475
			new String[]{"src"},
476
			new String[]{"JCL_LIB"},
477
			 "bin");
478
479
		this.createFolder("/PS2/src/test1");
480
		this.createFile(
481
				"/PS2/src/test1/IResource.java",
482
				source1);
483
484
		waitUntilIndexesReady();
485
486
		// do code select
487
		IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class");
488
		
489
		IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
490
491
		assertElementsEqual(
492
			"Unexpected elements",
493
			"IResource [in IResource.java [in test1 [in src [in PS2]]]]",
494
			elements
495
		);
496
	} finally {
497
		this.deleteExternalFile(externalJar1);
498
		this.deleteExternalFile(externalJar2);
499
		refreshExternalArchives(getJavaProject("PS1")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
500
		refreshExternalArchives(getJavaProject("PS2")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
501
		this.deleteProject("PS1");
502
		this.deleteProject("PS2");
503
	}
504
}
505
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=232880
506
public void testBug232880e() throws Exception {
507
	String outputDirectory = Util.getOutputDirectory();
508
	String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
509
	String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
510
	try {
511
		
512
		// create external jar 1
513
		String source1_1 =
514
			"package test1;\n" + //$NON-NLS-1$
515
			"public class CoreException extends Exception {\n" + //$NON-NLS-1$
516
			"}"; //$NON-NLS-1$
517
		
518
		String source1_2 =
519
			"package test1;\n" + //$NON-NLS-1$
520
			"public class IResource {\n" + //$NON-NLS-1$
521
			"}"; //$NON-NLS-1$
522
			
523
		Util.createJar(
524
				new String[] {
525
					"test1/CoreException.java", //$NON-NLS-1$
526
					source1_1,
527
					"test1/IResource.java", //$NON-NLS-1$
528
					source1_2
529
				},
530
				new HashMap(),
531
				externalJar1);
532
		
533
		// create external jar 2
534
		String source2_1 =
535
			"package test2;\n" + //$NON-NLS-1$
536
			"import test1.CoreException;\n" + //$NON-NLS-1$
537
			"public class JavaModelException extends CoreException {\n" + //$NON-NLS-1$
538
			"}"; //$NON-NLS-1$
539
		
540
		String source2_2 =
541
			"package test2;\n" + //$NON-NLS-1$
542
			"import test1.IResource;\n" + //$NON-NLS-1$
543
			"public class IJavaElement {\n" + //$NON-NLS-1$
544
			"	void foo1() throws JavaModelException {}\n" + //$NON-NLS-1$
545
			"	IResource foo2() {return null;}\n" + //$NON-NLS-1$
546
			"}"; //$NON-NLS-1$
547
		
548
		Util.createJar(
549
				new String[] {
550
					"test2/JavaModelException.java", //$NON-NLS-1$
551
					source2_1,
552
					"test2/IJavaElement.java", //$NON-NLS-1$
553
					source2_2
554
				},
555
				null,
556
				new HashMap(),
557
				new String[]{externalJar1},
558
				externalJar2);
559
560
		// create P1
561
		IJavaProject project1 = this.createJavaProject(
562
			"PS1",
563
			new String[]{"src"},
564
			new String[]{"JCL_LIB", externalJar2},
565
			 "bin");
566
		
567
		this.createFolder("/PS1/attachment/test2");
568
		this.createFile(
569
				"/PS1/attachment/test2/IJavaElement.java",
570
				source2_2);
571
		
572
		IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
573
		attachSource(root, "/PS1/attachment/", "");
574
		
575
		// create P2
576
		this.createJavaProject(
577
			"PS2",
578
			new String[]{"src"},
579
			new String[]{"JCL_LIB"},
580
			 "bin");
581
582
		this.createFolder("/PS2/src/test1");
583
		this.createFile(
584
				"/PS2/src/test1/IResource.java",
585
				source1_2);
586
587
		waitUntilIndexesReady();
588
589
		// do code select
590
		IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class");
591
		
592
		IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
593
594
		assertElementsEqual(
595
			"Unexpected elements",
596
			"IResource [in IResource.java [in test1 [in src [in PS2]]]]",
597
			elements
598
		);
599
	} finally {
600
		this.deleteExternalFile(externalJar1);
601
		this.deleteExternalFile(externalJar2);
602
		refreshExternalArchives(getJavaProject("PS1")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
603
		refreshExternalArchives(getJavaProject("PS2")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
604
		this.deleteProject("PS1");
605
		this.deleteProject("PS2");
606
	}
607
}
608
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=232880
609
public void testBug232880f() throws Exception {
610
	String outputDirectory = Util.getOutputDirectory();
611
	String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
612
	String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
613
	try {
614
		
615
		// create external jar 1
616
		Util.createJar(
617
				new String[] {
618
					"test1/IResource.java", //$NON-NLS-1$
619
					"package test1;\n" + //$NON-NLS-1$
620
					"public class IResource {\n" + //$NON-NLS-1$
621
					"}", //$NON-NLS-1$
622
					"test2/IResource.java", //$NON-NLS-1$
623
					"package test2;\n" + //$NON-NLS-1$
624
					"public class IResource {\n" + //$NON-NLS-1$
625
					"}" //$NON-NLS-1$
626
				},
627
				new HashMap(),
628
				externalJar1);
629
		
630
		// create external jar 2
631
		String source2 =
632
			"package test3;\n" + //$NON-NLS-1$
633
			"import test2.IResource;\n" + //$NON-NLS-1$
634
			"public class IJavaElement {\n" + //$NON-NLS-1$
635
			"	IResource foo() {return null;}\n" + //$NON-NLS-1$
636
			"}"; //$NON-NLS-1$
637
		
638
		Util.createJar(
639
				new String[] {
640
					"test3/IJavaElement.java", //$NON-NLS-1$
641
					source2
642
				},
643
				null,
644
				new HashMap(),
645
				new String[]{externalJar1},
646
				externalJar2);
647
648
		// create P1
649
		IJavaProject project1 = this.createJavaProject(
650
			"PS1",
651
			new String[]{"src"},
652
			new String[]{"JCL_LIB", externalJar2},
653
			 "bin");
654
		
655
		this.createFolder("/PS1/attachment/test3");
656
		this.createFile(
657
				"/PS1/attachment/test3/IJavaElement.java",
658
				source2);
659
		
660
		IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
661
		attachSource(root, "/PS1/attachment/", "");
662
		
663
		// create P2
664
		this.createJavaProject(
665
			"PS2",
666
			new String[]{"src"},
667
			new String[]{"JCL_LIB", externalJar1},
668
			 "bin");
669
670
		waitUntilIndexesReady();
671
672
		// do code select
673
		IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class");
674
		
675
		IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
676
677
		assertElementsEqual(
678
			"Unexpected elements",
679
			"IResource [in IResource.class [in test2 [in "+outputDirectory+File.separator+"bug232880a.jar]]]",
680
			elements
681
		);
682
	} finally {
683
		this.deleteExternalFile(externalJar1);
684
		this.deleteExternalFile(externalJar2);
685
		refreshExternalArchives(getJavaProject("PS1")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
686
		refreshExternalArchives(getJavaProject("PS2")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
687
		this.deleteProject("PS1");
688
		this.deleteProject("PS2");
689
	}
690
}
691
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=232880
692
public void testBug232880g() throws Exception {
693
	String outputDirectory = Util.getOutputDirectory();
694
	String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
695
	String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
696
	try {
697
		
698
		// create external jar 1
699
		Util.createJar(
700
				new String[] {
701
					"test1/IResource.java", //$NON-NLS-1$
702
					"package test1;\n" + //$NON-NLS-1$
703
					"public class IResource {\n" + //$NON-NLS-1$
704
					"}", //$NON-NLS-1$
705
					"test2/IResource.java", //$NON-NLS-1$
706
					"package test2;\n" + //$NON-NLS-1$
707
					"public class IResource {\n" + //$NON-NLS-1$
708
					"}" //$NON-NLS-1$
709
				},
710
				new HashMap(),
711
				externalJar1);
712
		
713
		// create external jar 2
714
		String source2 =
715
			"package test3;\n" + //$NON-NLS-1$
716
			"import test2.*;\n" + //$NON-NLS-1$
717
			"public class IJavaElement {\n" + //$NON-NLS-1$
718
			"	IResource foo() {return null;}\n" + //$NON-NLS-1$
719
			"}"; //$NON-NLS-1$
720
		
721
		Util.createJar(
722
				new String[] {
723
					"test3/IJavaElement.java", //$NON-NLS-1$
724
					source2
725
				},
726
				null,
727
				new HashMap(),
728
				new String[]{externalJar1},
729
				externalJar2);
730
731
		// create P1
732
		IJavaProject project1 = this.createJavaProject(
733
			"PS1",
734
			new String[]{"src"},
735
			new String[]{"JCL_LIB", externalJar2},
736
			 "bin");
737
		
738
		this.createFolder("/PS1/attachment/test3");
739
		this.createFile(
740
				"/PS1/attachment/test3/IJavaElement.java",
741
				source2);
742
		
743
		IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
744
		attachSource(root, "/PS1/attachment/", "");
745
		
746
		// create P2
747
		this.createJavaProject(
748
			"PS2",
749
			new String[]{"src"},
750
			new String[]{"JCL_LIB", externalJar1},
751
			 "bin");
752
753
		waitUntilIndexesReady();
754
755
		// do code select
756
		IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class");
757
		
758
		IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
759
760
		assertElementsEqual(
761
			"Unexpected elements",
762
			"IResource [in IResource.class [in test2 [in "+outputDirectory+File.separator+"bug232880a.jar]]]",
763
			elements
764
		);
765
	} finally {
766
		this.deleteExternalFile(externalJar1);
767
		this.deleteExternalFile(externalJar2);
768
		refreshExternalArchives(getJavaProject("PS1")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
769
		refreshExternalArchives(getJavaProject("PS2")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
770
		this.deleteProject("PS1");
771
		this.deleteProject("PS2");
772
	}
773
}//https://bugs.eclipse.org/bugs/show_bug.cgi?id=232880
774
public void testBug232880h() throws Exception {
775
	String outputDirectory = Util.getOutputDirectory();
776
	String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
777
	String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
778
	try {
779
		
780
		// create external jar 1
781
		Util.createJar(
782
				new String[] {
783
					"test1/IResource.java", //$NON-NLS-1$
784
					"package test1;\n" + //$NON-NLS-1$
785
					"public class IResource {\n" + //$NON-NLS-1$
786
					"}", //$NON-NLS-1$
787
					"test2/IResource.java", //$NON-NLS-1$
788
					"package test2;\n" + //$NON-NLS-1$
789
					"public class IResource {\n" + //$NON-NLS-1$
790
					"}" //$NON-NLS-1$
791
				},
792
				new HashMap(),
793
				externalJar1);
794
		
795
		// create external jar 2
796
		String source2 =
797
			"package test3;\n" + //$NON-NLS-1$
798
			"import test1.*;\n" + //$NON-NLS-1$
799
			"import test2.IResource;\n" + //$NON-NLS-1$
800
			"public class IJavaElement {\n" + //$NON-NLS-1$
801
			"	IResource foo() {return null;}\n" + //$NON-NLS-1$
802
			"}"; //$NON-NLS-1$
803
		
804
		Util.createJar(
805
				new String[] {
806
					"test3/IJavaElement.java", //$NON-NLS-1$
807
					source2
808
				},
809
				null,
810
				new HashMap(),
811
				new String[]{externalJar1},
812
				externalJar2);
813
814
		// create P1
815
		IJavaProject project1 = this.createJavaProject(
816
			"PS1",
817
			new String[]{"src"},
818
			new String[]{"JCL_LIB", externalJar2},
819
			 "bin");
820
		
821
		this.createFolder("/PS1/attachment/test3");
822
		this.createFile(
823
				"/PS1/attachment/test3/IJavaElement.java",
824
				source2);
825
		
826
		IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
827
		attachSource(root, "/PS1/attachment/", "");
828
		
829
		// create P2
830
		this.createJavaProject(
831
			"PS2",
832
			new String[]{"src"},
833
			new String[]{"JCL_LIB", externalJar1},
834
			 "bin");
835
836
		waitUntilIndexesReady();
837
838
		// do code select
839
		IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class");
840
		
841
		IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
842
843
		assertElementsEqual(
844
			"Unexpected elements",
845
			"IResource [in IResource.class [in test2 [in "+outputDirectory+File.separator+"bug232880a.jar]]]",
846
			elements
847
		);
848
	} finally {
849
		this.deleteExternalFile(externalJar1);
850
		this.deleteExternalFile(externalJar2);
851
		refreshExternalArchives(getJavaProject("PS1")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
852
		refreshExternalArchives(getJavaProject("PS2")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
853
		this.deleteProject("PS1");
854
		this.deleteProject("PS2");
855
	}
856
}
857
public void testBug232880i() throws Exception {
858
	String outputDirectory = Util.getOutputDirectory();
859
	String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$
860
	String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$
861
	try {
862
		
863
		// create external jar 1
864
		Util.createJar(
865
				new String[] {
866
					"test1/IResource.java", //$NON-NLS-1$
867
					"package test1;\n" + //$NON-NLS-1$
868
					"public class IResource {\n" + //$NON-NLS-1$
869
					"}", //$NON-NLS-1$
870
					"test2/IResource.java", //$NON-NLS-1$
871
					"package test2;\n" + //$NON-NLS-1$
872
					"public class IResource {\n" + //$NON-NLS-1$
873
					"}" //$NON-NLS-1$
874
				},
875
				new HashMap(),
876
				externalJar1);
877
		
878
		// create external jar 2
879
		String source2 =
880
			"package test3;\n" + //$NON-NLS-1$
881
			"public class IJavaElement {\n" + //$NON-NLS-1$
882
			"	test2.IResource foo() {return null;}\n" + //$NON-NLS-1$
883
			"}"; //$NON-NLS-1$
884
		
885
		Util.createJar(
886
				new String[] {
887
					"test3/IJavaElement.java", //$NON-NLS-1$
888
					source2
889
				},
890
				null,
891
				new HashMap(),
892
				new String[]{externalJar1},
893
				externalJar2);
894
895
		// create P1
896
		IJavaProject project1 = this.createJavaProject(
897
			"PS1",
898
			new String[]{"src"},
899
			new String[]{"JCL_LIB", externalJar2},
900
			 "bin");
901
		
902
		this.createFolder("/PS1/attachment/test3");
903
		this.createFile(
904
				"/PS1/attachment/test3/IJavaElement.java",
905
				source2);
906
		
907
		IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2);
908
		attachSource(root, "/PS1/attachment/", "");
909
		
910
		// create P2
911
		this.createJavaProject(
912
			"PS2",
913
			new String[]{"src"},
914
			new String[]{"JCL_LIB", externalJar1},
915
			 "bin");
916
917
		waitUntilIndexesReady();
918
919
		// do code select
920
		IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class");
921
		
922
		IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource");
923
924
		assertElementsEqual(
925
			"Unexpected elements",
926
			"IResource [in IResource.class [in test1 [in "+outputDirectory+File.separator+"bug232880a.jar]]]\n" + 
927
			"IResource [in IResource.class [in test2 [in "+outputDirectory+File.separator+"bug232880a.jar]]]",
928
			elements
929
		);
930
	} finally {
931
		this.deleteExternalFile(externalJar1);
932
		this.deleteExternalFile(externalJar2);
933
		refreshExternalArchives(getJavaProject("PS1")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
934
		refreshExternalArchives(getJavaProject("PS2")); // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=250083
935
		this.deleteProject("PS1");
936
		this.deleteProject("PS2");
937
	}
938
}
195
}
939
}

Return to bug 232880