# HG changeset patch # User bpatel # Date 1377905934 25200 # Node ID 4b1a79163f9c2964475107c7d66c5ae3e8e2a45b # Parent 1cdd11ae40c8a361db24b9a94e5a484ba7dad15b 8022738: doclet should only generate functional interface text if source >= 8 Reviewed-by: jjg diff -r 1cdd11ae40c8 -r 4b1a79163f9c langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java --- a/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Fri Aug 30 16:27:08 2013 -0700 +++ b/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Fri Aug 30 16:38:54 2013 -0700 @@ -289,7 +289,7 @@ } public boolean isFunctionalInterface() { - return env.types.isFunctionalInterface(tsym); + return env.types.isFunctionalInterface(tsym) && env.source.allowLambda(); } /** diff -r 1cdd11ae40c8 -r 4b1a79163f9c langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java --- a/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java Fri Aug 30 16:27:08 2013 -0700 +++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java Fri Aug 30 16:38:54 2013 -0700 @@ -124,6 +124,11 @@ private boolean silent = false; /** + * The source language version. + */ + protected Source source; + + /** * Constructor * * @param context Context for this javadoc instance. @@ -144,6 +149,7 @@ // Default. Should normally be reset with setLocale. this.doclocale = new DocLocale(this, "", breakiterator); + source = Source.instance(context); } public void setSilent(boolean silent) { diff -r 1cdd11ae40c8 -r 4b1a79163f9c langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java --- a/langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java Fri Aug 30 16:27:08 2013 -0700 +++ b/langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java Fri Aug 30 16:38:54 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8004893 + * @bug 8004893 8022738 * @summary Make sure that the lambda feature changes work fine in * javadoc. * @author bpatel @@ -35,11 +35,15 @@ public class TestLambdaFeature extends JavadocTester { //Test information. - private static final String BUG_ID = "8004893"; + private static final String BUG_ID = "8004893-8022738"; //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "pkg1" + }; + + private static final String[] ARGS_1 = new String[] { + "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-source", "1.5", "pkg1" }; //Input for string search tests. @@ -63,6 +67,11 @@ "