jdk/src/share/classes/java/lang/invoke/MethodHandles.java
changeset 16030 265a0d86c9ff
parent 14222 58f55d4dde46
child 16123 82033940e774
equal deleted inserted replaced
16020:b57c48f16179 16030:265a0d86c9ff
     1 /*
     1 /*
     2  * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2008, 2013, 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.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
  1207         private MethodHandle getDirectMethodCommon(byte refKind, Class<?> refc, MemberName method,
  1207         private MethodHandle getDirectMethodCommon(byte refKind, Class<?> refc, MemberName method,
  1208                                                    boolean doRestrict) throws IllegalAccessException {
  1208                                                    boolean doRestrict) throws IllegalAccessException {
  1209             checkMethod(refKind, refc, method);
  1209             checkMethod(refKind, refc, method);
  1210             if (method.isMethodHandleInvoke())
  1210             if (method.isMethodHandleInvoke())
  1211                 return fakeMethodHandleInvoke(method);
  1211                 return fakeMethodHandleInvoke(method);
  1212             MethodHandle mh = DirectMethodHandle.make(refc, method);
  1212             MethodHandle mh = DirectMethodHandle.make(refKind, refc, method);
  1213             mh = maybeBindCaller(method, mh);
  1213             mh = maybeBindCaller(method, mh);
  1214             mh = mh.setVarargs(method);
  1214             mh = mh.setVarargs(method);
  1215             if (doRestrict)
  1215             if (doRestrict)
  1216                 mh = restrictReceiver(method, mh, lookupClass());
  1216                 mh = restrictReceiver(method, mh, lookupClass());
  1217             return mh;
  1217             return mh;