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

Collapse All | Expand All

(-)src/org/eclipse/jdt/compiler/apt/tests/BatchTestUtils.java (+4 lines)
Lines 193-198 Link Here
193
		return _tmpSrcFolderName;
193
		return _tmpSrcFolderName;
194
	}
194
	}
195
195
196
	public static String getResourceFolderName() {
197
		return RESOURCES_DIR;
198
	}
199
196
	/**
200
	/**
197
	 * Load Eclipse compiler and create temporary directories on disk
201
	 * Load Eclipse compiler and create temporary directories on disk
198
	 */
202
	 */
(-)src/org/eclipse/jdt/compiler/apt/tests/BatchDispatchTests.java (+22 lines)
Lines 219-224 Link Here
219
		assertEquals("succeeded", System.getProperty(processorClass));
219
		assertEquals("succeeded", System.getProperty(processorClass));
220
	}
220
	}
221
221
222
	/**
223
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=209961
224
	 */
225
	public void test209961() throws IOException {
226
		File targetFolder = TestUtils.concatPath(BatchTestUtils.getSrcFolderName(), "targets", "dispatch");
227
		File inputFile = BatchTestUtils.copyResource("targets/dispatch/X.java", targetFolder);
228
		assertNotNull("No input file", inputFile);
229
		File classpathEntry =TestUtils.concatPath(
230
			new File(BatchTestUtils.getPluginDirectoryPath(), BatchTestUtils.getResourceFolderName()).getAbsolutePath(),
231
			"targets",
232
			"dispatch");
233
		
234
		List<String> options = new ArrayList<String>();
235
		// See corresponding list in CheckArgsProc processor.
236
		// Processor will throw IllegalStateException if it detects a mismatch.
237
		options.add("-classpath");
238
		options.add(classpathEntry.getAbsolutePath());
239
		options.add("-verbose");
240
	
241
		BatchTestUtils.compileOneClass(BatchTestUtils.getEclipseCompiler(), options, inputFile);
242
	}
243
222
	@Override
244
	@Override
223
	protected void tearDown() throws Exception {
245
	protected void tearDown() throws Exception {
224
		BatchTestUtils.tearDown();
246
		BatchTestUtils.tearDown();
(-)resources/targets/dispatch/p/Y.java (+3 lines)
Added Link Here
1
package p;
2
3
public class Y extends Z {}
(-)resources/targets/dispatch/p/Z.java (+3 lines)
Added Link Here
1
package p;
2
3
public class Z {}
(-)resources/targets/dispatch/X.java (+9 lines)
Added Link Here
1
import p.Y;
2
import p.Z;
3
4
public class X extends Y {
5
	public static void main(String[] args) {
6
		System.out.println(new Y());
7
		System.out.println(new Z());
8
	}
9
}
(-)src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java (-1 / +7 lines)
Lines 634-640 Link Here
634
				if (remaining.hasNext()) {
634
				if (remaining.hasNext()) {
635
					final Iterable<? extends File> classpaths = getPathsFrom(remaining.next());
635
					final Iterable<? extends File> classpaths = getPathsFrom(remaining.next());
636
					if (classpaths != null) {
636
					if (classpaths != null) {
637
						setLocation(StandardLocation.CLASS_PATH, classpaths);
637
						Iterable<? extends File> iterable = getLocation(StandardLocation.CLASS_PATH);
638
						if (iterable != null) {
639
							setLocation(StandardLocation.CLASS_PATH,
640
								concatFiles(iterable, classpaths));
641
						} else {
642
							setLocation(StandardLocation.CLASS_PATH, classpaths);
643
						}
638
						if ((this.flags & HAS_PROCESSORPATH) == 0) {
644
						if ((this.flags & HAS_PROCESSORPATH) == 0) {
639
							setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, classpaths);
645
							setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, classpaths);
640
						}
646
						}
(-)src/org/eclipse/jdt/internal/compiler/apt/util/EclipseFileManager.java (-1 / +7 lines)
Lines 634-640 Link Here
634
				if (remaining.hasNext()) {
634
				if (remaining.hasNext()) {
635
					final Iterable<? extends File> classpaths = getPathsFrom(remaining.next());
635
					final Iterable<? extends File> classpaths = getPathsFrom(remaining.next());
636
					if (classpaths != null) {
636
					if (classpaths != null) {
637
						setLocation(StandardLocation.CLASS_PATH, classpaths);
637
						Iterable<? extends File> iterable = getLocation(StandardLocation.CLASS_PATH);
638
						if (iterable != null) {
639
							setLocation(StandardLocation.CLASS_PATH,
640
								concatFiles(iterable, classpaths));
641
						} else {
642
							setLocation(StandardLocation.CLASS_PATH, classpaths);
643
						}
638
						if ((this.flags & HAS_PROCESSORPATH) == 0) {
644
						if ((this.flags & HAS_PROCESSORPATH) == 0) {
639
							setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, classpaths);
645
							setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, classpaths);
640
						}
646
						}
(-)compiler/org/eclipse/jdt/internal/compiler/Compiler.java (-1 / +1 lines)
Lines 645-651 Link Here
645
		int newUnitSize = 0;
645
		int newUnitSize = 0;
646
		int newClassFilesSize = 0;
646
		int newClassFilesSize = 0;
647
		int bottom = 0;
647
		int bottom = 0;
648
		int top = this.unitsToProcess.length;
648
		int top = this.totalUnits;
649
		ReferenceBinding[] binaryTypeBindingsTemp = this.referenceBindings;
649
		ReferenceBinding[] binaryTypeBindingsTemp = this.referenceBindings;
650
		if (top == 0 && binaryTypeBindingsTemp == null) return;
650
		if (top == 0 && binaryTypeBindingsTemp == null) return;
651
		this.referenceBindings = null;
651
		this.referenceBindings = null;

Return to bug 209961