From 4e4d678dc242ef9a1a4d3e8931b11a738bbefabe Mon Sep 17 00:00:00 2001 From: "igor%mir2.org" Date: Fri, 31 Dec 2004 01:27:00 +0000 Subject: [PATCH] Removal of deprecated features including WrapHandler --- .../src/org/mozilla/javascript/Context.java | 92 ------------------- .../org/mozilla/javascript/WrapHandler.java | 52 ----------- 2 files changed, 144 deletions(-) delete mode 100644 js/rhino/src/org/mozilla/javascript/WrapHandler.java diff --git a/js/rhino/src/org/mozilla/javascript/Context.java b/js/rhino/src/org/mozilla/javascript/Context.java index f7dbe510001c..57d7831a7fe2 100644 --- a/js/rhino/src/org/mozilla/javascript/Context.java +++ b/js/rhino/src/org/mozilla/javascript/Context.java @@ -613,16 +613,6 @@ public class Context ContextFactory.getGlobal().addListener(listener); } - /** - * @deprecated - * @see ContextFactory#seal() - * @see ContextFactory#getGlobal() - */ - public static void disableStaticContextListening() - { - ContextFactory.getGlobal().disableContextListening(); - } - /** * Get the current Context. * @@ -1414,16 +1404,6 @@ public class Context } } - /** - * @deprecated - * @see #decompileScript(Script script, int indent) - */ - public final String decompileScript(Script script, Scriptable scope, - int indent) - { - return decompileScript(script, indent); - } - /** * Decompile the script. *

@@ -2021,78 +2001,6 @@ public class Context { } - /** - * @deprecated - * Proxy to allow to use deprecated WrapHandler in place - * of WrapFactory. - */ - private static class WrapHandlerProxy extends WrapFactory - { - WrapHandler _handler; - - /** - * @deprecated - */ - WrapHandlerProxy(WrapHandler handler) - { - _handler = handler; - } - - public Object wrap(Context cx, Scriptable scope, - Object obj, Class staticType) - { - if (obj == null) { return obj; } - Object result = _handler.wrap(scope, obj, staticType); - if (result == null) { - result = super.wrap(cx, scope, obj, staticType); - } - return result; - } - - public Scriptable wrapNewObject(Context cx, Scriptable scope, - Object obj) - { - Object wrap = _handler.wrap(scope, obj, obj.getClass()); - if (wrap instanceof Scriptable) { - return (Scriptable)wrap; - } - if (wrap == null) { - return super.wrapNewObject(cx, scope, obj); - } - throw new RuntimeException - ("Please upgrade from WrapHandler to WrapFactory"); - } - } - - /** - * @deprecated - * @see #setWrapFactory(WrapFactory) - * @see WrapFactory - */ - public final void setWrapHandler(WrapHandler wrapHandler) - { - if (sealed) onSealedMutation(); - if (wrapHandler == null) { - setWrapFactory(new WrapFactory()); - } else { - setWrapFactory(new WrapHandlerProxy(wrapHandler)); - } - } - - /** - * @deprecated - * @see #getWrapFactory() - * @see WrapFactory - */ - public final WrapHandler getWrapHandler() - { - WrapFactory f = getWrapFactory(); - if (f instanceof WrapHandlerProxy) { - return ((WrapHandlerProxy)f)._handler; - } - return null; - } - /** * Set a WrapFactory for this Context. *

diff --git a/js/rhino/src/org/mozilla/javascript/WrapHandler.java b/js/rhino/src/org/mozilla/javascript/WrapHandler.java deleted file mode 100644 index 80cae8bd1e1f..000000000000 --- a/js/rhino/src/org/mozilla/javascript/WrapHandler.java +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Rhino code, released - * May 6, 1999. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1997-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * Marshall Cline - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License (the "GPL"), in which case the - * provisions of the GPL are applicable instead of those above. - * If you wish to allow use of your version of this file only - * under the terms of the GPL and not to allow others to use your - * version of this file under the NPL, indicate your decision by - * deleting the provisions above and replace them with the notice - * and other provisions required by the GPL. If you do not delete - * the provisions above, a recipient may use your version of this - * file under either the NPL or the GPL. - */ - -// API class - -package org.mozilla.javascript; - -/** -@deprecated As of Rhino 1.5 Release 4, use {@link WrapFactory}. -Note that when extending {@link WrapFactory} you should call -super.wrap(...) instead of returning null to get default behavior. -You should also take into account that -{@link WrapFactory#wrap(Context cx, Scriptable scope, Object obj, Class cls)} -can be called when obj == null -*/ -public interface WrapHandler { - - public Object wrap(Scriptable scope, Object obj, Class staticType); - -}