001/*
002 * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation.
008 *
009 * This code is distributed in the hope that it will be useful, but WITHOUT
010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
011 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
012 * version 2 for more details (a copy is included in the LICENSE file that
013 * accompanied this code).
014 *
015 * You should have received a copy of the GNU General Public License version
016 * 2 along with this work; if not, write to the Free Software Foundation,
017 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
018 *
019 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
020 * or visit www.oracle.com if you need additional information or have any
021 * questions.
022 */
023package jdk.internal.jvmci.hotspot;
024
025import jdk.internal.jvmci.meta.*;
026
027/**
028 * Implementation of {@link JavaMethod} for unresolved HotSpot methods.
029 */
030public final class HotSpotMethodUnresolved extends HotSpotMethod {
031
032    private final Signature signature;
033    protected JavaType holder;
034
035    public HotSpotMethodUnresolved(String name, Signature signature, JavaType holder) {
036        super(name);
037        this.holder = holder;
038        this.signature = signature;
039    }
040
041    @Override
042    public Signature getSignature() {
043        return signature;
044    }
045
046    @Override
047    public JavaType getDeclaringClass() {
048        return holder;
049    }
050
051    @Override
052    public int hashCode() {
053        return super.hashCode();
054    }
055
056    @Override
057    public boolean equals(Object obj) {
058        if (this == obj) {
059            return true;
060        }
061        if (obj == null || !(obj instanceof HotSpotMethodUnresolved)) {
062            return false;
063        }
064        HotSpotMethodUnresolved that = (HotSpotMethodUnresolved) obj;
065        return this.name.equals(that.name) && this.signature.equals(that.signature) && this.holder.equals(that.holder);
066    }
067}