1 /* |
1 /* |
2 * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 2017, 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. |
36 import java.util.regex.*; |
36 import java.util.regex.*; |
37 |
37 |
38 public class ClassVersionChecker { |
38 public class ClassVersionChecker { |
39 |
39 |
40 int errors; |
40 int errors; |
41 String[] jdk = {"", "1.6", "1.7", "1.8", "1.9"}; |
41 String[] jdk = {"", "1.6", "1.7", "1.8", "1.9", "1.10"}; |
42 File javaFile = null; |
42 File javaFile = null; |
43 |
43 |
44 public static void main(String[] args) throws Throwable { |
44 public static void main(String[] args) throws Throwable { |
45 new ClassVersionChecker().run(); |
45 new ClassVersionChecker().run(); |
46 } |
46 } |
56 /* -source (0=>empty,1=>1.2,...) X -target (0=>empty,1=>1.2,...) |
56 /* -source (0=>empty,1=>1.2,...) X -target (0=>empty,1=>1.2,...) |
57 * ver[0][0] => no -source or -target was given |
57 * ver[0][0] => no -source or -target was given |
58 * -1 => invalid combinations |
58 * -1 => invalid combinations |
59 */ |
59 */ |
60 int[][] ver = |
60 int[][] ver = |
61 {{53, -1, -1, -1, -1}, |
61 {{54, -1, -1, -1, -1, -1}, |
62 {53, 50, 51, 52, 53}, |
62 {54, 50, 51, 52, 53, 54}, |
63 {53, -1, 51, 52, 53}, |
63 {54, -1, 51, 52, 53, 54}, |
64 {53, -1, -1, 52, 53}}; |
64 {54, -1, -1, 52, 53, 54}, |
|
65 {54, -1, -1, -1, 53, 54}}; |
65 |
66 |
66 // Loop to run all possible combinations of source/target values |
67 // Loop to run all possible combinations of source/target values |
67 for (int i = 0; i< ver.length; i++) { |
68 for (int i = 0; i< ver.length; i++) { |
68 for (int j = 0 ; j< ver[i].length; j++) { |
69 for (int j = 0 ; j< ver[i].length; j++) { |
69 if(ver[i][j] != -1) { |
70 if(ver[i][j] != -1) { |