APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.tools.javac.code

public Class DeferredCompletionFailureHandler

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map, com.sun.tools.javac.code.Kinds.Kind, .Scope.WriteableScope, .Symbol, .Symbol.ClassSymbol, .Symbol.Completer, .Symbol.CompletionFailure, com.sun.tools.javac.util.Context

When a CompletionFailure is thrown when user code is running, it shouldn't be thrown out to the client code, but rather skipped, and then rethrown later if javac itself will complete the Symbol. On all places where javac invokes client code (e.g. TaskListeners, annotation Processors), the userCodeHandler should be set using DeferredCompletionFailureHandler#setHandler, and the original handler should be restored when the control returns back to javac. Implementations of API methods should use Symbol#apiComplete() instead of Symbol#complete, as the apiComplete method will invoke DeferredCompletionFailureHandler#handleAPICompletionFailure, which will catch the CompletionFailure and will either rethrow it or skip it, depending on the context.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class
public static interface

Field Summary

Modifier and TypeField and Description
protected static final Context.Key<DeferredCompletionFailureHandler>
private DeferredCompletionFailureHandler.Handler
public final DeferredCompletionFailureHandler.Handler
public final DeferredCompletionFailureHandler.Handler
public final DeferredCompletionFailureHandler.Handler

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public static DeferredCompletionFailureHandler
instance(Context context)

public boolean
public DeferredCompletionFailureHandler.Handler
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

deferredCompletionFailureHandlerKeyback to summary
protected static final Context.Key<DeferredCompletionFailureHandler> deferredCompletionFailureHandlerKey
handlerback to summary
private DeferredCompletionFailureHandler.Handler handler
javacCodeHandlerback to summary
public final DeferredCompletionFailureHandler.Handler javacCodeHandler
speculativeCodeHandlerback to summary
public final DeferredCompletionFailureHandler.Handler speculativeCodeHandler
userCodeHandlerback to summary
public final DeferredCompletionFailureHandler.Handler userCodeHandler

Constructor Detail

DeferredCompletionFailureHandlerback to summary
protected DeferredCompletionFailureHandler(Context context)
Annotations
@SuppressWarnings:this-escape

Method Detail

classSymbolCompleteFailedback to summary
public void classSymbolCompleteFailed(Symbol.ClassSymbol sym, Symbol.Completer origCompleter)
classSymbolRemovedback to summary
public void classSymbolRemoved(Symbol.ClassSymbol sym)
handleAPICompletionFailureback to summary
public void handleAPICompletionFailure(Symbol.CompletionFailure cf)
instanceback to summary
public static DeferredCompletionFailureHandler instance(Context context)
isDeferredCompleterback to summary
public boolean isDeferredCompleter(Symbol.Completer c)
setHandlerback to summary
public DeferredCompletionFailureHandler.Handler setHandler(DeferredCompletionFailureHandler.Handler h)
com.sun.tools.javac.code back to summary

private Class DeferredCompletionFailureHandler.DeferredCompleter

extends Object
implements Completer
Class Inheritance
  • java.lang.Object
  • com.sun.tools.javac.code.DeferredCompletionFailureHandler.DeferredCompleter
All Implemented Interfaces
com.sun.tools.javac.code.Symbol.Completer

Field Summary

Modifier and TypeField and Description
private final Symbol.Completer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

origCompleterback to summary
private final Symbol.Completer origCompleter

Constructor Detail

DeferredCompleterback to summary
public DeferredCompleter(Symbol.Completer origCompleter)

Method Detail

completeback to summary
public void complete(Symbol sym) throws CompletionFailure

Implements com.sun.tools.javac.code.Symbol.Completer.complete.

Annotations
@Override
com.sun.tools.javac.code back to summary

private Class DeferredCompletionFailureHandler.FlipSymbolDescription

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.tools.javac.code.DeferredCompletionFailureHandler.FlipSymbolDescription

Field Summary

Modifier and TypeField and Description
public Symbol.Completer
public Kinds.Kind
public Scope.WriteableScope
public final Symbol.ClassSymbol
public Type

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
flip()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

completerback to summary
public Symbol.Completer completer
kindback to summary
public Kinds.Kind kind
membersback to summary
public Scope.WriteableScope members
symback to summary
public final Symbol.ClassSymbol sym
typeback to summary
public Type type

Constructor Detail

FlipSymbolDescriptionback to summary
public FlipSymbolDescription(Symbol.ClassSymbol sym, Symbol.Completer completer)

Method Detail

flipback to summary
public void flip()
com.sun.tools.javac.code back to summary

public Interface DeferredCompletionFailureHandler.Handler


Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public void
public void

Method Detail

classSymbolCompleteFailedback to summary
public void classSymbolCompleteFailed(Symbol.ClassSymbol sym, Symbol.Completer origCompleter)
classSymbolRemovedback to summary
public void classSymbolRemoved(Symbol.ClassSymbol sym)
handleAPICompletionFailureback to summary
public void handleAPICompletionFailure(Symbol.CompletionFailure cf)
installback to summary
public void install()
uninstallback to summary
public void uninstall()