Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/langtools/tools/javac/6257443/T6257443.java
41149 views
1
/*
2
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
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
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
/**
25
* @test
26
* @bug 6257443 6350124 6357979
27
* @summary compiler can produce a .class file in some source output modes
28
*
29
* @compile package-info.java
30
* @run main/othervm T6257443 -yes foo/package-info.class
31
*
32
* @clean foo.package-info
33
*
34
* @compile -printsource package-info.java
35
* @run main/othervm T6257443 -no foo/package-info.class
36
*/
37
38
import java.net.URL;
39
40
public class T6257443
41
{
42
public static void main(String[] args) {
43
if (args.length != 2)
44
throw new Error("wrong number of args");
45
46
String state = args[0];
47
String file = args[1];
48
49
if (state.equals("-no")) {
50
URL u = find(file);
51
if (u != null)
52
throw new Error("file " + file + " found unexpectedly");
53
}
54
else if (state.equals("-yes")) {
55
URL u = find(file);
56
if (u == null)
57
throw new Error("file " + file + " not found");
58
}
59
else
60
throw new Error("bad args");
61
}
62
63
public static URL find(String path) {
64
return T6257443.class.getClassLoader().getSystemResource(path);
65
}
66
}
67
68