Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayaprakash Arthanareeswaran2014-01-24 04:35:22 +0000
committerJayaprakash Arthanareeswaran2014-01-24 04:35:22 +0000
commit328fb2ac2aedb028037d1ad93f05fcf58a4a2705 (patch)
tree42150d1efb87e52a447242fde57d02705c964395 /org.eclipse.jdt.compiler.apt.tests
parent1394edf1116ec1563c76f21ce03154bae6bb9472 (diff)
downloadeclipse.jdt.core-328fb2ac2aedb028037d1ad93f05fcf58a4a2705.tar.gz
eclipse.jdt.core-328fb2ac2aedb028037d1ad93f05fcf58a4a2705.tar.xz
eclipse.jdt.core-328fb2ac2aedb028037d1ad93f05fcf58a4a2705.zip
Fixed Bug 426480 - EclipseFileManager#getJavaFileObjectsFromFiles allows
directories
Diffstat (limited to 'org.eclipse.jdt.compiler.apt.tests')
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/FileManagerTests.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/FileManagerTests.java b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/FileManagerTests.java
index 40a5424def..5a26c43608 100644
--- a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/FileManagerTests.java
+++ b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/FileManagerTests.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 BEA Systems, Inc. and others
+ * Copyright (c) 2007, 2014 BEA Systems, Inc. and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* wharley@bea.com - initial API and implementation
* IBM Corporation - fixed a resource leak warning
@@ -94,6 +98,16 @@ public class FileManagerTests extends TestCase {
builder.append(name.substring(lastIndexOf + 1));
}
assertEquals("Wrong contents", "X.java", String.valueOf(builder));
+
+ List<File> files = new ArrayList<File>();
+ files.add(dir);
+ try {
+ fileManager.getJavaFileObjectsFromFiles(files);
+ fail("IllegalArgumentException should be thrown but not");
+ } catch(IllegalArgumentException iae) {
+ // Do nothing
+ }
+
} catch (IOException e) {
e.printStackTrace();
} finally {

Back to the top