Thu, 05 May 2016 19:09:54 +0300
8152927: Incorrect GPL header in StubFactoryDynamicBase.java reported
Reviewed-by: alanb
duke@1 | 1 | /* |
aefimov@1284 | 2 | * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. |
duke@1 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | * |
duke@1 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@158 | 7 | * published by the Free Software Foundation. Oracle designates this |
duke@1 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@158 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
duke@1 | 10 | * |
duke@1 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 15 | * accompanied this code). |
duke@1 | 16 | * |
duke@1 | 17 | * You should have received a copy of the GNU General Public License version |
duke@1 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 20 | * |
ohair@158 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@158 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@158 | 23 | * questions. |
duke@1 | 24 | */ |
duke@1 | 25 | |
duke@1 | 26 | package com.sun.corba.se.impl.presentation.rmi ; |
duke@1 | 27 | |
msheppar@560 | 28 | import java.io.SerializablePermission; |
duke@1 | 29 | import java.lang.reflect.InvocationHandler ; |
duke@1 | 30 | import java.lang.reflect.Proxy ; |
duke@1 | 31 | |
duke@1 | 32 | import com.sun.corba.se.spi.presentation.rmi.PresentationManager ; |
duke@1 | 33 | import com.sun.corba.se.spi.presentation.rmi.DynamicStub ; |
duke@1 | 34 | |
duke@1 | 35 | import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ; |
duke@1 | 36 | import com.sun.corba.se.spi.orbutil.proxy.LinkedInvocationHandler ; |
duke@1 | 37 | |
duke@1 | 38 | public abstract class StubFactoryDynamicBase extends StubFactoryBase |
duke@1 | 39 | { |
duke@1 | 40 | protected final ClassLoader loader ; |
duke@1 | 41 | |
msheppar@560 | 42 | private static Void checkPermission() { |
msheppar@560 | 43 | SecurityManager sm = System.getSecurityManager(); |
msheppar@560 | 44 | if (sm != null) { |
msheppar@560 | 45 | sm.checkPermission(new SerializablePermission( |
msheppar@560 | 46 | "enableSubclassImplementation")); |
msheppar@560 | 47 | } |
msheppar@560 | 48 | return null; |
msheppar@560 | 49 | } |
duke@1 | 50 | |
msheppar@560 | 51 | private StubFactoryDynamicBase(Void unused, |
msheppar@560 | 52 | PresentationManager.ClassData classData, ClassLoader loader) { |
msheppar@560 | 53 | super(classData); |
duke@1 | 54 | // this.loader must not be null, or the newProxyInstance call |
duke@1 | 55 | // will fail. |
duke@1 | 56 | if (loader == null) { |
duke@1 | 57 | ClassLoader cl = Thread.currentThread().getContextClassLoader(); |
duke@1 | 58 | if (cl == null) |
duke@1 | 59 | cl = ClassLoader.getSystemClassLoader(); |
duke@1 | 60 | this.loader = cl ; |
duke@1 | 61 | } else { |
duke@1 | 62 | this.loader = loader ; |
duke@1 | 63 | } |
duke@1 | 64 | } |
duke@1 | 65 | |
msheppar@560 | 66 | public StubFactoryDynamicBase( PresentationManager.ClassData classData, |
msheppar@560 | 67 | ClassLoader loader ) |
msheppar@560 | 68 | { |
msheppar@560 | 69 | this (checkPermission(), classData, loader); |
msheppar@560 | 70 | } |
msheppar@560 | 71 | |
duke@1 | 72 | public abstract org.omg.CORBA.Object makeStub() ; |
duke@1 | 73 | } |