annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/jvmci/logging/ProxyUtil.java @ 21528:513f8d0ae27d

merge fixes
author Doug Simon <doug.simon@oracle.com>
date Fri, 22 May 2015 23:58:35 +0200
parents 07b088d61d5d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5529
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
21527
07b088d61d5d added HotSpotJVMCIRuntime* classes, replaced references to HotSpotGraalRuntime in VM with HotSpotJVMCIRuntime (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
2 * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
5529
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
21527
07b088d61d5d added HotSpotJVMCIRuntime* classes, replaced references to HotSpotGraalRuntime in VM with HotSpotJVMCIRuntime (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
23 package com.oracle.graal.hotspot.jvmci.logging;
5529
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25 import java.util.*;
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
26
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5529
diff changeset
27 public final class ProxyUtil {
5529
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
28
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29 public static Class<?>[] getAllInterfaces(Class<?> clazz) {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5529
diff changeset
30 HashSet<Class<?>> interfaces = new HashSet<>();
5529
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
31 getAllInterfaces(clazz, interfaces);
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32 return interfaces.toArray(new Class<?>[interfaces.size()]);
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33 }
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35 private static void getAllInterfaces(Class<?> clazz, HashSet<Class<?>> interfaces) {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 5529
diff changeset
36 for (Class<?> iface : clazz.getInterfaces()) {
5529
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 if (!interfaces.contains(iface)) {
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38 interfaces.add(iface);
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 getAllInterfaces(iface, interfaces);
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 }
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 }
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 if (clazz.getSuperclass() != null) {
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43 getAllInterfaces(clazz.getSuperclass(), interfaces);
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44 }
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 }
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46 }