author | jjg |
Thu, 31 Mar 2016 15:20:50 -0700 | |
changeset 36778 | e04318f39f92 |
parent 36526 | 3b41f1c69604 |
permissions | -rw-r--r-- |
33706
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
1 |
/* |
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
2 |
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
33706
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
4 |
* |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
8 |
* |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
13 |
* accompanied this code). |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
14 |
* |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
18 |
* |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
21 |
* questions. |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
22 |
*/ |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
23 |
|
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
24 |
/* |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
25 |
* @test |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
26 |
* @bug 8129740 8133111 |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
27 |
* @summary Incorrect class file created when passing lambda in inner class constructor |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
28 |
* @library /tools/lib |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
29 |
* @modules jdk.compiler/com.sun.tools.javac.api |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
30 |
* jdk.compiler/com.sun.tools.javac.main |
36526 | 31 |
* jdk.jdeps/com.sun.tools.javap |
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
32 |
* @build toolbox.ToolBox |
33706
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
33 |
* @run compile -XD-printsource SourceForTranslation.java |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
34 |
* @run main SourceToSourceTranslationTest |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
35 |
*/ |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
36 |
|
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
37 |
import java.nio.file.Path; |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
38 |
import java.nio.file.Paths; |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
39 |
import java.util.List; |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
40 |
|
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
41 |
import toolbox.ToolBox; |
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
42 |
|
33706
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
43 |
public class SourceToSourceTranslationTest { |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
44 |
|
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
45 |
public static void main(String[] args) throws Exception { |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
46 |
ToolBox tb = new ToolBox(); |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
47 |
Path path1 = Paths.get(ToolBox.testClasses, "Universe.java"); |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
48 |
List<String> file1 = tb.readAllLines(path1); |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
49 |
|
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
50 |
Path path2 = Paths.get(ToolBox.testSrc, "Universe.java.out"); |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
51 |
List<String> file2 = tb.readAllLines(path2); |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
52 |
tb.checkEqual(file1, file2); |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
53 |
} |
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
54 |
|
0d21ecb55e6a
8129740: Incorrect class file created when passing lambda in inner class constructor
sadayapalam
parents:
diff
changeset
|
55 |
} |