Bug 540090 - Unjustified FilerException "Source file already exists" in
BatchFiler

Change-Id: Ic103f78921947bae1d10c1ab062e8f4b841657e2
diff --git a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl9.java b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl9.java
index 12fb1a6..81a5f8a 100644
--- a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl9.java
+++ b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl9.java
@@ -32,6 +32,7 @@
 import org.eclipse.jdt.internal.compiler.lookup.ModuleBinding;
 import org.eclipse.jdt.internal.compiler.lookup.PackageBinding;
 import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
+import org.eclipse.jdt.internal.compiler.lookup.TagBits;
 import org.eclipse.jdt.internal.compiler.util.HashtableOfModule;
 
 /**
@@ -93,6 +94,9 @@
 		if (null == binding) {
 			return null;
 		}
+		if ((binding.tagBits & TagBits.HasMissingType) != 0) {
+			return null;
+		}
 		return new TypeElementImpl(_env, binding, null);
 	}