diff options
author | Jesse Garms | 2006-02-06 19:50:19 +0000 |
---|---|---|
committer | Jesse Garms | 2006-02-06 19:50:19 +0000 |
commit | 0d55491243a7c8d4167de34f9e1712fba0498c70 (patch) | |
tree | ab8897406fa0d03c14df9e8270b061e0e071c752 | |
parent | 2550f0b4f89b0776d97f0bb280734d0854b331e9 (diff) | |
download | eclipse.jdt.core-0d55491243a7c8d4167de34f9e1712fba0498c70.tar.gz eclipse.jdt.core-0d55491243a7c8d4167de34f9e1712fba0498c70.tar.xz eclipse.jdt.core-0d55491243a7c8d4167de34f9e1712fba0498c70.zip |
Throw IllegalArgumentException if type name is null or empty on createSourceFile and createClassFile.
-rw-r--r-- | org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/FilerImpl.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/FilerImpl.java b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/FilerImpl.java index bb5c629f58..4823dcda21 100644 --- a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/FilerImpl.java +++ b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/FilerImpl.java @@ -52,6 +52,9 @@ public class FilerImpl implements Filer { */ public PrintWriter createSourceFile(String typeName) throws IOException { + if (typeName == null || typeName.equals("")) { //$NON-NLS-1$ + throw new IllegalArgumentException("Cannot create a source file with the following name: " + typeName); //$NON-NLS-1$ + } _env.checkValid(); return new JavaSourceFilePrintWriter( typeName, new StringWriter(), _env ); } @@ -67,6 +70,9 @@ public class FilerImpl implements Filer { */ public OutputStream createClassFile(String name) throws IOException { + if (name == null || name.equals("")) { //$NON-NLS-1$ + throw new IllegalArgumentException("Cannot create a class file with the following name: " + name); //$NON-NLS-1$ + } _env.checkValid(); _generatedClassFiles = true; |