Mercurial > hg > truffle
annotate test/compiler/7082949/Test7082949.java @ 4862:f457154eee8b
7140882: Don't return booleans from methods returning pointers
Summary: Changed "return false" to "return NULL"
Reviewed-by: dholmes, rottenha
Contributed-by: dbhole@redhat.com
author | brutisso |
---|---|
date | Mon, 30 Jan 2012 12:36:49 +0100 |
parents | ac8738449b6f |
children |
rev | line source |
---|---|
3891
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
1 /* |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
4 * |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
8 * |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
13 * accompanied this code). |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
14 * |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
18 * |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
21 * questions. |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
22 * |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
23 */ |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
24 |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
25 /** |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
26 * @test |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
27 * @bug 7082949 |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
28 * @summary JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
29 * |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
30 * @run main Test7082949 |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
31 */ |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
32 |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
33 import java.lang.invoke.*; |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
34 import static java.lang.invoke.MethodHandles.*; |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
35 import static java.lang.invoke.MethodType.*; |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
36 |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
37 public class Test7082949 implements Runnable { |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
38 public static void main(String... args) throws Throwable { |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
39 new Thread(new Test7082949()).start(); |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
40 } |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
41 |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
42 public static Test7082949 test() { |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
43 return null; |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
44 } |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
45 |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
46 public void run() { |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
47 try { |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
48 MethodHandle m1 = MethodHandles.lookup().findStatic(Test7082949.class, "test", methodType(Test7082949.class)); |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
49 Test7082949 v = (Test7082949)m1.invokeExact(); |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
50 } catch (Throwable t) { |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
51 t.printStackTrace(); |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
52 } |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
53 } |
ac8738449b6f
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
never
parents:
diff
changeset
|
54 } |