1 /* |
1 /* |
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
103 |
103 |
104 public static void main(String... args) throws Exception { |
104 public static void main(String... args) throws Exception { |
105 |
105 |
106 //create default shared JavaCompiler - reused across multiple compilations |
106 //create default shared JavaCompiler - reused across multiple compilations |
107 JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); |
107 JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); |
108 StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null); |
108 try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) { |
109 |
109 |
110 for (ParameterListKind plk : ParameterListKind.values()) { |
110 for (ParameterListKind plk : ParameterListKind.values()) { |
111 for (ParameterKind pk : ParameterKind.values()) { |
111 for (ParameterKind pk : ParameterKind.values()) { |
112 for (ArrowKind ak : ArrowKind.values()) { |
112 for (ArrowKind ak : ArrowKind.values()) { |
113 for (ExprKind ek : ExprKind.values()) { |
113 for (ExprKind ek : ExprKind.values()) { |
114 new BadLambdaExpr(plk, pk, ak, ek).run(comp, fm); |
114 new BadLambdaExpr(plk, pk, ak, ek).run(comp, fm); |
|
115 } |
115 } |
116 } |
116 } |
117 } |
117 } |
118 } |
|
119 System.out.println("Total check executed: " + checkCount); |
118 } |
120 } |
119 System.out.println("Total check executed: " + checkCount); |
|
120 } |
121 } |
121 |
122 |
122 ParameterListKind plk; |
123 ParameterListKind plk; |
123 ParameterKind pk; |
124 ParameterKind pk; |
124 ArrowKind ak; |
125 ArrowKind ak; |