Revision: 6051 Author: [email protected] Date: Mon Aug 31 14:02:45 2009 Log: Give the hosted mode JavaScriptObject implementation class a public constructor so it can be instantiated without violating access.
Review by: spoon http://code.google.com/p/google-web-toolkit/source/detail?r=6051 Modified: /trunk/dev/core/src/com/google/gwt/dev/shell/JsValueGlue.java /trunk/dev/core/src/com/google/gwt/dev/shell/rewrite/WriteJsoImpl.java ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/shell/JsValueGlue.java Tue Apr 29 08:38:38 2008 +++ /trunk/dev/core/src/com/google/gwt/dev/shell/JsValueGlue.java Mon Aug 31 14:02:45 2009 @@ -214,7 +214,6 @@ // Instantiate the JSO class. Class<?> jsoType = Class.forName(JSO_IMPL_CLASS, true, classLoader); Constructor<?> ctor = jsoType.getDeclaredConstructor(); - ctor.setAccessible(true); jso = ctor.newInstance(); // Set the reference field to this JsValue using reflection. ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/shell/rewrite/WriteJsoImpl.java Tue Feb 24 14:28:39 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/shell/rewrite/WriteJsoImpl.java Mon Aug 31 14:02:45 2009 @@ -93,6 +93,17 @@ writeTrampoline(entry.getKey(), entry.getValue()); } } + + @Override + public MethodVisitor visitMethod(int access, String name, String desc, + String signature, String[] exceptions) { + if (isCtor(name)) { + // make the JavaScriptObject$ constructor public + access &= ~(Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED); + access |= Opcodes.ACC_PUBLIC; + } + return super.visitMethod(access, name, desc, signature, exceptions); + } /** * JSO methods are implemented as flyweight style, with the instance being --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
