Source:
<code>public JavaFileObject createSourceFile(CharSequence name, Element... originatingElements) throws IOException { if (null == name) { throw new IllegalArgumentException("Name is null"); } IFile file = _env.getAptProject().getGeneratedFileManager(_env.isTestCode()).getIFileForTypeName(name.toString()); if (AptCompilationParticipant.getInstance().getJava6GeneratedFiles().contains(file)) { throw new FilerException("Source file already created: " + file.getFullPath()); } name = name.toString().replace('/', '.'); ModuleBinding m = _env._current_module; if (m == null) m = _env.getCompiler().lookupEnvironment.UnNamedModule; ReferenceBinding type = m.environment.getType(CharOperation.splitOn('.', name.toString().toCharArray()), m); if (type != null && (type.tagBits & TagBits.HasMissingType) == 0) { IFile classFile = getFileFromOutputLocation(StandardLocation.CLASS_OUTPUT, CharOperation.toString(type.fPackage.compoundName), new String(type.sourceName()) + ".class"); String fileName = new <START> String(type.getFileName()); <END> String osString = classFile.getFullPath().toOSString(); if (!osString.equals(fileName) || !_dispatchManager._isFirstRound) { throw new FilerException("Source file already exists : " + name); } } Set<IFile> parentFiles = Collections.emptySet(); if (originatingElements != null && originatingElements.length > 0) { parentFiles = new HashSet<IFile>(originatingElements.length); for (Element elem : originatingElements) { IFile enclosing = _env.getEnclosingIFile(elem); if (null != enclosing) { parentFiles.add(enclosing); } } } return new IdeOutputJavaFileObject(_env, name, parentFiles); }</code><technical_language>Is this guaranteed non-null in context of annotation processing? I.e. for BTB created a HierarchyBinaryType null (but I assume, annotation processing.) ClassFileReader is created a null filename. of locations in context of annotation processing. Still, a good idea add a defensive null check. add null annotations jdt.core, this method need annotated nullable, do sooner anyway. IndexBinaryType is in context of annotation processing, this break it, return index filename</technical_language>

Target:
public JavaFileObject createSourceFile(CharSequence name, Element... originatingElements) throws IOException { if (null == name) { throw new IllegalArgumentException("Name is null"); } IFile file = _env.getAptProject().getGeneratedFileManager(_env.isTestCode()).getIFileForTypeName(name.toString()); if (AptCompilationParticipant.getInstance().getJava6GeneratedFiles().contains(file)) { throw new FilerException("Source file already created: " + file.getFullPath()); } name = name.toString().replace('/', '.'); ModuleBinding m = _env._current_module; if (m == null) m = _env.getCompiler().lookupEnvironment.UnNamedModule; ReferenceBinding type = m.environment.getType(CharOperation.splitOn('.', name.toString().toCharArray()), m); if (type != null && (type.tagBits & TagBits.HasMissingType) == 0) { IFile classFile = getFileFromOutputLocation(StandardLocation.CLASS_OUTPUT, CharOperation.toString(type.fPackage.compoundName), new String(type.sourceName()) + ".class"); String fileName = new String(type.getFileName()); if (fileName != null) { String osString = classFile.getFullPath().toOSString(); if (!osString.equals(fileName) || !_dispatchManager._isFirstRound) { throw new FilerException("Source file already exists : " + name); } } } Set<IFile> parentFiles = Collections.emptySet(); if (originatingElements != null && originatingElements.length > 0) { parentFiles = new HashSet<IFile>(originatingElements.length); for (Element elem : originatingElements) { IFile enclosing = _env.getEnclosingIFile(elem); if (null != enclosing) { parentFiles.add(enclosing); } } } return new IdeOutputJavaFileObject(_env, name, parentFiles); }