--- old/src/share/classes/com/sun/tools/javac/model/JavacElements.java 2013-02-05 13:56:14.000000000 -0800 +++ new/src/share/classes/com/sun/tools/javac/model/JavacElements.java 2013-02-05 13:56:13.000000000 -0800 @@ -760,6 +760,16 @@ return names.fromString(cs.toString()); } + @Override + public boolean isFunctionalInterface(TypeElement element) { + if (element.getKind() != ElementKind.INTERFACE) + return false; + else { + TypeSymbol tsym = cast(TypeSymbol.class, element); + return types.isFunctionalInterface(tsym); + } + } + /** * Returns the tree node and compilation unit corresponding to this * element, or null if they can't be found. --- old/src/share/classes/javax/lang/model/element/TypeElement.java 2013-02-05 13:56:14.000000000 -0800 +++ new/src/share/classes/javax/lang/model/element/TypeElement.java 2013-02-05 13:56:14.000000000 -0800 @@ -111,7 +111,6 @@ */ Name getQualifiedName(); - /** * Returns the simple name of this type element. * @@ -152,7 +151,6 @@ */ List getTypeParameters(); - /** * Returns the package of a top-level type and returns the * immediately lexically enclosing element for a {@linkplain --- old/src/share/classes/javax/lang/model/util/Elements.java 2013-02-05 13:56:14.000000000 -0800 +++ new/src/share/classes/javax/lang/model/util/Elements.java 2013-02-05 13:56:14.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -249,4 +249,14 @@ * @param cs the character sequence to return as a name */ Name getName(CharSequence cs); + + /** + * Returns {@code true} if the type element is a functional interface, {@code false} otherwise. + * + * @param type the type element being examined + * @return {@code true} if the element is a functional interface, {@code false} otherwise + * @jls 9.8 Functional Interfaces + * @since 1.8 + */ + boolean isFunctionalInterface(TypeElement type); }