Fri, 03 May 2013 15:08:47 -0700
8000407: remove @GenerateNativeHeader
Reviewed-by: vromero, darcy
1.1 --- a/src/share/classes/com/sun/tools/javac/code/Symtab.java Fri May 03 10:17:12 2013 -0700 1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Symtab.java Fri May 03 15:08:47 2013 -0700 1.3 @@ -131,7 +131,6 @@ 1.4 public final Type methodHandleLookupType; 1.5 public final Type methodTypeType; 1.6 public final Type nativeHeaderType; 1.7 - public final Type nativeHeaderType_old; 1.8 public final Type throwableType; 1.9 public final Type errorType; 1.10 public final Type interruptedExceptionType; 1.11 @@ -526,7 +525,6 @@ 1.12 autoCloseableType.tsym); 1.13 trustMeType = enterClass("java.lang.SafeVarargs"); 1.14 nativeHeaderType = enterClass("java.lang.annotation.Native"); 1.15 - nativeHeaderType_old = enterClass("javax.tools.annotation.GenerateNativeHeader"); 1.16 lambdaMetafactory = enterClass("java.lang.invoke.LambdaMetafactory"); 1.17 functionalInterfaceType = enterClass("java.lang.FunctionalInterface"); 1.18
2.1 --- a/src/share/classes/com/sun/tools/javac/jvm/JNIWriter.java Fri May 03 10:17:12 2013 -0700 2.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/JNIWriter.java Fri May 03 15:08:47 2013 -0700 2.3 @@ -157,13 +157,6 @@ 2.4 if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0) 2.5 return false; 2.6 2.7 - /* temporary code for backwards compatibility */ 2.8 - for (Attribute.Compound a: c.annotations.getDeclarationAttributes()) { 2.9 - if (a.type.tsym == syms.nativeHeaderType_old.tsym) 2.10 - return true; 2.11 - } 2.12 - /* end of temporary code for backwards compatibility */ 2.13 - 2.14 for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { 2.15 if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0) 2.16 return true;
3.1 --- a/src/share/classes/javax/tools/annotation/GenerateNativeHeader.java Fri May 03 10:17:12 2013 -0700 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,47 +0,0 @@ 3.4 -/* 3.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 3.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.7 - * 3.8 - * This code is free software; you can redistribute it and/or modify it 3.9 - * under the terms of the GNU General Public License version 2 only, as 3.10 - * published by the Free Software Foundation. Oracle designates this 3.11 - * particular file as subject to the "Classpath" exception as provided 3.12 - * by Oracle in the LICENSE file that accompanied this code. 3.13 - * 3.14 - * This code is distributed in the hope that it will be useful, but WITHOUT 3.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 3.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 3.17 - * version 2 for more details (a copy is included in the LICENSE file that 3.18 - * accompanied this code). 3.19 - * 3.20 - * You should have received a copy of the GNU General Public License version 3.21 - * 2 along with this work; if not, write to the Free Software Foundation, 3.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 3.23 - * 3.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 3.25 - * or visit www.oracle.com if you need additional information or have any 3.26 - * questions. 3.27 - */ 3.28 - 3.29 -package javax.tools.annotation; 3.30 - 3.31 -import java.lang.annotation.*; 3.32 -import static java.lang.annotation.RetentionPolicy.*; 3.33 -import static java.lang.annotation.ElementType.*; 3.34 - 3.35 -/** 3.36 - * An annotation used to indicate that a native header file 3.37 - * should be generated for this class. 3.38 - * 3.39 - * Normally, the presence of native methods is a sufficient 3.40 - * indication of the need for a native header file. However, 3.41 - * in some cases, a class may contain constants of interest to 3.42 - * native code, without containing any native methods. 3.43 - * 3.44 - * @since 1.8 3.45 - */ 3.46 -@Documented 3.47 -@Target(TYPE) 3.48 -@Retention(SOURCE) 3.49 -public @interface GenerateNativeHeader { 3.50 -}
4.1 --- a/test/tools/javac/nativeHeaders/NativeHeaderTest.java Fri May 03 10:17:12 2013 -0700 4.2 +++ b/test/tools/javac/nativeHeaders/NativeHeaderTest.java Fri May 03 15:08:47 2013 -0700 4.3 @@ -1,5 +1,5 @@ 4.4 /* 4.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 4.6 + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 4.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4.8 * 4.9 * This code is free software; you can redistribute it and/or modify it 4.10 @@ -23,7 +23,7 @@ 4.11 4.12 /* 4.13 * @test 4.14 - * @bug 7150368 8003412 4.15 + * @bug 7150368 8003412 8000407 4.16 * @summary javac should include basic ability to generate native headers 4.17 */ 4.18 4.19 @@ -125,17 +125,6 @@ 4.20 } 4.21 4.22 @Test 4.23 - void oldAnnoTest(RunKind rk, GenKind gk) throws Exception { 4.24 - List<File> files = new ArrayList<File>(); 4.25 - files.add(createFile("p/C.java", 4.26 - "@javax.tools.annotation.GenerateNativeHeader class C { }")); 4.27 - 4.28 - Set<String> expect = createSet("C.h"); 4.29 - 4.30 - test(rk, gk, files, expect); 4.31 - } 4.32 - 4.33 - @Test 4.34 void annoTest(RunKind rk, GenKind gk) throws Exception { 4.35 List<File> files = new ArrayList<File>(); 4.36 files.add(createFile("p/C.java", 4.37 @@ -147,18 +136,6 @@ 4.38 } 4.39 4.40 @Test 4.41 - void oldAnnoNestedClassTest(RunKind rk, GenKind gk) throws Exception { 4.42 - List<File> files = new ArrayList<File>(); 4.43 - files.add(createFile("p/C.java", 4.44 - "class C { @javax.tools.annotation.GenerateNativeHeader class Inner { } }")); 4.45 - 4.46 - Set<String> expect = createSet("C_Inner.h"); 4.47 - if (gk == GenKind.FULL) expect.add("C.h"); 4.48 - 4.49 - test(rk, gk, files, expect); 4.50 - } 4.51 - 4.52 - @Test 4.53 void annoNestedClassTest(RunKind rk, GenKind gk) throws Exception { 4.54 List<File> files = new ArrayList<File>(); 4.55 files.add(createFile("p/C.java",
5.1 --- a/test/tools/javac/nativeHeaders/javahComparison/CompareTest.java Fri May 03 10:17:12 2013 -0700 5.2 +++ b/test/tools/javac/nativeHeaders/javahComparison/CompareTest.java Fri May 03 15:08:47 2013 -0700 5.3 @@ -1,5 +1,5 @@ 5.4 /* 5.5 - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. 5.6 + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. 5.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5.8 * 5.9 * This code is free software; you can redistribute it and/or modify it 5.10 @@ -23,7 +23,7 @@ 5.11 5.12 /* 5.13 * @test 5.14 - * @bug 7150368 8003412 5.15 + * @bug 7150368 8003412 8000407 5.16 * @summary javac should include basic ability to generate native headers 5.17 */ 5.18
6.1 --- a/test/tools/javac/nativeHeaders/javahComparison/TestClass2.java Fri May 03 10:17:12 2013 -0700 6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 6.3 @@ -1,36 +0,0 @@ 6.4 -/* 6.5 - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. 6.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6.7 - * 6.8 - * This code is free software; you can redistribute it and/or modify it 6.9 - * under the terms of the GNU General Public License version 2 only, as 6.10 - * published by the Free Software Foundation. 6.11 - * 6.12 - * This code is distributed in the hope that it will be useful, but WITHOUT 6.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 6.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 6.15 - * version 2 for more details (a copy is included in the LICENSE file that 6.16 - * accompanied this code). 6.17 - * 6.18 - * You should have received a copy of the GNU General Public License version 6.19 - * 2 along with this work; if not, write to the Free Software Foundation, 6.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 6.21 - * 6.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 6.23 - * or visit www.oracle.com if you need additional information or have any 6.24 - * questions. 6.25 - */ 6.26 - 6.27 -import javax.tools.annotation.GenerateNativeHeader; 6.28 - 6.29 -@GenerateNativeHeader 6.30 -public class TestClass2 { 6.31 - byte b; 6.32 - short s; 6.33 - int i; 6.34 - long l; 6.35 - float f; 6.36 - double d; 6.37 - Object o; 6.38 - String t; 6.39 -}
7.1 --- a/test/tools/javac/nativeHeaders/javahComparison/TestClass3.java Fri May 03 10:17:12 2013 -0700 7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 7.3 @@ -1,54 +0,0 @@ 7.4 -/* 7.5 - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. 7.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 7.7 - * 7.8 - * This code is free software; you can redistribute it and/or modify it 7.9 - * under the terms of the GNU General Public License version 2 only, as 7.10 - * published by the Free Software Foundation. 7.11 - * 7.12 - * This code is distributed in the hope that it will be useful, but WITHOUT 7.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 7.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 7.15 - * version 2 for more details (a copy is included in the LICENSE file that 7.16 - * accompanied this code). 7.17 - * 7.18 - * You should have received a copy of the GNU General Public License version 7.19 - * 2 along with this work; if not, write to the Free Software Foundation, 7.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 7.21 - * 7.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 7.23 - * or visit www.oracle.com if you need additional information or have any 7.24 - * questions. 7.25 - */ 7.26 - 7.27 -import javax.tools.annotation.GenerateNativeHeader; 7.28 - 7.29 -@GenerateNativeHeader 7.30 -public class TestClass3 { 7.31 - public int tc3; 7.32 - 7.33 - public class Inner1 { 7.34 - public int tc3i1; 7.35 - 7.36 - public class Inner1A { 7.37 - public int tc3i1i1a; 7.38 - } 7.39 - 7.40 - public class Inner1B { 7.41 - public int tc3i1i1b; 7.42 - } 7.43 - } 7.44 - 7.45 - public class Inner2 { 7.46 - public int tc321; 7.47 - 7.48 - public class Inner2A { 7.49 - public int tc3i2i2a; 7.50 - } 7.51 - 7.52 - public class Inner2B { 7.53 - public int tc3i2i2b; 7.54 - } 7.55 - } 7.56 -} 7.57 -