private CompletionFailure newCompletionFailure ( TypeSymbol c , JCDiagnostic diag ) { if ( ! cacheCompletionFailure ) { // log.warning("proc.messager", // Log.getLocalizedString("class.file.not.found", c.flatname)); // c.debug.printStackTrace(); return new CompletionFailure ( c , diag ) ; } else { CompletionFailure result = cachedCompletionFailure ; result . sym = c ; result . diag = diag ; return result ; } }
Static factory for CompletionFailure objects . In practice only one can be used at a time so we share one to reduce the expense of allocating new exception objects .