Java Code Examples for com.sun.tools.javac.code.Symbol.Completer#complete()

The following examples show how to use com.sun.tools.javac.code.Symbol.Completer#complete() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Symtab.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public void synthesizeEmptyInterfaceIfMissing(final Type type) {
    final Completer completer = type.tsym.completer;
    type.tsym.completer = new Completer() {
        @Override
        public void complete(Symbol sym) throws CompletionFailure {
            try {
                completer.complete(sym);
            } catch (CompletionFailure e) {
                sym.flags_field |= (PUBLIC | INTERFACE);
                ((ClassType) sym.type).supertype_field = objectType;
            }
        }

        @Override
        public boolean isTerminal() {
            return completer.isTerminal();
        }
    };
}
 
Example 2
Source File: Symtab.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void synthesizeEmptyInterfaceIfMissing(final Type type) {
    final Completer completer = type.tsym.completer;
    type.tsym.completer = new Completer() {
        @Override
        public void complete(Symbol sym) throws CompletionFailure {
            try {
                completer.complete(sym);
            } catch (CompletionFailure e) {
                sym.flags_field |= (PUBLIC | INTERFACE);
                ((ClassType) sym.type).supertype_field = objectType;
            }
        }

        @Override
        public boolean isTerminal() {
            return completer.isTerminal();
        }
    };
}
 
Example 3
Source File: Symtab.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void synthesizeEmptyInterfaceIfMissing(final Type type) {
    final Completer completer = type.tsym.completer;
    if (completer != null) {
        type.tsym.completer = new Completer() {
            public void complete(Symbol sym) throws CompletionFailure {
                try {
                    completer.complete(sym);
                } catch (CompletionFailure e) {
                    sym.flags_field |= (PUBLIC | INTERFACE);
                    ((ClassType) sym.type).supertype_field = objectType;
                }
            }
        };
    }
}
 
Example 4
Source File: Symtab.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
public void synthesizeEmptyInterfaceIfMissing(final Type type) {
    final Completer completer = type.tsym.completer;
    if (completer != null) {
        type.tsym.completer = new Completer() {
            public void complete(Symbol sym) throws CompletionFailure {
                try {
                    completer.complete(sym);
                } catch (CompletionFailure e) {
                    sym.flags_field |= (PUBLIC | INTERFACE);
                    ((ClassType) sym.type).supertype_field = objectType;
                }
            }
        };
    }
}