* @return
*/
public String generateFailedGenerateAttempt(final TreeLogger logger,
final com.google.gwt.core.ext.GeneratorContext generatorContext, final String typeName, final Throwable cause) {
final TypeOracleGeneratorContext context = new TypeOracleGeneratorContext() {
@Override
public NewConcreteType newConcreteType(final String name) {
throw new UnsupportedOperationException();
}
@Override
public NewInterfaceType newInterfaceType(final String name) {
throw new UnsupportedOperationException();
}
@Override
protected Package createPackage(String name) {
throw new UnsupportedOperationException();
}
@Override
protected void preloadTypes() {
}
};
context.setGeneratorContext(generatorContext);
context.setRootTreeLogger(logger);
final String generatedClassName = context.getGeneratedTypeName(typeName, this.getGeneratedTypeNameSuffix());
final PrintWriter printWriter = context.tryCreateTypePrintWriter(generatedClassName);
if (printWriter != null) {
final String packageName = context.getPackageName(generatedClassName);
final String simpleClassName = context.getSimpleClassName(generatedClassName);
final ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(packageName, simpleClassName);
composerFactory.setSuperclass(FailedGenerateAttemptException.class.getName());
final SourceWriter sourceWriter = context.createSourceWriter(composerFactory, printWriter);
Throwable cause0 = cause;
while (true) {
final Throwable cause1 = cause0.getCause();
if (null == cause1) {