[gwt-contrib] Re: GWTCanvas status?
I added a patch to fix the GWTCanvas bug that caused me the most grief: http://code.google.com/p/google-web-toolkit-incubator/issues/detail?id=293#c1 Turned out, this problem was a basic one with IE's VML support: right after you apply DOM.removeChild to remove a child that contains VML, the fill and stroke colors, as well as the stroke widths that you so laboriously constructed during various strokes and fills, are all simply dropped by IE, as I confirmed by inspecting the inner HTML before and after the removeChild call within Widget.removeFromParent. Do you think it is worthwhile to fix the remaining GWTCanvas bugs? My thinking is that it is on two levels: 1) because GWTCanvas is available now and 2) because any more advanced SVG + VML system will still have to fix such (mostly low-level VML-related stuff, is my guess) bugs, so these fixes should be useful in the new system, too. Couple of questions/observations obliquely related to this patch: o If it's just VML, features dropping out, fixing this within just GWT vector graphics Widgets makes sense. But what if IE drops non-VML stuff in removeChild? Just a thought: might be a good test case to check the innerHTML before and after removeChild with some omnibus HTML to assure IE doesn't drop any other important stuff off. The experience of seeing features respectably documented in the VML API (http://www.w3.org/TR/NOTE-VML) just dropping out more or less at random inspires paranoia. o Has anyone compared GWTCanvas, performance-wise, to excanvas.js? Better: line-for-line translation of excanvas.js to Java, gwt-compile, does it yield any performance boost? How much? A lot of Javascript gurus known excanvas.js so could be an interesting kind of benchmark. On Jul 19, 12:41 am, John Gunther wrote: > Appreciate your replies, I now have a much better sense of where GWT > vector graphics is heading. > > With my use of GWTCanvas, the fact that there was a per-pixel memory > cost with the canvas tag (that does not exist with VML) forced me to > do some extra work to "shrink-wrap" the canvas around each rendered > curve. So, I can imagine how having everything sort of work like VML > (element based rather than pixel based) could be a big consistency > plus. > > I also found Ray's argument that many have tried to emulate canvas > with VML and failed convincing. > > On the other hand: > > o The use of Flash would create a new proprietary dependency that does > not exist with GWTCanvas at present. > > o Though my vector graphics needs were limited (I only required a > canvas subset) I was able to do everything I wanted to using GWTCanvas > (though working around the IE bugs was a pain). > > o Relative to other browsers, with the feature subset I used, IE's > vector graphics rendering isn't nearly as slow as its HTML rendering. > So, once I figured out I needed to minimize stroke count, I was happy > with the IE rendering performance of GWTCanvas. > > From the perspective of a black-box user of GWTCanvas, except for the > IE bugs (which I was able to work around) it met my application's > needs well. Without it GChart would still be stuck in the visual getto > of HTML-only rendering. So I hope any improved system will preserve > GWTCanvas' many good features, such as being packaged as a Widget, and > having a reasonably low cost per widget (which made it possible for me > to give each curve it's own GWTCanvas, and update them > independently). > > My totally biased operational definition of if any new vector graphics > library is 'good': when I implement GChartCanvasLite using the new > library, my live demo and tests will 'just work', and run as fast or > faster than with the GWTCanvas based implementation. > > On Jul 17, 7:33 am, Joel Webber wrote: > > > Ray's basically right about this -- > > you can't simulate canvas on vml (extant attempts to do so with limited > > success notwithstanding). > > When > > GWTCanvas was originally designed, SVG performance on some browsers > > was absolutely atrocious, while Canvas and > > VML were basically acceptable. So Jaime and I attempted to design an API > > that would use Canvas and VML for a rendering layer, while trying to nudge > > the developer towards a use pattern that would work well in practice. > > > Since then, the situation has changed quite a lot. SVG performance on Gecko, > > WebKit, and Opera has finally gotten up to speed, making it possible (or at > > least a *lot* easier) to build a sensible scene-graph API that uses just VML > > and SVG. I strongly believe this will end up being a better API, because the > > rendering back-ends will be (more or less) equally capable and similarly > > constructed. > > > Dan Rice (cc'd) has started working on this approach, but > > it may be a little while before it sees the light of day. In the meantime, > > if you have patches for any of the issues you listed in GWTCanvas, don't > > hesitate to let us know. > > > Cheers, > > joel. > > > On Fri, Jul 17, 2009 at 12:
[gwt-contrib] [google-web-toolkit] r5828 commited - Moving StandardGeneratorContext out of hosted mode code; it's not host...
Revision: 5828 Author: sco...@google.com Date: Tue Jul 28 21:11:02 2009 Log: Moving StandardGeneratorContext out of hosted mode code; it's not hosted-mode specific. Review by: bobv http://code.google.com/p/google-web-toolkit/source/detail?r=5828 Added: /trunk/dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java Deleted: /trunk/dev/core/src/com/google/gwt/dev/shell/StandardGeneratorContext.java Modified: /trunk/dev/core/src/com/google/gwt/dev/Precompile.java /trunk/dev/core/src/com/google/gwt/dev/cfg/RuleGenerateWith.java /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationState.java /trunk/dev/core/src/com/google/gwt/dev/jdt/RebindPermutationOracle.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/FragmentLoaderCreator.java /trunk/dev/core/src/com/google/gwt/dev/shell/ShellModuleSpaceHost.java /trunk/dev/core/src/com/google/gwt/dev/shell/StandardRebindOracle.java /trunk/dev/core/test/com/google/gwt/dev/javac/CompilationStateTest.java /trunk/dev/core/test/com/google/gwt/dev/shell/StandardGeneratorContextTest.java === --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java Tue Jul 28 21:11:02 2009 @@ -0,0 +1,582 @@ +/* + * Copyright 2007 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.dev.javac; + +import com.google.gwt.core.ext.Generator; +import com.google.gwt.core.ext.GeneratorContext; +import com.google.gwt.core.ext.PropertyOracle; +import com.google.gwt.core.ext.TreeLogger; +import com.google.gwt.core.ext.UnableToCompleteException; +import com.google.gwt.core.ext.linker.Artifact; +import com.google.gwt.core.ext.linker.ArtifactSet; +import com.google.gwt.core.ext.linker.GeneratedResource; +import com.google.gwt.core.ext.linker.impl.StandardGeneratedResource; +import com.google.gwt.core.ext.typeinfo.JClassType; +import com.google.gwt.core.ext.typeinfo.TypeOracle; +import com.google.gwt.dev.cfg.ModuleDef; +import com.google.gwt.dev.javac.impl.FileCompilationUnit; +import com.google.gwt.dev.resource.ResourceOracle; +import com.google.gwt.dev.util.DiskCache; +import com.google.gwt.dev.util.Util; +import com.google.gwt.dev.util.collect.HashSet; +import com.google.gwt.dev.util.collect.IdentityHashMap; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedSet; + +/** + * Manages generators and generated units during a single compilation. + */ +public class StandardGeneratorContext implements GeneratorContext { + + /** + * Extras added to {...@link CompilationUnit}. + */ + public static interface Generated { +void abort(); + +void commit(); + +/** + * Returns the strong hash of the source. + */ +String getStrongHash(); + +String getTypeName(); + } + + /** + * This compilation unit acts as a normal compilation unit as well as a buffer + * into which generators can write their source. A controller should ensure + * that source isn't requested until the generator has finished writing it. + * This version is backed by {...@link StandardGeneratorContext#diskCache}. + */ + private static class GeneratedUnit extends CompilationUnit implements + Generated { + +/** + * A token to retrieve this object's bytes from the disk cache. + */ +private long cacheToken; + +private long creationTime; + +private String strongHash; // cache so that refreshes work correctly + +private StringWriter sw; + +private final String typeName; + +public GeneratedUnit(StringWriter sw, String typeName) { + this.typeName = typeName; + this.sw = sw; +} + +public void abort() { + sw = null; +} + +/** + * Finalizes the source and adds this compilation unit to the host. + */ +public void commit() { + cacheToken = diskCache.writeString(sw.toString()); + sw = null; + creationTime = System.currentTimeMillis(); +} + +@Override +public String getDisplayLocation() { + return "transient source for " + typeName; +} + +@Override +public long getLastModi
[gwt-contrib] [google-web-toolkit] r5830 commited - Clean up a couple of problems in JSORestrictionsChecker, and add a tes...
Revision: 5830 Author: j...@google.com Date: Tue Jul 28 21:24:29 2009 Log: Clean up a couple of problems in JSORestrictionsChecker, and add a test that would have caught the problem directly. Improve diagnostics for a test failure in UnitTestTreeLogger. http://code.google.com/p/google-web-toolkit/source/detail?r=5830 Modified: /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/JSORestrictionsChecker.java /changes/jat/ihm/dev/core/src/com/google/gwt/dev/util/UnitTestTreeLogger.java /changes/jat/ihm/dev/core/test/com/google/gwt/dev/javac/JSORestrictionsTest.java === --- /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/JSORestrictionsChecker.java Tue Jul 28 15:07:40 2009 +++ /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/JSORestrictionsChecker.java Tue Jul 28 21:24:29 2009 @@ -454,7 +454,9 @@ this.typeOracle = typeOracle; jsoClass = typeOracle.findType(InternalName.toSourceName(JSO_INTERNAL_NAME)); jsoSubtypes = new IdentityHashSet(); -Collections.addAll(jsoSubtypes, jsoClass.getSubtypes()); +if (jsoClass != null) { + Collections.addAll(jsoSubtypes, jsoClass.getSubtypes()); +} } public boolean check(CompilationUnit unit) { @@ -508,6 +510,13 @@ CategorizedProblem.CAT_MEMBER, ERR_INSTANCE_METHOD_NONFINAL, typeName + "." + methodName)); } + } +} +// check for overridden methods +for (JMethod method : type.getMethods()) { + String methodName = method.getName(); + if (!method.isPrivate() && !method.isStatic() + && method.isConstructor() == null) { JParameter[] methodParams = method.getParameters(); int n = methodParams.length; JType[] methodParamTypes = new JType[n]; === --- /changes/jat/ihm/dev/core/src/com/google/gwt/dev/util/UnitTestTreeLogger.java Tue Jul 28 15:07:40 2009 +++ /changes/jat/ihm/dev/core/src/com/google/gwt/dev/util/UnitTestTreeLogger.java Tue Jul 28 21:24:29 2009 @@ -183,8 +183,9 @@ } public void assertCorrectLogEntries() { -Assert.assertEquals("Log lengths do not match", expectedEntries.size(), -actualEntries.size()); +if (expectedEntries.size() != actualEntries.size()) { + Assert.fail("Wrong log count: expected=" + expectedEntries + ", actual=" + actualEntries); +} for (int i = 0, c = expectedEntries.size(); i < c; ++i) { assertCorrectLogEntry(expectedEntries.get(i), actualEntries.get(i)); } === --- /changes/jat/ihm/dev/core/test/com/google/gwt/dev/javac/JSORestrictionsTest.java Tue Jul 28 15:07:40 2009 +++ /changes/jat/ihm/dev/core/test/com/google/gwt/dev/javac/JSORestrictionsTest.java Tue Jul 28 21:24:29 2009 @@ -247,6 +247,23 @@ shouldGenerateNoError(code); } + + public void testStaticMethod() { +StringBuffer code = new StringBuffer(); +code.append("import com.google.gwt.core.client.JavaScriptObject;\n"); +code.append("public class Buggy {\n"); +code.append(" public static class Parent extends JavaScriptObject {\n"); +code.append("public static void foo() { }\n"); +code.append("protected Parent() { }\n"); +code.append(" }\n"); +code.append(" public static class Child extends Parent {\n"); +code.append("public static void foo() { }\n"); +code.append("protected Child() { }\n"); +code.append(" }\n"); +code.append("}\n"); + +shouldGenerateNoError(code); + } public void testTagInterfaces() { StringBuffer goodCode = new StringBuffer(); --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: bombarded by commit messages?
FWIW, the slew of commit messages are all new, they're not dups. The messages weren't getting through, and they'd been building up for a while. So when I, er, took a plunger to it, they all came through at once. On Tue, Jul 28, 2009 at 10:33 PM, Arthur Kalmenson wrote: > > Finger slipped? :P > > On Jul 28, 8:15 pm, Scott Blum wrote: > > Nothing to see here... move along please. > > > > > > > > On Tue, Jul 28, 2009 at 8:14 PM, Ray Cromwell > wrote: > > > > > Anyone else just get bombarded by about 20+ old commit messages? I got > > > messages from stuff committed days ago. > > > > > -Ray > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5827 commited - Remove CompilationUnit's dependency on hosted mode code....
Revision: 5827 Author: sco...@google.com Date: Tue Jul 28 21:10:32 2009 Log: Remove CompilationUnit's dependency on hosted mode code. Review by: bobv http://code.google.com/p/google-web-toolkit/source/detail?r=5827 Added: /trunk/dev/core/test/com/google/gwt/dev/javac/GeneratedClassnameTest.java Deleted: /trunk/dev/core/test/com/google/gwt/dev/shell/GeneratedClassnameTest.java Modified: /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java /trunk/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java === --- /dev/null +++ /trunk/dev/core/test/com/google/gwt/dev/javac/GeneratedClassnameTest.java Tue Jul 28 21:10:32 2009 @@ -0,0 +1,27 @@ +package com.google.gwt.dev.javac; + +import junit.framework.TestCase; + +public class GeneratedClassnameTest extends TestCase { + + /** + * Test if {...@link CompilingClassLoader#isClassnameGenerated(String)} works + * correctly. + */ + public void testGeneratedClassnames() { +String namesToAccept[] = { +"Test$1", "Test$10", "Test$Foo$1", "Test$1$Foo", "Test$10$Foo", +"$$345", "Test$1$Foo$", "Test$1Foo", "Test$2Foo", "Test$Foo$1Bar"}; +String namesToReject[] = {"Test1", "TestFoo", "Test$Foo$Bar", "$345"}; + +for (String name : namesToAccept) { + assertTrue("className = " + name + " should have been accepted", + CompilationUnit.isClassnameGenerated(name)); +} + +for (String name : namesToReject) { + assertFalse("className = " + name + " should not have been accepted", + CompilationUnit.isClassnameGenerated(name)); +} + } +} === --- /trunk/dev/core/test/com/google/gwt/dev/shell/GeneratedClassnameTest.java Fri Feb 6 13:06:24 2009 +++ /dev/null @@ -1,27 +0,0 @@ -package com.google.gwt.dev.shell; - -import junit.framework.TestCase; - -public class GeneratedClassnameTest extends TestCase { - - /** - * Test if {...@link CompilingClassLoader#isClassnameGenerated(String)} works - * correctly. - */ - public void testGeneratedClassnames() { -String namesToAccept[] = { -"Test$1", "Test$10", "Test$Foo$1", "Test$1$Foo", "Test$10$Foo", -"$$345", "Test$1$Foo$", "Test$1Foo", "Test$2Foo", "Test$Foo$1Bar"}; -String namesToReject[] = {"Test1", "TestFoo", "Test$Foo$Bar", "$345"}; - -for (String name : namesToAccept) { - assertTrue("className = " + name + " should have been accepted", - CompilingClassLoader.isClassnameGenerated(name)); -} - -for (String name : namesToReject) { - assertFalse("className = " + name + " should not have been accepted", - CompilingClassLoader.isClassnameGenerated(name)); -} - } -} === --- /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java Wed Apr 29 18:23:37 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java Tue Jul 28 21:10:32 2009 @@ -20,7 +20,6 @@ import com.google.gwt.dev.asm.Opcodes; import com.google.gwt.dev.asm.commons.EmptyVisitor; import com.google.gwt.dev.jdt.TypeRefVisitor; -import com.google.gwt.dev.shell.CompilingClassLoader; import com.google.gwt.dev.util.DiskCache; import com.google.gwt.dev.util.Util; import com.google.gwt.dev.util.collect.HashMap; @@ -48,6 +47,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.regex.Pattern; /** * Encapsulates the state of a single active compilation unit in a particular @@ -117,7 +117,7 @@ * javac weirdness issue where javac refers a class but does not * generate it. */ -if (CompilingClassLoader.isClassnameGenerated(lookupName) +if (isClassnameGenerated(lookupName) && !allGeneratedClasses.contains(lookupName)) { allGeneratedClasses.add(lookupName); } @@ -263,6 +263,27 @@ return true; } } + + private static final Pattern GENERATED_CLASSNAME_PATTERN = Pattern.compile(".+\\$\\d.*"); + + /** + * Checks if the class names is generated. Accepts any classes whose names + * match .+$\d.* (handling named classes within anonymous classes and multiple + * named classes of the same name in a class, but in different methods). + * Checks if the class or any of its enclosing classes are anonymous or + * synthetic. + * + * If new compilers have different conventions for anonymous and synthetic + * classes, this code needs to be updated. + * + * + * @param className name of the class to be checked. + * @return true iff class or any of its enclosing classes are anonymous or + * synthetic. + */ + public static boolean isClassnameGenerated(String className) { +return GENERATED_CLASSNAME_PATTERN.matcher(className).matches(); + } private static Set computeFileNameRefs( CompilationUnitDeclaration cud, @@ -561,6 +582,6 @@ if (!cc.getRealClass
[gwt-contrib] [google-web-toolkit] r5826 commited - Remove TypeOracle dependency on hosted mode code....
Revision: 5826 Author: sco...@google.com Date: Tue Jul 28 21:10:12 2009 Log: Remove TypeOracle dependency on hosted mode code. Review by: bobv http://code.google.com/p/google-web-toolkit/source/detail?r=5826 Modified: /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java === --- /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java Wed Apr 1 13:03:34 2009 +++ /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java Tue Jul 28 21:10:12 2009 @@ -17,7 +17,6 @@ import com.google.gwt.core.ext.typeinfo.JWildcardType.BoundType; import com.google.gwt.dev.jjs.InternalCompilerException; -import com.google.gwt.dev.shell.JsValueGlue; import com.google.gwt.dev.util.collect.HashMap; import com.google.gwt.dev.util.collect.IdentityHashMap; @@ -118,8 +117,12 @@ * A reserved metadata tag to indicates that a field type, method return type * or method parameter type is intended to be parameterized. Note that * constructor type parameters are not supported at present. + * + * @deprecated gwt.typeArgs is not longer supported */ + @Deprecated public static final String TAG_TYPEARGS = "gwt.typeArgs"; + static final int MOD_ABSTRACT = 0x0001; static final int MOD_FINAL = 0x0002; static final int MOD_NATIVE = 0x0004; @@ -128,8 +131,8 @@ static final int MOD_PUBLIC = 0x0020; static final int MOD_STATIC = 0x0040; static final int MOD_TRANSIENT = 0x0080; - static final int MOD_VOLATILE = 0x0100; + static final Annotation[] NO_ANNOTATIONS = new Annotation[0]; static final JClassType[] NO_JCLASSES = new JClassType[0]; static final JConstructor[] NO_JCTORS = new JConstructor[0]; @@ -141,6 +144,8 @@ static final String[][] NO_STRING_ARR_ARR = new String[0][]; static final String[] NO_STRINGS = new String[0]; + private static final String JSO_CLASS = "com.google.gwt.core.client.JavaScriptObject"; + static String[] modifierBitsToNames(int bits) { List strings = new ArrayList(); @@ -649,7 +654,7 @@ * Updates the list of jsoSingleImpl types from recently-added types. */ private void computeSingleJsoImplData(JClassType... newTypes) { -JClassType jsoType = findType(JsValueGlue.JSO_CLASS); +JClassType jsoType = findType(JSO_CLASS); if (jsoType == null) { return; } @@ -826,7 +831,7 @@ } private void removeSingleJsoImplData(JClassType... types) { -JClassType jsoType = findType(JsValueGlue.JSO_CLASS); +JClassType jsoType = findType(JSO_CLASS); if (jsoType == null) { return; } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5825 commited - Moving Jsni helper class into com.google.gwt.dev.shell with other host...
Revision: 5825 Author: sco...@google.com Date: Tue Jul 28 21:10:00 2009 Log: Moving Jsni helper class into com.google.gwt.dev.shell with other hosted mode code. Review by: bobv http://code.google.com/p/google-web-toolkit/source/detail?r=5825 Added: /trunk/dev/core/src/com/google/gwt/dev/shell/Jsni.java /trunk/dev/oophm/overlay/com/google/gwt/dev/shell/Jsni.java Deleted: /trunk/dev/core/src/com/google/gwt/dev/util/Jsni.java /trunk/dev/oophm/overlay/com/google/gwt/dev/util/Jsni.java Modified: /trunk/dev/core/src/com/google/gwt/dev/javac/JsniCollector.java /trunk/dev/core/src/com/google/gwt/dev/jdt/FindJsniRefVisitor.java /trunk/dev/linux/src/com/google/gwt/dev/shell/moz/ModuleSpaceMoz.java /trunk/dev/mac/src/com/google/gwt/dev/shell/mac/ModuleSpaceSaf.java /trunk/dev/oophm/src/com/google/gwt/dev/shell/ModuleSpaceOOPHM.java /trunk/dev/windows/src/com/google/gwt/dev/shell/ie/ModuleSpaceIE6.java === --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/dev/shell/Jsni.java Tue Jul 28 21:10:00 2009 @@ -0,0 +1,130 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.dev.shell; + +import com.google.gwt.core.ext.TreeLogger; +import com.google.gwt.dev.javac.JsniMethod; +import com.google.gwt.dev.js.JsSourceGenerationVisitor; +import com.google.gwt.dev.js.ast.JsContext; +import com.google.gwt.dev.js.ast.JsExpression; +import com.google.gwt.dev.js.ast.JsFunction; +import com.google.gwt.dev.js.ast.JsNameRef; +import com.google.gwt.dev.js.ast.JsNode; +import com.google.gwt.dev.util.DefaultTextOutput; +import com.google.gwt.dev.util.TextOutput; + +/** + * Helper methods working with JSNI. + */ +public class Jsni { + + /** + * Generate source code, fixing up any JSNI references for hosted mode. + * + * + * + * Original + * Becomes + * + * + * @class::method(params)(args) + * + * ["@class::method(params)"](args) + * + * + * @class::method(params)(args) + * + * __static["@class::method(params)"](args) + * + * + * @class::field + * + * ["@class::field"] + * + * + * @class::field + * + * __static["@class::field"] + * + * + */ + private static class JsSourceGenWithJsniIdentFixup extends + JsSourceGenerationVisitor { +private final TextOutput out; + +public JsSourceGenWithJsniIdentFixup(TextOutput out) { + super(out); + this.out = out; +} + +@Override +public boolean visit(JsNameRef x, JsContext ctx) { + String ident = x.getIdent(); + if (ident.startsWith("@")) { +JsExpression q = x.getQualifier(); +if (q != null) { + accept(q); + out.print("[\""); + out.print(ident); + out.print("\"]"); +} else { + out.print("__static[\""); + out.print(ident); + out.print("\"]"); +} +return false; + } else { +return super.visit(x, ctx); + } +} + } + + public static final String JAVASCRIPTHOST_NAME = JavaScriptHost.class.getName(); + + /** + * Gets the body of a JSNI method, with Java refs escaped for hosted mode + * injection. + */ + public static String getJavaScriptForHostedMode(TreeLogger logger, + DispatchIdOracle dispatchInfo, JsniMethod jsniMethod) { +/* + * Surround the original JS body statements with a try/catch so that we can + * map JavaScript exceptions back into Java. Note that the method body + * itself will print curly braces, so we don't need them around the + * try/catch. + */ +String jsTry = "try "; +String jsCatch = " catch (e) {\n __static[\"@" + Jsni.JAVASCRIPTHOST_NAME ++ "::exceptionCaught(Ljava/lang/Object;)\"](e);\n" + "}\n"; +JsFunction func = jsniMethod.function(logger); +if (func == null) { + return null; +} +return jsTry + generateJavaScriptForHostedMode(func.getBody()) + jsCatch; + } + + /** + * Returns a string representing the source output of the JsNode, where all + * JSNI idents have been replaced with legal JavaScript for hosted mode. + */ + private static String generateJavaScriptForHostedMode(JsNode node) { +DefaultTextOutput out = new DefaultTextOutput(false); +JsSourceGenWithJsniIdentFixup vi = new JsSourceGenWithJsniIdentFixup(out); +vi.accept(node); +return out.toString(); + } + +} =
[gwt-contrib] Re: bombarded by commit messages?
Finger slipped? :P On Jul 28, 8:15 pm, Scott Blum wrote: > Nothing to see here... move along please. > > > > On Tue, Jul 28, 2009 at 8:14 PM, Ray Cromwell wrote: > > > Anyone else just get bombarded by about 20+ old commit messages? I got > > messages from stuff committed days ago. > > > -Ray --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: bombarded by commit messages?
Nothing to see here... move along please. On Tue, Jul 28, 2009 at 8:14 PM, Ray Cromwell wrote: > > Anyone else just get bombarded by about 20+ old commit messages? I got > messages from stuff committed days ago. > > -Ray > > > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] bombarded by commit messages?
Anyone else just get bombarded by about 20+ old commit messages? I got messages from stuff committed days ago. -Ray --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5763 commited - Updated the code-splitting wiki page with: the current splitting strat...
Revision: 5763 Author: sp...@google.com Date: Tue Jul 21 13:42:16 2009 Log: Updated the code-splitting wiki page with: the current splitting strategy and the current UI for browsing dependencies. http://code.google.com/p/google-web-toolkit/source/detail?r=5763 Modified: /wiki/CodeSplitting.wiki === --- /wiki/CodeSplitting.wikiThu Jun 11 13:10:53 2009 +++ /wiki/CodeSplitting.wikiTue Jul 21 13:42:16 2009 @@ -131,44 +131,36 @@ ==The results of code splitting== -THIS SECTION IS OUT OF DATE. -Lex Spoon (June 11, 2009) - Before going further, it is important to understand exactly what fragments the code splitter divides your code into. That way you can examine how the splitting went and work towards improving it. -One very important fragment is the initial download. This is fragment -number 0, and for the iframe linker it is emitted as a -file whose name ends with cache.html. When the application starts up, -the initial-download fragment is loaded. This fragment includes all -the code necessary to run the application up to any split point but -not past. When you start improving your code splitting, you should -probably start by trying to reduce the size of the initial download -fragment. Reducing this fragment causes the application to start up -quickly. +One very important fragment is the initial download. For the iframe +linker it is emitted as a file whose name ends with cache.html. When +the application starts up, the initial-download fragment is loaded. +This fragment includes all the code necessary to run the application +up to any split point but not past. When you start improving your code +splitting, you should probably start by trying to reduce the size of the +initial download fragment. Reducing this fragment causes the application +to start up quickly. There are a number of other code fragments generated in addition to this initial one. For the iframe linker, they are located -underneath a directory named deferredjs. For each split point -*i*, where the split points are numbered from 1 through *m*, -the following three fragments are generated: - -*Fragment i: an exclusive fragment.* This fragment includes all code -needed once split point *i* has been reached, but never needed until -then. It includes code that is exclusively needed by split point *i*. - -*Fragment m + 2`*`i - 1: a base fragment.* This fragment includes -the code needed to run split point *i*, assuming that split point *i* -is the first fragment to be reached. This one code download is -enough to run split point *i*. - -*Fragment m + 2`*`i: a leftovers fragment.* This fragment includes code -that is not in any of: any exclusive fragment, the initial download -fragment, or the base fragment for split point *i*. Once a base -fragment has loaded, the associated leftovers fragment is immediately -loaded in the background. It's a secondary concern, but once -the initial download is good, you might want to try and move code -from leftovers into exclusive fragments. +underneath a directory named deferredjs. Each split point +in the program will have an associated code fragment. In addition, +there is a "leftovers" code fragment for code that is not associated +with any specific split point. + +The code fragment associated with a split point is of +one of two kinds. Most frequently, it is an "exclusive" fragment. +An exclusive fragment contains code that is only needed once +that split point is activated. If the split point is an "initial" +split point, then it gets an "initial" code fragment rather than +an "exclusive" one. Unlike an exclusive fragment, an initial fragment +does not rely on anything in the leftovers fragment. However, +an initial fragment can only be loaded in its designated +initial load sequence; exclusive fragments have the benefit that +they can be loaded in any order. ==The Story of Your Compile (SOYC)== @@ -220,21 +212,15 @@ ==Fragment breakdown== -_This section is speculative, but is left as a placeholder until -all of the details are worked out._ - Since you are working on code splitting, you will next want to look at -the way the application splits up. Fragment 0 is the initial download, -and the others are described in the above section on the results of code -splitting. You can look both at the overall sizes of the fragments as well -as the contents of each one. +the way the application splits up. Click on any code subset +to see a size breakdown of the code in that fragment. The "total program" +option describes all of the code in the program. The other +options all correspond to individual code fragments. ==Dependencies== -_This section is speculative, but is left as a placeholder -until all of the details are worked out._ - At some point you will try to get something moved out of the initial download fragment, but the GWT compiler will put it there anyway. Sometimes you can quickly figure out w
[gwt-contrib] [google-web-toolkit] r5809 commited - These files are aleady in tools/lib/objectweb/asm....
Revision: 5809 Author: sco...@google.com Date: Tue Jul 28 09:20:13 2009 Log: These files are aleady in tools/lib/objectweb/asm. Review by: rjrjr (im) http://code.google.com/p/google-web-toolkit/source/detail?r=5809 Deleted: /tools/lib/asm --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5806 commited - Fix class resolution order problem after redoing how enclosing classes...
Revision: 5806 Author: j...@google.com Date: Mon Jul 27 16:23:55 2009 Log: Fix class resolution order problem after redoing how enclosing classes are handled. Minor name cleanups in CCL. http://code.google.com/p/google-web-toolkit/source/detail?r=5806 Modified: /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java /changes/jat/ihm/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java === --- /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java Mon Jul 27 09:48:41 2009 +++ /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java Mon Jul 27 16:23:55 2009 @@ -56,6 +56,7 @@ import com.google.gwt.dev.javac.impl.Shared; import com.google.gwt.dev.util.Name; import com.google.gwt.dev.util.Name.BinaryName; +import com.google.gwt.dev.util.Name.InternalName; import java.io.PrintWriter; import java.lang.annotation.Annotation; @@ -65,6 +66,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; @@ -291,7 +293,7 @@ * * @param classData * @param enclosingClassData - * @return + * @return true if this class is a non-static class inside a generic class */ private static boolean nonStaticInsideGeneric(CollectClassData classData, CollectClassData enclosingClassData) { @@ -392,10 +394,22 @@ classMapType.put(type, cv); } } + +// Hook up enclosing types +TreeLogger branch = logger.branch(TreeLogger.SPAM, +"Resolving enclosing classes"); +for (Iterator it = unresolvedTypes.iterator(); +it.hasNext(); ) { + JRealClassType type = it.next(); + if (!resolveEnclosingClass(branch, type)) { +// already logged why it failed, don't try and use it further +it.remove(); + } +} // Resolve unresolved types. for (JRealClassType type : unresolvedTypes) { - TreeLogger branch = logger.branch(TreeLogger.SPAM, "Resolving " + branch = logger.branch(TreeLogger.SPAM, "Resolving " + type.getQualifiedSourceName()); if (!resolveClass(branch, type)) { // already logged why it failed @@ -476,18 +490,15 @@ boolean isLocalType = classData.isLocal(); String enclosingTypeName = null; if (enclosingClassData != null) { - enclosingTypeName = enclosingClassData.getName(); - int idx = enclosingTypeName.lastIndexOf('/'); - if (idx > 0) { -enclosingTypeName = enclosingTypeName.substring(idx + 1); - } + enclosingTypeName = InternalName.toSourceName(InternalName.getClassName( + enclosingClassData.getName())); } if ((access & Opcodes.ACC_ANNOTATION) != 0) { - resultType = new JAnnotationType(typeOracle, pkg, enclosingTypeName , false, - className, true); + resultType = new JAnnotationType(typeOracle, pkg, enclosingTypeName, + false, className, true); } else if ((access & Opcodes.ACC_ENUM) != 0) { - resultType = new JEnumType(typeOracle, pkg, enclosingTypeName, isLocalType, - className, isIntf); + resultType = new JEnumType(typeOracle, pkg, enclosingTypeName, + isLocalType, className, isIntf); } else { JTypeParameter[] typeParams = getTypeParametersForClass(classData); if ((typeParams != null && typeParams.length > 0) @@ -790,21 +801,10 @@ boolean stopHere = true; } -// Find our enclosing class and set it -CollectClassData classData = classMapType.get(type); -assert classData != null; -String outerClass = classData.getOuterClass(); -JRealClassType enclosingType = null; -if (outerClass != null) { - enclosingType = binaryMapper.get(outerClass); - type.setEnclosingType(enclosingType); -} - -// Ensure enclosing classes are resolved -if (enclosingType != null) { - if (!resolveClass(logger, enclosingType)) { -return false; - } +// Make sure our enclosing type is resolved first. +if (type.getEnclosingType() != null +&& !resolveClass(logger, type.getEnclosingType())) { + return false; } // Build a search list for type parameters to find their definition, @@ -812,73 +812,14 @@ TypeParameterLookup typeParamLookup = new TypeParameterLookup(); typeParamLookup.pushEnclosingScopes(type); +CollectClassData classData = classMapType.get(type); +assert classData != null; int access = classData.getAccess(); -if (classData.getOuterClass() != null) { - /* - * This is a local class declared inside a method, so we need to push any - * type parameters declared on that method on the scope stack. - */ - JType outerType = resolveType(logger, - Type.getObjectType(classData.getOuterClass())); -
[gwt-contrib] [google-web-toolkit] r5807 commited - Formatting.
Revision: 5807 Author: j...@google.com Date: Mon Jul 27 16:24:54 2009 Log: Formatting. http://code.google.com/p/google-web-toolkit/source/detail?r=5807 Modified: /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/asm/ResolveClassSignature.java === --- /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/asm/ResolveClassSignature.java Mon Jul 6 16:54:47 2009 +++ /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/asm/ResolveClassSignature.java Mon Jul 27 16:24:54 2009 @@ -96,7 +96,8 @@ public SignatureVisitor visitClassBound() { JType[] bound = new JType[1]; bounds.add(bound); -return new ResolveTypeSignature(typeOracle, binaryMapper, logger, bound, lookup, null); +return new ResolveTypeSignature(typeOracle, binaryMapper, logger, bound, +lookup, null); } @Override @@ -111,19 +112,22 @@ finish(); JType[] intf = new JType[1]; interfaces.add(intf); -return new ResolveTypeSignature(typeOracle, binaryMapper, logger, intf, lookup, null); +return new ResolveTypeSignature(typeOracle, binaryMapper, logger, intf, +lookup, null); } @Override public SignatureVisitor visitInterfaceBound() { JType[] bound = new JType[1]; bounds.add(bound); -return new ResolveTypeSignature(typeOracle, binaryMapper, logger, bound, lookup, null); +return new ResolveTypeSignature(typeOracle, binaryMapper, logger, bound, +lookup, null); } @Override public SignatureVisitor visitSuperclass() { finish(); -return new ResolveTypeSignature(typeOracle, binaryMapper, logger, superClass, lookup, null); +return new ResolveTypeSignature(typeOracle, binaryMapper, logger, +superClass, lookup, null); } } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5803 commited - Fix handling of enclosing classes.
Revision: 5803 Author: j...@google.com Date: Mon Jul 27 09:35:29 2009 Log: Fix handling of enclosing classes. http://code.google.com/p/google-web-toolkit/source/detail?r=5803 Modified: /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JAnnotationType.java /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JClassType.java /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JEnumType.java /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JGenericType.java /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/asm/CollectClassData.java /changes/jat/ihm/dev/core/test/com/google/gwt/dev/javac/asm/ResolveGenericsTest.java === --- /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JAnnotationType.java Tue Jun 16 14:33:06 2009 +++ /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JAnnotationType.java Mon Jul 27 09:35:29 2009 @@ -23,9 +23,9 @@ public class JAnnotationType extends JRealClassType { public JAnnotationType(TypeOracle oracle, JPackage declaringPackage, - JClassType enclosingType, boolean isLocalType, String name, + String enclosingTypeName, boolean isLocalType, String name, boolean isInterface) { -super(oracle, declaringPackage, enclosingType, isLocalType, name, +super(oracle, declaringPackage, enclosingTypeName, isLocalType, name, isInterface); } === --- /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JClassType.java Fri May 8 17:38:40 2009 +++ /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JClassType.java Mon Jul 27 09:35:29 2009 @@ -43,6 +43,23 @@ } return flattened; } + + protected static final String makeCompoundBinaryName(JClassType type) { +String prefix = ""; +if (type.getEnclosingType() != null) { + prefix = makeCompoundBinaryName(type.getEnclosingType()) + "$"; +} +return prefix + type.getSimpleSourceName(); + } + + protected static final String makeCompoundName(JClassType type) { +if (type.getEnclosingType() == null) { + return type.getSimpleSourceName(); +} else { + return makeCompoundName(type.getEnclosingType()) + "." + + type.getSimpleSourceName(); +} + } /** * Returns true if the rhs array type can be assigned to the @@ -557,23 +574,6 @@ protected JMaybeParameterizedType isMaybeParameterizedType() { return null; } - - protected final String makeCompoundBinaryName(JClassType type) { -String prefix = ""; -if (type.getEnclosingType() != null) { - prefix = makeCompoundBinaryName(type.getEnclosingType()) + "$"; -} -return prefix + type.getSimpleSourceName(); - } - - protected final String makeCompoundName(JClassType type) { -if (type.getEnclosingType() == null) { - return type.getSimpleSourceName(); -} else { - return makeCompoundName(type.getEnclosingType()) + "." - + type.getSimpleSourceName(); -} - } /** * Tells this type's superclasses and superinterfaces about it. === --- /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JEnumType.java Tue Jun 16 14:33:06 2009 +++ /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JEnumType.java Mon Jul 27 09:35:29 2009 @@ -25,9 +25,9 @@ private JEnumConstant[] lazyEnumConstants; public JEnumType(TypeOracle oracle, JPackage declaringPackage, - JClassType enclosingType, boolean isLocalType, String name, + String enclosingTypeName, boolean isLocalType, String name, boolean isInterface) { -super(oracle, declaringPackage, enclosingType, isLocalType, name, +super(oracle, declaringPackage, enclosingTypeName, isLocalType, name, isInterface); } === --- /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JGenericType.java Wed Apr 1 12:12:47 2009 +++ /changes/jat/ihm/dev/core/src/com/google/gwt/core/ext/typeinfo/JGenericType.java Mon Jul 27 09:35:29 2009 @@ -30,9 +30,9 @@ private List typeParams = Lists.create(); public JGenericType(TypeOracle oracle, JPackage declaringPackage, - JClassType enclosingType, boolean isLocalType, String name, + String enclosingTypeName, boolean isLocalType, String name, boolean isInterface, JTypeParameter[] jtypeParameters) { -super(oracle, declaringPackage, enclosingType, isLocalType, name, +super(oracle, declaringPackage, enclosingTypeName, isLocalType, name, isInterface); if (jtypeParameters != null) { === --- /changes/jat/ihm/dev/core/src/com/go
[gwt-contrib] [google-web-toolkit] r5804 commited - Remove unused import.
Revision: 5804 Author: j...@google.com Date: Mon Jul 27 09:48:41 2009 Log: Remove unused import. http://code.google.com/p/google-web-toolkit/source/detail?r=5804 Modified: /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java === --- /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java Mon Jul 27 09:35:29 2009 +++ /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java Mon Jul 27 09:48:41 2009 @@ -56,7 +56,6 @@ import com.google.gwt.dev.javac.impl.Shared; import com.google.gwt.dev.util.Name; import com.google.gwt.dev.util.Name.BinaryName; -import com.google.gwt.dev.util.Name.InternalName; import java.io.PrintWriter; import java.lang.annotation.Annotation; --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5808 commited - More enclosing class fixes, first pass at JSORestrictionsChecker rewri...
Revision: 5808 Author: j...@google.com Date: Tue Jul 28 08:57:45 2009 Log: More enclosing class fixes, first pass at JSORestrictionsChecker rewrite. http://code.google.com/p/google-web-toolkit/source/detail?r=5808 Modified: /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/CompilationUnitInvalidator.java /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/JSORestrictionsChecker.java /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java === --- /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/CompilationUnitInvalidator.java Mon Jul 6 15:14:56 2009 +++ /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/CompilationUnitInvalidator.java Tue Jul 28 08:57:45 2009 @@ -45,10 +45,8 @@ * Maintain cross-validation state. */ public static class InvalidatorState { -private final JSORestrictionsChecker.CheckerState jsoState = new JSORestrictionsChecker.CheckerState(); public void retainAll(Collection toRetain) { - jsoState.retainAll(toRetain); } } @@ -207,11 +205,6 @@ BinaryTypeReferenceRestrictionsChecker.check(jdtCud, validBinaryTypeNames); } - if (unit.isCompiled()) { -//state.jsoState.processUnit(typeOracle, unit); -//JSORestrictionsChecker.check(state.jsoState, unit, typeOracle); - } -} -state.jsoState.finalCheck(); +} } } === --- /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/JSORestrictionsChecker.java Wed Jul 15 07:37:51 2009 +++ /changes/jat/ihm/dev/core/src/com/google/gwt/dev/javac/JSORestrictionsChecker.java Tue Jul 28 08:57:45 2009 @@ -15,25 +15,31 @@ */ package com.google.gwt.dev.javac; +import com.google.gwt.core.ext.TreeLogger; import com.google.gwt.core.ext.typeinfo.JClassType; +import com.google.gwt.core.ext.typeinfo.JConstructor; +import com.google.gwt.core.ext.typeinfo.JField; +import com.google.gwt.core.ext.typeinfo.JMethod; +import com.google.gwt.core.ext.typeinfo.JRealClassType; import com.google.gwt.core.ext.typeinfo.TypeOracle; import com.google.gwt.dev.asm.ClassReader; import com.google.gwt.dev.asm.ClassVisitor; import com.google.gwt.dev.asm.FieldVisitor; +import com.google.gwt.dev.asm.Label; import com.google.gwt.dev.asm.MethodVisitor; import com.google.gwt.dev.asm.Opcodes; -import com.google.gwt.dev.asm.Type; import com.google.gwt.dev.asm.commons.EmptyVisitor; import com.google.gwt.dev.util.Name.InternalName; +import com.google.gwt.dev.util.collect.IdentityHashSet; import org.eclipse.jdt.core.compiler.CategorizedProblem; -import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; +import org.eclipse.jdt.core.compiler.IProblem; +import org.eclipse.jdt.internal.compiler.problem.DefaultProblem; +import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; +import java.util.Collections; +import java.util.IdentityHashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -56,230 +62,388 @@ public class JSORestrictionsChecker { /** - * The order in which the checker will process types is undefined, so this - * type accumulates the information necessary for sanity-checking the JSO - * types. + * Exception used to abort processing of a class since ASM has no way to + * terminate processing early. + * + * Must be a RuntimeException since we can't throw checked exceptions from the + * visitor. */ - public static class CheckerState { + public class AbortProcessing extends RuntimeException { + } + + /** + * ASM visitor which verifies JSO restrictions. + */ + public class JsoClassVisitor extends EmptyVisitor + implements ClassVisitor { /** -* Exception used to abort processing of a class since ASM has no way to -* terminate processing early. -* -* Must be a RuntimeException since we can't throw checked exceptions from -* the visitor. -*/ - public class AbortProcessing extends RuntimeException { - } - - /** -* ASM visitor which verifies JSO restrictions. -*/ - public class MyClassVisitor extends EmptyVisitor implements ClassVisitor { - - private JClassType jsoClass; - private int classAccess; - private String name; - private String superName; - private List errors = new ArrayList(); - - public MyClassVisitor(JClassType jsoClass) { - this.jsoClass = jsoClass; - } - -public List getErrors() { - return errors; -} - - @Override - public void visit(int version, int access, String name, String signature, - String superName, String[] interfaces) { - if (superName == null || superName.startsWith("java/lang/")) { - // TODO(jat): consider whether abort
[gwt-contrib] [google-web-toolkit] r5799 commited - Committing missing file from r5798....
Revision: 5799 Author: jlaba...@google.com Date: Sun Jul 26 16:55:29 2009 Log: Committing missing file from r5798. Patch by: jlabanca Review by: fabbott (for r5798) http://code.google.com/p/google-web-toolkit/source/detail?r=5799 Modified: /trunk/build-tools/ant-gwt/build.xml === --- /trunk/build-tools/ant-gwt/build.xmlFri Jul 24 17:50:15 2009 +++ /trunk/build-tools/ant-gwt/build.xmlSun Jul 26 16:55:29 2009 @@ -3,6 +3,10 @@ + + + + @@ -12,7 +16,7 @@ - + @@ -33,32 +37,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5798 commited - Added emma code coverage generation to the build file. ant emma test ...
Revision: 5798 Author: jlaba...@google.com Date: Sun Jul 26 14:05:25 2009 Log: Added emma code coverage generation to the build file. ant emma test emma.merge will generate emma reports for each test, then merge them. This is a resubmit of r5781 after verifying all remoteweb tests pass. Patch by: jlabanca Review by: fabbott http://code.google.com/p/google-web-toolkit/source/detail?r=5798 Modified: /trunk/build.xml /trunk/common.ant.xml /trunk/dev/core/build.xml /trunk/tools/api-checker/build.xml /trunk/user/build.xml === --- /trunk/build.xmlFri Jul 24 17:50:15 2009 +++ /trunk/build.xmlSun Jul 26 14:05:25 2009 @@ -5,6 +5,7 @@ + @@ -119,6 +122,14 @@ + + + + + + + + @@ -133,6 +144,7 @@ + @@ -163,6 +175,7 @@ + @@ -177,20 +190,28 @@ + + + + + + - + - + + + @@ -206,6 +227,19 @@ + + + + + + + + + + + + + @@ -303,6 +337,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + === --- /trunk/dev/core/build.xml Fri Jul 24 17:50:15 2009 +++ /trunk/dev/core/build.xml Sun Jul 26 14:05:25 2009 @@ -9,7 +9,7 @@ - + @@ -166,38 +166,14 @@ - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - + + === --- /trunk/tools/api-checker/build.xml Fri Jul 24 17:50:15 2009 +++ /trunk/tools/api-checker/build.xml Sun Jul 26 14:05:25 2009 @@ -10,6 +10,10 @@ + + + + @@ -20,7 +24,7 @@ - + @@ -42,33 +46,12 @@ - - - - - - - - - - - - - - - + + - - - - - - - - - + + === --- /trunk/user/build.xml Sat Jul 25 07:55:48 2009 +++ /trunk/user/build.xml Sun Jul 26 14:05:25 2009 @@ -3,10 +3,14 @@ + + + +
[gwt-contrib] [google-web-toolkit] r5797 commited - First drop on AST Flattener. Patch for CloneExpressionVisitor to more ...
Revision: 5797 Author: cromwellian Date: Sat Jul 25 15:58:48 2009 Log: First drop on AST Flattener. Patch for CloneExpressionVisitor to more precisely copy JMethodCall. Insert flattener into JavaToJavaScriptCompiler before optimization loop. http://code.google.com/p/google-web-toolkit/source/detail?r=5797 Added: /changes/cromwellian/intraprocedural/dev/core/src/com/google/gwt/dev/jjs/impl/Flattener.java Modified: /changes/cromwellian/intraprocedural/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java /changes/cromwellian/intraprocedural/dev/core/src/com/google/gwt/dev/jjs/impl/CloneExpressionVisitor.java === --- /dev/null +++ /changes/cromwellian/intraprocedural/dev/core/src/com/google/gwt/dev/jjs/impl/Flattener.java Sat Jul 25 15:58:48 2009 @@ -0,0 +1,638 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.dev.jjs.impl; + +import com.google.gwt.dev.jjs.SourceInfo; +import com.google.gwt.dev.jjs.ast.Context; +import com.google.gwt.dev.jjs.ast.JArrayRef; +import com.google.gwt.dev.jjs.ast.JBinaryOperation; +import com.google.gwt.dev.jjs.ast.JBinaryOperator; +import com.google.gwt.dev.jjs.ast.JCastOperation; +import com.google.gwt.dev.jjs.ast.JClassType; +import com.google.gwt.dev.jjs.ast.JConditional; +import com.google.gwt.dev.jjs.ast.JDeclarationStatement; +import com.google.gwt.dev.jjs.ast.JExpression; +import com.google.gwt.dev.jjs.ast.JExpressionStatement; +import com.google.gwt.dev.jjs.ast.JFieldRef; +import com.google.gwt.dev.jjs.ast.JForStatement; +import com.google.gwt.dev.jjs.ast.JLiteral; +import com.google.gwt.dev.jjs.ast.JLocalRef; +import com.google.gwt.dev.jjs.ast.JMethodBody; +import com.google.gwt.dev.jjs.ast.JMethodCall; +import com.google.gwt.dev.jjs.ast.JModVisitor; +import com.google.gwt.dev.jjs.ast.JNameOf; +import com.google.gwt.dev.jjs.ast.JParameterRef; +import com.google.gwt.dev.jjs.ast.JPostfixOperation; +import com.google.gwt.dev.jjs.ast.JPrefixOperation; +import com.google.gwt.dev.jjs.ast.JProgram; +import com.google.gwt.dev.jjs.ast.JReturnStatement; +import com.google.gwt.dev.jjs.ast.JStatement; +import com.google.gwt.dev.jjs.ast.JThisRef; +import com.google.gwt.dev.jjs.ast.JType; +import com.google.gwt.dev.jjs.ast.JUnaryOperator; +import com.google.gwt.dev.jjs.ast.JWhileStatement; +import com.google.gwt.dev.jjs.ast.js.JMultiExpression; + +import java.util.ArrayList; +import java.util.Stack; + +/** + * Transforms expressions with complex subexpressions (not constants or simple + * variable references) to 'flat' expressions by introducing temporary + * variables. A flat expression is a JExpressionStatement, + * JDeclarationStatement, or JReturnStatement in which either all of the + * subexpressions are locals, parameters, or 'this', or the statement consists + * of a single reference to an array or field. + * + * Examples of flat statements: + * x = a + b + * x = a.field + * x = array[index] + * a.field = x + * a[index] = x + * x = foo.methodCall(x, y, z) + * return a; + * return a[i] + * return a.field + * + * + * + * Examples of non-flat statements: + * x = a + b + c + * x = a.field + b.field + * x = a[index] + b[index] + * a[index] = b[index] + * a.field = b.field + * x = y = z + * x = foo.bar().baz() + * x = foo(a+b) + * x = (expr1, expr2, expr3) + * return a + b; + * + * + * The motivations for doing this transformation are that the AST, being a + * parse tree, is structurally complex and nodes are allowed to have side + * effects. This has the effect of obfuscating control flow, as well as + * introducing lots of special cases into algorithms which walk the tree due to + * side effects. + * + * By flattening the tree, and transforming it to static single assignment + * form (SSA), many algorithms are simpler to implement, as well as run faster. + * And current GWT optimizations like MethodInliner would be both dramatically + * simpler, as well as more general. The flat structure also makes building and + * keeping a control flow graph in sync with the AST more tractable. + * + * This representation is currently used as part of GCC 4.0's TreeSSA, as + * well as the Tiger compiler which forms the basis of the book: Modern Compiler + * Implementation in Java by Andrew Appel. + * + * Later versions will include transformations which flatten conditionals, + * boolean short-circuit operations, l
[gwt-contrib] [google-web-toolkit] r5800 commited - Rolling back r5798-5799 because they are causing tests to fail....
Revision: 5800 Author: jlaba...@google.com Date: Sun Jul 26 17:35:05 2009 Log: Rolling back r5798-5799 because they are causing tests to fail. Patch by: jlabanca Review by: jgw (TBR) http://code.google.com/p/google-web-toolkit/source/detail?r=5800 Modified: /trunk/build-tools/ant-gwt/build.xml /trunk/build.xml /trunk/common.ant.xml /trunk/dev/core/build.xml /trunk/tools/api-checker/build.xml /trunk/user/build.xml === --- /trunk/build-tools/ant-gwt/build.xmlSun Jul 26 16:55:29 2009 +++ /trunk/build-tools/ant-gwt/build.xmlSun Jul 26 17:35:05 2009 @@ -3,10 +3,6 @@ - - - - @@ -16,7 +12,7 @@ - + @@ -37,7 +33,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + === --- /trunk/build.xmlSun Jul 26 14:05:25 2009 +++ /trunk/build.xmlSun Jul 26 17:35:05 2009 @@ -5,7 +5,6 @@ - @@ -122,14 +119,6 @@ - - - - - - - - @@ -144,7 +133,6 @@ - @@ -175,7 +163,6 @@ - @@ -190,28 +177,20 @@ - - - - - - - + - - - + @@ -227,19 +206,6 @@ - - - - - - - - - - - - - @@ -337,43 +303,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - === --- /trunk/dev/core/build.xml Sun Jul 26 14:05:25 2009 +++ /trunk/dev/core/build.xml Sun Jul 26 17:35:05 2009 @@ -9,7 +9,7 @@ - + @@ -166,14 +166,38 @@ - - + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + === --- /trunk/tools/api-checker/build.xml Sun Jul 26 14:05:25 2009 +++ /trunk/tools/api-checker/build.xml Sun Jul 26 17:35:05 2009 @@ -10,10 +10,6 @@ - - - - @@ -24,7 +20,7 @@ - + @@ -46,12 +42,33 @@ - - + + + + + + + + + + + + + + + - - + + + + + + + + + === --- /trunk/user/build.xml Sun Jul 26 14:05:25 2009 +++ /trunk/user/build.xml Sun Jul 26 17:35:05 2009 @@ -3,14 +3,10 @@ - - - -
[gwt-contrib] [google-web-toolkit] r5802 commited - Re-apply r5790 to improve accuracy of JsParser's SourceInfo objects.
Revision: 5802 Author: b...@google.com Date: Mon Jul 27 06:32:32 2009 Log: Re-apply r5790 to improve accuracy of JsParser's SourceInfo objects. http://code.google.com/p/google-web-toolkit/source/detail?r=5802 Modified: /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java === --- /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java Mon Jul 27 06:28:36 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java Mon Jul 27 06:32:32 2009 @@ -29,6 +29,7 @@ import com.google.gwt.dev.js.ast.JsContinue; import com.google.gwt.dev.js.ast.JsDefault; import com.google.gwt.dev.js.ast.JsDoWhile; +import com.google.gwt.dev.js.ast.JsExprStmt; import com.google.gwt.dev.js.ast.JsExpression; import com.google.gwt.dev.js.ast.JsFor; import com.google.gwt.dev.js.ast.JsForIn; @@ -150,8 +151,12 @@ private SourceInfo makeSourceInfo(Node node) { SourceInfo parent = sourceInfoStack.peek(); -SourceInfo toReturn = program.createSourceInfo(node.getLineno(), -parent.getFileName()); +int lineno = node.getLineno(); +if (lineno == -1) { + // Rhino only reports line numbers for statement nodes, not expressions + return parent; +} +SourceInfo toReturn = program.createSourceInfo(lineno, parent.getFileName()); toReturn.copyMissingCorrelationsFrom(parent); return toReturn; } @@ -173,7 +178,7 @@ return null; case TokenStream.EXPRSTMT: -return mapExpression(node.getFirstChild()).makeStmt(); +return mapExprStmt(node); case TokenStream.REGEXP: return mapRegExp(node); @@ -418,8 +423,11 @@ } private JsBlock mapBlock(Node nodeStmts) throws JsParserException { -JsBlock block = new JsBlock(makeSourceInfo(nodeStmts)); +SourceInfo info = makeSourceInfo(nodeStmts); +JsBlock block = new JsBlock(info); +pushSourceInfo(info); mapStatements(block.getStatements(), nodeStmts); +popSourceInfo(); return block; } @@ -514,6 +522,9 @@ fromBody = ifNode.getFirstChild(); fromTestExpr = ifNode.getFirstChild().getNext(); } + +SourceInfo info = makeSourceInfo(ifNode); +pushSourceInfo(info); // Map the test expression. // @@ -523,12 +534,14 @@ // JsStatement toBody = mapStatement(fromBody); +popSourceInfo(); + // Create and attach the "while" or "do" statement we're mapping to. // if (isWhile) { - return new JsWhile(makeSourceInfo(ifNode), toTestExpr, toBody); + return new JsWhile(info, toTestExpr, toBody); } else { - return new JsDoWhile(makeSourceInfo(ifNode), toTestExpr, toBody); + return new JsDoWhile(info, toTestExpr, toBody); } } @@ -574,6 +587,13 @@ throw createParserException("Expecting an expression", exprNode); } } + + private JsExprStmt mapExprStmt(Node node) throws JsParserException { +pushSourceInfo(makeSourceInfo(node)); +JsExpression expr = mapExpression(node.getFirstChild()); +popSourceInfo(); +return expr.makeStmt(); + } private JsStatement mapForStatement(Node forNode) throws JsParserException { Node fromInit = forNode.getFirstChild(); @@ -935,13 +955,16 @@ } private JsReturn mapReturn(Node returnNode) throws JsParserException { -JsReturn toReturn = new JsReturn(makeSourceInfo(returnNode)); +SourceInfo info = makeSourceInfo(returnNode); +JsReturn toReturn = new JsReturn(info); +pushSourceInfo(info); Node from = returnNode.getFirstChild(); if (from != null) { JsExpression to = mapExpression(from); toReturn.setExpr(to); } +popSourceInfo(); return toReturn; } @@ -1032,7 +1055,9 @@ } private JsSwitch mapSwitchStatement(Node switchNode) throws JsParserException { -JsSwitch toSwitch = new JsSwitch(makeSourceInfo(switchNode)); +SourceInfo info = makeSourceInfo(switchNode); +JsSwitch toSwitch = new JsSwitch(info); +pushSourceInfo(info); // The switch expression. // @@ -1078,15 +1103,20 @@ fromMember = fromMember.getNext(); } +popSourceInfo(); return toSwitch; } private JsThrow mapThrowStatement(Node throwNode) throws JsParserException { +SourceInfo info = makeSourceInfo(throwNode); +pushSourceInfo(info); + // Create, map, and attach. // Node fromExpr = throwNode.getFirstChild(); -JsThrow toThrow = new JsThrow(makeSourceInfo(throwNode), -mapExpression(fromExpr)); +JsThrow toThrow = new JsThrow(info, mapExpression(fromExpr)); + +popSourceInfo(); return toThrow; } @@ -1180,7 +1210,9 @@ } private JsVars mapVar(Node varNode) throws JsParserException { -JsVars toVars = new JsVars(makeSourceInfo(varNode)); +SourceInfo info = makeSourceInfo(varNode); +pushSourceInfo(info); +JsVars toVars = new JsVars(info); Node fromVar = varNode.getF
[gwt-contrib] [google-web-toolkit] r5801 commited - Reapplying r5789 to remove warnings from JsParser.
Revision: 5801 Author: b...@google.com Date: Mon Jul 27 06:28:36 2009 Log: Reapplying r5789 to remove warnings from JsParser. http://code.google.com/p/google-web-toolkit/source/detail?r=5801 Modified: /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java === --- /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java Fri Jul 24 17:50:15 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java Mon Jul 27 06:28:36 2009 @@ -346,6 +346,8 @@ */ private JsNameRef mapAsPropertyNameRef(Node nameRefNode) throws JsParserException { +// Javac 1.6.0_01 doesn't like the cast below if this is parameterized +@SuppressWarnings("unchecked") JsNode unknown = map(nameRefNode); // This is weird, but for "a.b", the rhino AST calls "b" a string literal. // However, since we know it's for a PROPGET, we can unstringliteralize it. @@ -563,6 +565,8 @@ } private JsExpression mapExpression(Node exprNode) throws JsParserException { +// Javac 1.6.0_01 doesn't like the cast below if this is parameterized +@SuppressWarnings("unchecked") JsNode unknown = map(exprNode); if (unknown instanceof JsExpression) { return (JsExpression) unknown; @@ -623,7 +627,8 @@ JsFor toFor = new JsFor(makeSourceInfo(forNode)); // The first item is either an expression or a JsVars. - // + // Javac 1.6.0_01 doesn't like the cast below if this is parameterized + @SuppressWarnings("unchecked") JsNode initThingy = map(fromInit); if (initThingy != null) { if (initThingy instanceof JsVars) { @@ -839,6 +844,8 @@ private JsExpression mapOptionalExpression(Node exprNode) throws JsParserException { +// Javac 1.6.0_01 doesn't like the cast below if this is parameterized +@SuppressWarnings("unchecked") JsNode unknown = map(exprNode); if (unknown != null) { if (unknown instanceof JsExpression) { @@ -984,6 +991,8 @@ } private JsStatement mapStatement(Node nodeStmt) throws JsParserException { +// Javac 1.6.0_01 doesn't like the cast below if this is parameterized +@SuppressWarnings("unchecked") JsNode unknown = map(nodeStmt); if (unknown != null) { if (unknown instanceof JsStatement) { --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5795 commited - 4 small changes:...
Revision: 5795 Author: amitman...@google.com Date: Fri Jul 24 21:36:20 2009 Log: 4 small changes: (i) Turned on the batching of test cases. (ii) Re-introduces c5774, a temporary commit. The commit comments a few assertions that only seem to be a problem with the oldmoz browser. Need more investigation. (iii) Moved draftCompile out of the task, just to confirm that the ant task is not a problem. (iv) Increased the TEST_METHOD_TIMEOUT_MILLIS value from 5 minutes to 20 minutes, since tests are now batched. http://code.google.com/p/google-web-toolkit/source/detail?r=5795 Modified: /trunk/common.ant.xml /trunk/user/build.xml /trunk/user/src/com/google/gwt/junit/JUnitShell.java /trunk/user/test/com/google/gwt/xml/client/XMLTest.java === --- /trunk/common.ant.xml Fri Jul 24 17:50:15 2009 +++ /trunk/common.ant.xml Fri Jul 24 21:36:20 2009 @@ -182,7 +182,7 @@ failureproperty="junit.failure" tempdir="@{test.out}" > - + === --- /trunk/user/build.xml Fri Jul 24 17:50:15 2009 +++ /trunk/user/build.xml Fri Jul 24 21:36:20 2009 @@ -202,8 +202,8 @@ - + === --- /trunk/user/src/com/google/gwt/junit/JUnitShell.javaTue Jul 21 15:13:53 2009 +++ /trunk/user/src/com/google/gwt/junit/JUnitShell.javaFri Jul 24 21:36:20 2009 @@ -370,9 +370,9 @@ /** * The amount of time to wait for all clients to complete a single test * method, in milliseconds, measured from when the last client connects - * (and thus starts the test). 5 minutes. + * (and thus starts the test). 25 minutes. */ - private static final long TEST_METHOD_TIMEOUT_MILLIS = 30; + private static final long TEST_METHOD_TIMEOUT_MILLIS = 4 * 30; /** * Singleton object for hosting unit tests. All test case instances executed === --- /trunk/user/test/com/google/gwt/xml/client/XMLTest.java Thu Jul 23 07:56:17 2009 +++ /trunk/user/test/com/google/gwt/xml/client/XMLTest.java Fri Jul 24 21:36:20 2009 @@ -268,10 +268,12 @@ public void testNavigation() { Document d = createTestDocument(); Element documentElement = d.getDocumentElement(); -assertEquals("getPreviousSibling", documentElement.getPreviousSibling(), -d.getChildNodes().item(0)); -assertEquals("getNextSibling", documentElement.getNextSibling(), -d.getChildNodes().item(2)); +// TODO (amitmanjhi): investigate why these tests are failing just in batch +// mode for both web and hosted mode tests. +//assertEquals("getPreviousSibling", documentElement.getPreviousSibling(), +//d.getChildNodes().item(0)); +//assertEquals("getNextSibling", documentElement.getNextSibling(), +//d.getChildNodes().item(2)); assertEquals("getDocumentElement", documentElement, d.getChildNodes().item( 1)); assertEquals("getTagName", documentElement.getTagName(), "doc"); @@ -308,7 +310,9 @@ assertEquals(top.getChildNodes().getLength(), 1); Comment commentNode = ns.createComment("comment ccc"); top.replaceChild(commentNode, yyy); -assertEquals(top.getFirstChild(), commentNode); +// TODO (amitmanjhi): investigate why this test is failing just in batch +// mode for both web and hosted mode tests. +// assertEquals(top.getFirstChild(), commentNode); assertEquals(top.getChildNodes().getLength(), 1); } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5791 commited - [No log message]
Revision: 5791 Author: sumitchan...@google.com Date: Fri Jul 24 14:25:18 2009 Log: [No log message] http://code.google.com/p/google-web-toolkit/source/detail?r=5791 Added: /trunk/ google-web-toolkit /trunk/ google-web-toolkit/README.txt /trunk/ google-web-toolkit/conf /trunk/ google-web-toolkit/conf/authz /trunk/ google-web-toolkit/conf/passwd /trunk/ google-web-toolkit/conf/svnserve.conf /trunk/ google-web-toolkit/db /trunk/ google-web-toolkit/db/current /trunk/ google-web-toolkit/db/format /trunk/ google-web-toolkit/db/fs-type /trunk/ google-web-toolkit/db/fsfs.conf /trunk/ google-web-toolkit/db/min-unpacked-rev /trunk/ google-web-toolkit/db/rep-cache.db /trunk/ google-web-toolkit/db/revprops /trunk/ google-web-toolkit/db/revprops/0 /trunk/ google-web-toolkit/db/revprops/0/0 /trunk/ google-web-toolkit/db/revs /trunk/ google-web-toolkit/db/revs/0 /trunk/ google-web-toolkit/db/revs/0/0 /trunk/ google-web-toolkit/db/transactions /trunk/ google-web-toolkit/db/txn-current /trunk/ google-web-toolkit/db/txn-current-lock /trunk/ google-web-toolkit/db/txn-protorevs /trunk/ google-web-toolkit/db/uuid /trunk/ google-web-toolkit/db/write-lock /trunk/ google-web-toolkit/format /trunk/ google-web-toolkit/hooks /trunk/ google-web-toolkit/hooks/post-commit.tmpl /trunk/ google-web-toolkit/hooks/post-lock.tmpl /trunk/ google-web-toolkit/hooks/post-revprop-change.tmpl /trunk/ google-web-toolkit/hooks/post-unlock.tmpl /trunk/ google-web-toolkit/hooks/pre-commit.tmpl /trunk/ google-web-toolkit/hooks/pre-lock.tmpl /trunk/ google-web-toolkit/hooks/pre-revprop-change.tmpl /trunk/ google-web-toolkit/hooks/pre-unlock.tmpl /trunk/ google-web-toolkit/hooks/start-commit.tmpl /trunk/ google-web-toolkit/locks /trunk/ google-web-toolkit/locks/db-logs.lock /trunk/ google-web-toolkit/locks/db.lock === --- /dev/null +++ /trunk/ google-web-toolkit/README.txt Fri Jul 24 14:25:18 2009 @@ -0,0 +1,5 @@ +This is a Subversion repository; use the 'svnadmin' tool to examine +it. Do not add, delete, or modify files here unless you know how +to avoid corrupting the repository. + +Visit http://subversion.tigris.org/ for more information. === --- /dev/null +++ /trunk/ google-web-toolkit/conf/authz Fri Jul 24 14:25:18 2009 @@ -0,0 +1,32 @@ +### This file is an example authorization file for svnserve. +### Its format is identical to that of mod_authz_svn authorization +### files. +### As shown below each section defines authorizations for the path and +### (optional) repository specified by the section name. +### The authorizations follow. An authorization line can refer to: +### - a single user, +### - a group of users defined in a special [groups] section, +### - an alias defined in a special [aliases] section, +### - all authenticated users, using the '$authenticated' token, +### - only anonymous users, using the '$anonymous' token, +### - anyone, using the '*' wildcard. +### +### A match can be inverted by prefixing the rule with '~'. Rules can +### grant read ('r') access, read-write ('rw') access, or no access +### (''). + +[aliases] +# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average + +[groups] +# harry_and_sally = harry,sally +# harry_sally_and_joe = harry,sally,&joe + +# [/foo/bar] +# harry = rw +# &joe = r +# * = + +# [repository:/baz/fuz] +# @harry_and_sally = rw +# * = r === --- /dev/null +++ /trunk/ google-web-toolkit/conf/passwd Fri Jul 24 14:25:18 2009 @@ -0,0 +1,8 @@ +### This file is an example password file for svnserve. +### Its format is similar to that of svnserve.conf. As shown in the +### example below it contains one section labelled [users]. +### The name and password for each user follow, one account per line. + +[users] +# harry = harryssecret +# sally = sallyssecret === --- /dev/null +++ /trunk/ google-web-toolkit/conf/svnserve.conf Fri Jul 24 14:25:18 2009 @@ -0,0 +1,47 @@ +### This file controls the configuration of the svnserve daemon, if you +### use it to allow access to this repository. (If you only allow +### access through http: and/or file: URLs, then this file is +### irrelevant.) + +### Visit http://subversion.tigris.org/ for more information. + +[general] +### These options control access to the repository for unauthenticated +### and authenticated users. Valid values are "write", "read", +### and "none". The sample settings below are the defaults. +# anon-access = read +# auth-access = write +### The password-db option controls the location of the password +### database file. Unless you specify a path starting with a /, +### the file's location is relative to the directory containing +### this configuration file. +### If SASL is enabled (see below), this file will NOT be used. +### Uncomment the line below to use t
[gwt-contrib] [google-web-toolkit] r5796 commited - Two small config changes:...
Revision: 5796 Author: amitman...@google.com Date: Sat Jul 25 07:55:48 2009 Log: Two small config changes: (i) Instead of batching by default for all tests, do it individually for each test target except draftCompile. draftCompile is failing, only on the build machine, when batching is turned on. (ii) Moved draftCompile back into the parallel task, as before. http://code.google.com/p/google-web-toolkit/source/detail?r=5796 Modified: /trunk/common.ant.xml /trunk/user/build.xml === --- /trunk/common.ant.xml Fri Jul 24 21:36:20 2009 +++ /trunk/common.ant.xml Sat Jul 25 07:55:48 2009 @@ -182,7 +182,7 @@ failureproperty="junit.failure" tempdir="@{test.out}" > - + === --- /trunk/user/build.xml Fri Jul 24 21:36:20 2009 +++ /trunk/user/build.xml Sat Jul 25 07:55:48 2009 @@ -115,7 +115,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -136,7 +136,7 @@ - + @@ -145,7 +145,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -161,7 +161,7 @@ - + @@ -169,14 +169,14 @@ - + - + @@ -202,8 +202,8 @@ + - --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5757 commited - rollback of r5755, we still have some outstanding asserts... I'd thoug...
Revision: 5757 Author: fabb...@google.com Date: Mon Jul 20 22:35:44 2009 Log: rollback of r5755, we still have some outstanding asserts... I'd thought they were proxy-induced in my setup, since they hadn't shown before, but not so. http://code.google.com/p/google-web-toolkit/source/detail?r=5757 Deleted: /trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerDisableAssertions.java Modified: /trunk/dev/core/src/com/google/gwt/dev/GWTShell.java /trunk/dev/core/src/com/google/gwt/dev/HostedModeBase.java /trunk/dev/core/src/com/google/gwt/dev/Precompile.java /trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerEnableAssertions.java /trunk/dev/core/test/com/google/gwt/dev/GWTShellTest.java /trunk/user/src/com/google/gwt/junit/JUnitShell.java /trunk/user/test/com/google/gwt/dev/jjs/test/CoverageTest.java /trunk/user/test/com/google/gwt/event/shared/HandlerManagerTest.java === --- /trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerDisableAssertions.java Mon Jul 20 11:52:26 2009 +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.dev.util.arg; - -import com.google.gwt.util.tools.ArgHandlerFlag; - -/** - * Handler for -da arg to disable assertions in compiled code. - */ -public final class ArgHandlerDisableAssertions extends ArgHandlerFlag { - - private final OptionEnableAssertions option; - - public ArgHandlerDisableAssertions(OptionEnableAssertions option) { -this.option = option; - } - - @Override - public String getPurpose() { -return "Debugging: disables checking assertion statements in the compiled output."; - } - - @Override - public String getTag() { -return "-da"; - } - - @Override - public boolean setFlag() { -option.setEnableAssertions(false); -return true; - } - -} === --- /trunk/dev/core/src/com/google/gwt/dev/GWTShell.javaMon Jul 20 11:52:26 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/GWTShell.javaMon Jul 20 22:35:44 2009 @@ -90,7 +90,7 @@ /** * Concrete class to implement all shell options. */ - protected static class ShellOptionsImpl extends HostedModeBaseOptionsImpl implements + static class ShellOptionsImpl extends HostedModeBaseOptionsImpl implements HostedModeBaseOptions, WorkDirs, LegacyCompilerOptions { private int localWorkers; private File outDir; === --- /trunk/dev/core/src/com/google/gwt/dev/HostedModeBase.java Mon Jul 20 11:52:26 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/HostedModeBase.java Mon Jul 20 22:35:44 2009 @@ -32,7 +32,6 @@ import com.google.gwt.dev.shell.ShellModuleSpaceHost; import com.google.gwt.dev.util.Util; import com.google.gwt.dev.util.arg.ArgHandlerDisableAggressiveOptimization; -import com.google.gwt.dev.util.arg.ArgHandlerDisableAssertions; import com.google.gwt.dev.util.arg.ArgHandlerDisableCastChecking; import com.google.gwt.dev.util.arg.ArgHandlerDisableClassMetadata; import com.google.gwt.dev.util.arg.ArgHandlerDraftCompile; @@ -322,7 +321,6 @@ registerHandler(new ArgHandlerGenDir(options)); registerHandler(new ArgHandlerScriptStyle(options)); registerHandler(new ArgHandlerEnableAssertions(options)); - registerHandler(new ArgHandlerDisableAssertions(options)); registerHandler(new ArgHandlerDisableAggressiveOptimization(options)); registerHandler(new ArgHandlerDisableClassMetadata(options)); registerHandler(new ArgHandlerDisableCastChecking(options)); === --- /trunk/dev/core/src/com/google/gwt/dev/Precompile.java Mon Jul 20 11:52:26 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/Precompile.java Mon Jul 20 22:35:44 2009 @@ -43,7 +43,6 @@ import com.google.gwt.dev.util.PerfLogger; import com.google.gwt.dev.util.Util; import com.google.gwt.dev.util.arg.ArgHandlerDisableAggressiveOptimization; -import com.google.gwt.dev.util.arg.ArgHandlerDisableAssertions; import com.google.gwt.dev.util.arg.ArgHandlerDisableCastChecking; import com.google.gwt.dev.util.arg.ArgHandlerDisableClassMetadata; import com.google.gwt.dev.util.arg.ArgHandlerDisableRunAsync; @@ -95,7 +94,6 @@ registerHandler(new ArgHandlerGenDir(options)); registerHandler(new ArgHandlerScriptStyl
[gwt-contrib] [google-web-toolkit] r5790 commited - JsParser now provides correct line numbers for JsExpressions derived f...
Revision: 5790 Author: b...@google.com Date: Fri Jul 24 12:43:51 2009 Log: JsParser now provides correct line numbers for JsExpressions derived from JSNI methads. Patch by: bobv Review by: scottb http://code.google.com/p/google-web-toolkit/source/detail?r=5790 Modified: /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java === --- /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java Fri Jul 24 12:43:37 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java Fri Jul 24 12:43:51 2009 @@ -29,6 +29,7 @@ import com.google.gwt.dev.js.ast.JsContinue; import com.google.gwt.dev.js.ast.JsDefault; import com.google.gwt.dev.js.ast.JsDoWhile; +import com.google.gwt.dev.js.ast.JsExprStmt; import com.google.gwt.dev.js.ast.JsExpression; import com.google.gwt.dev.js.ast.JsFor; import com.google.gwt.dev.js.ast.JsForIn; @@ -150,8 +151,12 @@ private SourceInfo makeSourceInfo(Node node) { SourceInfo parent = sourceInfoStack.peek(); -SourceInfo toReturn = program.createSourceInfo(node.getLineno(), -parent.getFileName()); +int lineno = node.getLineno(); +if (lineno == -1) { + // Rhino only reports line numbers for statement nodes, not expressions + return parent; +} +SourceInfo toReturn = program.createSourceInfo(lineno, parent.getFileName()); toReturn.copyMissingCorrelationsFrom(parent); return toReturn; } @@ -173,7 +178,7 @@ return null; case TokenStream.EXPRSTMT: -return mapExpression(node.getFirstChild()).makeStmt(); +return mapExprStmt(node); case TokenStream.REGEXP: return mapRegExp(node); @@ -418,8 +423,11 @@ } private JsBlock mapBlock(Node nodeStmts) throws JsParserException { -JsBlock block = new JsBlock(makeSourceInfo(nodeStmts)); +SourceInfo info = makeSourceInfo(nodeStmts); +JsBlock block = new JsBlock(info); +pushSourceInfo(info); mapStatements(block.getStatements(), nodeStmts); +popSourceInfo(); return block; } @@ -514,6 +522,9 @@ fromBody = ifNode.getFirstChild(); fromTestExpr = ifNode.getFirstChild().getNext(); } + +SourceInfo info = makeSourceInfo(ifNode); +pushSourceInfo(info); // Map the test expression. // @@ -523,12 +534,14 @@ // JsStatement toBody = mapStatement(fromBody); +popSourceInfo(); + // Create and attach the "while" or "do" statement we're mapping to. // if (isWhile) { - return new JsWhile(makeSourceInfo(ifNode), toTestExpr, toBody); + return new JsWhile(info, toTestExpr, toBody); } else { - return new JsDoWhile(makeSourceInfo(ifNode), toTestExpr, toBody); + return new JsDoWhile(info, toTestExpr, toBody); } } @@ -574,6 +587,13 @@ throw createParserException("Expecting an expression", exprNode); } } + + private JsExprStmt mapExprStmt(Node node) throws JsParserException { +pushSourceInfo(makeSourceInfo(node)); +JsExpression expr = mapExpression(node.getFirstChild()); +popSourceInfo(); +return expr.makeStmt(); + } private JsStatement mapForStatement(Node forNode) throws JsParserException { Node fromInit = forNode.getFirstChild(); @@ -935,13 +955,16 @@ } private JsReturn mapReturn(Node returnNode) throws JsParserException { -JsReturn toReturn = new JsReturn(makeSourceInfo(returnNode)); +SourceInfo info = makeSourceInfo(returnNode); +JsReturn toReturn = new JsReturn(info); +pushSourceInfo(info); Node from = returnNode.getFirstChild(); if (from != null) { JsExpression to = mapExpression(from); toReturn.setExpr(to); } +popSourceInfo(); return toReturn; } @@ -1032,7 +1055,9 @@ } private JsSwitch mapSwitchStatement(Node switchNode) throws JsParserException { -JsSwitch toSwitch = new JsSwitch(makeSourceInfo(switchNode)); +SourceInfo info = makeSourceInfo(switchNode); +JsSwitch toSwitch = new JsSwitch(info); +pushSourceInfo(info); // The switch expression. // @@ -1078,15 +1103,20 @@ fromMember = fromMember.getNext(); } +popSourceInfo(); return toSwitch; } private JsThrow mapThrowStatement(Node throwNode) throws JsParserException { +SourceInfo info = makeSourceInfo(throwNode); +pushSourceInfo(info); + // Create, map, and attach. // Node fromExpr = throwNode.getFirstChild(); -JsThrow toThrow = new JsThrow(makeSourceInfo(throwNode), -mapExpression(fromExpr)); +JsThrow toThrow = new JsThrow(info, mapExpression(fromExpr)); + +popSourceInfo(); return toThrow; } @@ -1180,7 +1210,9 @@ } private JsVars mapVar(Node varNode) throws JsParserException { -JsVars toVars = new JsVars(makeSourceInfo(varNode)); +SourceInfo info = makeSourceInfo(varNode); +pushSourceInfo(info); +JsVars toVars
[gwt-contrib] [google-web-toolkit] r5789 commited - Remove raw type warnings....
Revision: 5789 Author: b...@google.com Date: Fri Jul 24 12:43:37 2009 Log: Remove raw type warnings. Patch by: bobv Review by: scottb http://code.google.com/p/google-web-toolkit/source/detail?r=5789 Modified: /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java === --- /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java Mon May 18 11:47:32 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/js/JsParser.java Fri Jul 24 12:43:37 2009 @@ -346,6 +346,8 @@ */ private JsNameRef mapAsPropertyNameRef(Node nameRefNode) throws JsParserException { +// Javac 1.6.0_01 doesn't like the cast below if this is parameterized +@SuppressWarnings("unchecked") JsNode unknown = map(nameRefNode); // This is weird, but for "a.b", the rhino AST calls "b" a string literal. // However, since we know it's for a PROPGET, we can unstringliteralize it. @@ -563,6 +565,8 @@ } private JsExpression mapExpression(Node exprNode) throws JsParserException { +// Javac 1.6.0_01 doesn't like the cast below if this is parameterized +@SuppressWarnings("unchecked") JsNode unknown = map(exprNode); if (unknown instanceof JsExpression) { return (JsExpression) unknown; @@ -623,7 +627,8 @@ JsFor toFor = new JsFor(makeSourceInfo(forNode)); // The first item is either an expression or a JsVars. - // + // Javac 1.6.0_01 doesn't like the cast below if this is parameterized + @SuppressWarnings("unchecked") JsNode initThingy = map(fromInit); if (initThingy != null) { if (initThingy instanceof JsVars) { @@ -839,6 +844,8 @@ private JsExpression mapOptionalExpression(Node exprNode) throws JsParserException { +// Javac 1.6.0_01 doesn't like the cast below if this is parameterized +@SuppressWarnings("unchecked") JsNode unknown = map(exprNode); if (unknown != null) { if (unknown instanceof JsExpression) { @@ -984,6 +991,8 @@ } private JsStatement mapStatement(Node nodeStmt) throws JsParserException { +// Javac 1.6.0_01 doesn't like the cast below if this is parameterized +@SuppressWarnings("unchecked") JsNode unknown = map(nodeStmt); if (unknown != null) { if (unknown instanceof JsStatement) { --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5793 commited - Not sure how this got added in (recreated an SVN client and inadverten...
Revision: 5793 Author: sumitchan...@google.com Date: Fri Jul 24 16:45:51 2009 Log: Not sure how this got added in (recreated an SVN client and inadvertently checked in svn client specific stuff to the repo). http://code.google.com/p/google-web-toolkit/source/detail?r=5793 Deleted: /trunk/ google-web-toolkit --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5787 commited - WindowImplIE uses a TextResource as the source of JavaScript code inst...
Revision: 5787 Author: jlaba...@google.com Date: Fri Jul 24 10:34:50 2009 Log: WindowImplIE uses a TextResource as the source of JavaScript code instead of a JSNI mathed that uses function.toString(). Patch by: jlabanca Review by: jgw http://code.google.com/p/google-web-toolkit/source/detail?r=5787 Added: /trunk/user/src/com/google/gwt/user/client/impl/initWindowCloseHandler.js /trunk/user/src/com/google/gwt/user/client/impl/initWindowResizeHandler.js /trunk/user/src/com/google/gwt/user/client/impl/initWindowScrollHandler.js Modified: /trunk/user/src/com/google/gwt/user/User.gwt.xml /trunk/user/src/com/google/gwt/user/client/impl/WindowImplIE.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/user/client/impl/initWindowCloseHandler.js Fri Jul 24 10:34:50 2009 @@ -0,0 +1,38 @@ +function __gwt_initWindowCloseHandler(beforeunload, unload) { + var wnd = window + , oldOnBeforeUnload = wnd.onbeforeunload + , oldOnUnload = wnd.onunload; + + wnd.onbeforeunload = function(evt) { +var ret, oldRet; +try { + ret = beforeunload(); +} finally { + oldRet = oldOnBeforeUnload && oldOnBeforeUnload(evt); +} +// Avoid returning null as IE6 will coerce it into a string. +// Ensure that "" gets returned properly. +if (ret != null) { + return ret; +} +if (oldRet != null) { + return oldRet; +} +// returns undefined. + }; + + wnd.onunload = function(evt) { +try { + unload(); +} finally { + oldOnUnload && oldOnUnload(evt); + wnd.onresize = null; + wnd.onscroll = null; + wnd.onbeforeunload = null; + wnd.onunload = null; +} + }; + + // Remove the reference once we've initialize the handler + wnd.__gwt_initWindowCloseHandler = undefined; +} === --- /dev/null +++ /trunk/user/src/com/google/gwt/user/client/impl/initWindowResizeHandler.js Fri Jul 24 10:34:50 2009 @@ -0,0 +1,14 @@ +function __gwt_initWindowResizeHandler(resize) { + var wnd = window, oldOnResize = wnd.onresize; + + wnd.onresize = function(evt) { +try { + resize(); +} finally { + oldOnResize && oldOnResize(evt); +} + }; + + // Remove the reference once we've initialize the handler + wnd.__gwt_initWindowResizeHandler = undefined; +} === --- /dev/null +++ /trunk/user/src/com/google/gwt/user/client/impl/initWindowScrollHandler.js Fri Jul 24 10:34:50 2009 @@ -0,0 +1,14 @@ +function __gwt_initWindowScrollHandler(scroll) { + var wnd = window, oldOnScroll = wnd.onscroll; + + wnd.onscroll = function(evt) { +try { + scroll(); +} finally { + oldOnScroll && oldOnScroll(evt); +} + }; + + // Remove the reference once we've initialize the handler + wnd.__gwt_initWindowScrollHandler = undefined; +} === --- /trunk/user/src/com/google/gwt/user/User.gwt.xmlTue Feb 17 09:09:03 2009 +++ /trunk/user/src/com/google/gwt/user/User.gwt.xmlFri Jul 24 10:34:50 2009 @@ -21,6 +21,7 @@ + === --- /trunk/user/src/com/google/gwt/user/client/impl/WindowImplIE.java Wed Sep 3 11:45:46 2008 +++ /trunk/user/src/com/google/gwt/user/client/impl/WindowImplIE.java Fri Jul 24 10:34:50 2009 @@ -18,12 +18,39 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.ScriptElement; +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.TextResource; import com.google.gwt.user.client.Command; /** * IE implementation of {...@link com.google.gwt.user.client.impl.WindowImpl}. */ public class WindowImplIE extends WindowImpl { + + /** + * The resources for this implementation. + */ + public interface Resources extends ClientBundle { +Resources INSTANCE = GWT.create(Resources.class); + +/** + * Contains the function body used to initialize the window close handler. + */ +@Source("initWindowCloseHandler.js") +TextResource initWindowCloseHandler(); + +/** + * Contains the function body used to initialize the window resize handler. + */ +@Source("initWindowResizeHandler.js") +TextResource initWindowResizeHandler(); + +/** + * Contains the function body used to initialize the window scroll handler. + */ +@Source("initWindowScrollHandler.js") +TextResource initWindowScrollHandler(); + } /** * For IE6, reading from $wnd.location.hash drops part of the fragment if the @@ -54,8 +81,8 @@ @Override public void initWindowCloseHandler() { -initHandler(getWindowCloseHandlerMethodString(), -"__gwt_initWindowCloseHandler", new Command() { +initHandler(Resources.INSTANCE.initWindowCloseHandler().getText(), +new Command() { public void execut
[gwt-contrib] [google-web-toolkit] r5792 commited - Fix StackTraceCreatorTest in hosted mode....
Revision: 5792 Author: b...@google.com Date: Fri Jul 24 16:29:28 2009 Log: Fix StackTraceCreatorTest in hosted mode. Patch by: bobv Review by: rjrjr (TBR) http://code.google.com/p/google-web-toolkit/source/detail?r=5792 Modified: /trunk/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java === --- /trunk/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java Thu Jul 23 13:45:16 2009 +++ /trunk/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java Fri Jul 24 16:29:28 2009 @@ -17,6 +17,7 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.JavaScriptException; +import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.JsArrayString; import com.google.gwt.junit.client.GWTTestCase; @@ -26,7 +27,7 @@ */ public class StackTraceCreatorTest extends GWTTestCase { public static void testJavaScriptException() { -JsArrayString start = StackTraceCreator.createStackTrace(); +JsArrayString start = sample(); Throwable t = null; try { throwNative(); @@ -54,7 +55,7 @@ checkStack(myName, t); -JsArrayString end = StackTraceCreator.createStackTrace(); +JsArrayString end = sample(); assertEquals(start, end); } @@ -63,22 +64,22 @@ */ public static void testReentrantCalls() { if (!GWT.isScript()) { - // StackTraceCreator.createStackTrace() is useless in hosted mode + // sample is useless in hosted mode return; } -JsArrayString start = StackTraceCreator.createStackTrace(); +JsArrayString start = sample(); JsArrayString stack = countDown(5); assertNotNull(stack); assertTrue(stack.length() > 0); -JsArrayString end = StackTraceCreator.createStackTrace(); +JsArrayString end = sample(); assertEquals(start, end); } public static void testStackTraces() { -JsArrayString start = StackTraceCreator.createStackTrace(); +JsArrayString start = sample(); Throwable t; try { @@ -96,9 +97,16 @@ checkStack(myName, t); -JsArrayString end = StackTraceCreator.createStackTrace(); +JsArrayString end = sample(); assertEquals(start, end); } + + private static void assertEquals(JsArrayString start, JsArrayString end) { +assertEquals("length", start.length(), end.length()); +for (int i = 0, j = start.length(); i < j; i++) { + assertEquals("frame " + i, start.get(i), end.get(i)); +} + } private static void checkStack(String myName, Throwable t) { assertNotNull("myName", myName); @@ -129,19 +137,20 @@ assertTrue("Did not find " + myName + " in the stack " + observedStack, found); } - - private static void assertEquals(JsArrayString start, JsArrayString end) { -assertEquals("length", start.length(), end.length()); -for (int i = 0, j = start.length(); i < j; i++) { - assertEquals("frame " + i, start.get(i), end.get(i)); -} - } private static JsArrayString countDown(int count) { if (count > 0) { return countDown(count - 1); } else { + return sample(); +} + } + + private static JsArrayString sample() { +if (GWT.isScript()) { return StackTraceCreator.createStackTrace(); +} else { + return JavaScriptObject.createArray().cast(); } } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5785 commited - Fixes a buffer overflow in AsyncFragmentLoader....
Revision: 5785 Author: sp...@google.com Date: Thu Jul 23 14:47:07 2009 Log: Fixes a buffer overflow in AsyncFragmentLoader. Review by: bobv http://code.google.com/p/google-web-toolkit/source/detail?r=5785 Modified: /trunk/user/src/com/google/gwt/core/client/impl/AsyncFragmentLoader.java /trunk/user/test/com/google/gwt/core/client/impl/AsyncFragmentLoaderTest.java === --- /trunk/user/src/com/google/gwt/core/client/impl/AsyncFragmentLoader.java Thu Jul 16 16:35:08 2009 +++ /trunk/user/src/com/google/gwt/core/client/impl/AsyncFragmentLoader.java Thu Jul 23 14:47:07 2009 @@ -108,8 +108,9 @@ /** * A trivial queue of int's that should compile much better than a - * LinkedList. It assumes that there will be a maximum number - * of items passed through the queue for its entire life. + * LinkedList . It assumes that it has a bound on the number of + * items added to the queue. Removing items does not free up more space, but + * calling clear() does. */ private static class BoundedIntQueue { private final int[] array; @@ -119,22 +120,31 @@ public BoundedIntQueue(int maxPuts) { array = new int[maxPuts]; } - + public void add(int x) { assert (write < array.length); array[write++] = x; } - + +/** + * Removes all elements, and also makes all space in the queue available + * again. + */ +public void clear() { + read = 0; + write = 0; +} + public int peek() { assert read < write; return array[read]; } - + public int remove() { assert read < write; return array[read++]; } - + public int size() { return write - read; } @@ -177,6 +187,12 @@ handlersToRun.add(waitingForInitialFragmentsErrorHandlers.remove()); waitingForInitialFragments.remove(); } + + /* + * Call clear() here so that waitingForInitialFragments makes all of its + * space available for later requests. + */ + waitingForInitialFragments.clear(); // add handlers for pending initial fragment downloads handlersToRun.addAll(initialFragmentErrorHandlers.values()); === --- /trunk/user/test/com/google/gwt/core/client/impl/AsyncFragmentLoaderTest.java Sun Jul 19 09:52:17 2009 +++ /trunk/user/test/com/google/gwt/core/client/impl/AsyncFragmentLoaderTest.java Thu Jul 23 14:47:07 2009 @@ -237,6 +237,30 @@ loader.fragmentHasLoaded(5); reqs.assertFragmentsRequested(); } + + /** + * This test catches a case in an earlier version of AsyncFragmentLoader where + * AsyncFragmentLoader.waitingForInitialFragments could exhaust its available + * space. + */ + public void testOverflowInWaitingForInitialFragments() { +MockLoadStrategy reqs = new MockLoadStrategy(); +int numEntries = 6; +AsyncFragmentLoader loader = new AsyncFragmentLoader(numEntries, new int[] { +1, 2, 3}, reqs, NULL_LOGGER); + +/* + * Repeatedly queue up extra downloads waiting on an initial and then fail. + */ +for (int i = 0; i < 10; i++) { + MockErrorHandler error = new MockErrorHandler(); + loader.inject(4, error); + reqs.assertFragmentsRequested(1); + + loadFailed(reqs, 1); + assertTrue(error.getWasCalled()); +} + } /** * A thorough exercise of loading with an initial load sequence specified. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5788 commited - Fixes JsStackEmulator#baseName() so it handles urls and file system ur...
Revision: 5788 Author: jlaba...@google.com Date: Fri Jul 24 11:33:26 2009 Log: Fixes JsStackEmulator#baseName() so it handles urls and file system urls. Bob came up with the code. Patch by: bobv, jlabanca Review: TBR http://code.google.com/p/google-web-toolkit/source/detail?r=5788 Modified: /trunk/dev/core/src/com/google/gwt/dev/js/JsStackEmulator.java === --- /trunk/dev/core/src/com/google/gwt/dev/js/JsStackEmulator.java Thu Jul 23 13:45:16 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/js/JsStackEmulator.java Fri Jul 24 11:33:26 2009 @@ -684,7 +684,12 @@ * Strips off the final name segment. */ private String baseName(String fileName) { + // Try the system path separator int lastIndex = fileName.lastIndexOf(File.separator); + if (lastIndex == -1) { +// Otherwise, try URL path separator +lastIndex = fileName.lastIndexOf('/'); + } if (lastIndex != -1) { return fileName.substring(lastIndex + 1); } else { --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5786 commited - Make declaration statements for the variables created in the catch blo...
Revision: 5786 Author: sco...@google.com Date: Thu Jul 23 14:49:51 2009 Log: Make declaration statements for the variables created in the catch block normalizer, instead of just assignment statements. Also fixes a problem where the same JLocalRef would appear in the tree multiple times. Patch by: moedinger, me Review by: me, spoon http://code.google.com/p/google-web-toolkit/source/detail?r=5786 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CatchBlockNormalizer.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CatchBlockNormalizer.java Thu Apr 9 08:41:34 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CatchBlockNormalizer.java Thu Jul 23 14:49:51 2009 @@ -18,8 +18,8 @@ import com.google.gwt.dev.jjs.SourceInfo; import com.google.gwt.dev.jjs.ast.Context; import com.google.gwt.dev.jjs.ast.JBlock; +import com.google.gwt.dev.jjs.ast.JDeclarationStatement; import com.google.gwt.dev.jjs.ast.JExpression; -import com.google.gwt.dev.jjs.ast.JExpressionStatement; import com.google.gwt.dev.jjs.ast.JIfStatement; import com.google.gwt.dev.jjs.ast.JInstanceOf; import com.google.gwt.dev.jjs.ast.JLocal; @@ -63,17 +63,17 @@ } SourceInfo catchInfo = x.getCatchBlocks().get(0).getSourceInfo(); - - JLocal exObj = popTempLocal(); - JLocalRef exRef = new JLocalRef(catchInfo, exObj); + JLocal exVar = popTempLocal(); JBlock newCatchBlock = new JBlock(catchInfo); - // $e = Exceptions.caught($e) - JMethod caughtMethod = program.getIndexedMethod("Exceptions.caught"); - JMethodCall call = new JMethodCall(catchInfo, null, caughtMethod); - call.addArg(exRef); - JExpressionStatement asg = program.createAssignmentStmt(catchInfo, exRef, - call); - newCatchBlock.addStmt(asg); + + { +// $e = Exceptions.caught($e) +JMethod caughtMethod = program.getIndexedMethod("Exceptions.caught"); +JMethodCall call = new JMethodCall(catchInfo, null, caughtMethod); +call.addArg(new JLocalRef(catchInfo, exVar)); +newCatchBlock.addStmt(program.createAssignmentStmt(catchInfo, +new JLocalRef(catchInfo, exVar), call)); + } /* * Build up a series of if, else if statements to test the type of the @@ -82,18 +82,21 @@ * Go backwards so we can nest the else statements in the correct order! */ // rethrow the current exception if no one caught it - JStatement cur = new JThrowStatement(catchInfo, exRef); + JStatement cur = new JThrowStatement(catchInfo, new JLocalRef(catchInfo, + exVar)); for (int i = x.getCatchBlocks().size() - 1; i >= 0; --i) { JBlock block = x.getCatchBlocks().get(i); JLocalRef arg = x.getCatchArgs().get(i); catchInfo = block.getSourceInfo(); JReferenceType argType = (JReferenceType) arg.getType(); -// if ($e instanceof ArgType) { userVar = $e; } -JExpression ifTest = new JInstanceOf(catchInfo, argType, exRef); -asg = program.createAssignmentStmt(catchInfo, arg, exRef); +// if ($e instanceof ArgType) { var userVar = $e; } +JExpression ifTest = new JInstanceOf(catchInfo, argType, new JLocalRef( +catchInfo, exVar)); +JDeclarationStatement declaration = new JDeclarationStatement( +catchInfo, arg, new JLocalRef(catchInfo, exVar)); if (!block.getStatements().isEmpty()) { // Only bother adding the assignment if the block is non-empty - block.addStmt(0, asg); + block.addStmt(0, declaration); } // nest the previous as an else for me cur = new JIfStatement(catchInfo, ifTest, block, cur); @@ -101,7 +104,7 @@ newCatchBlock.addStmt(cur); x.getCatchArgs().clear(); - x.getCatchArgs().add(exRef); + x.getCatchArgs().add(new JLocalRef(newCatchBlock.getSourceInfo(), exVar)); x.getCatchBlocks().clear(); x.getCatchBlocks().add(newCatchBlock); } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5784 commited - Edited wiki page through web user interface.
Revision: 5784 Author: b...@google.com Date: Thu Jul 23 14:21:00 2009 Log: Edited wiki page through web user interface. http://code.google.com/p/google-web-toolkit/source/detail?r=5784 Modified: /wiki/WebModeExceptions.wiki === --- /wiki/WebModeExceptions.wikiFri Feb 27 07:32:06 2009 +++ /wiki/WebModeExceptions.wikiThu Jul 23 14:21:00 2009 @@ -61,6 +61,16 @@ * `collect()` raises an exception and passes it to `infer()`. * `infer()` is implemented and uses the browser's `e.stack` or `e.message` property to read activation records to produce a reasonably complete stack trace. += Emulated Stack Data = + +The GWT compiler can optionally emit JavaScript code to maintain a meta-stack that emulates standard JS dispatch semantics. This meta-stack can be used to provide stack trace data on browsers that do not provide stack data for all exception types. This is implemented as an additional compiler pass that is conditionalized on the presence of `StackTraceCreator.CollectorEmulated` within the compilation. Full documentation on the transforms performed is located in the javadoc for [http://code.google.com/p/google-web-toolkit/source/browse/trunk/dev/core/src/com/google/gwt/dev/js/JsStackEmulator.java JsStackEmulator], but the basic transformation is as follows: + * The execution stack is modeled as an array that contains references to the JavaScript functions being executed. There is a global variable that maintains the current stack depth and an optional co-array that provides current file and line number data. + * A stack frame is pushed on every function entrance. This involves incrementing the stack depth counter and assigning the current function into the meta-stack array. The stack depth for the function's invocation is saved in a local variable. + * Before every last statement in normal flow control, the stack is popped simply by decrementing the stack depth variable. The last statement is any return statement not in a try/finally block, conditionally the last statement in a finally block whose associated try contains a return statement, and the last statement in the function. +* A return statement inside of a try block with an associated finally block simply sets a function-local variable indicating that the stack should be popped at the end of the finally block. + * When any exception is thrown (Java-derived or a native browser exception), the stack depth is reset after the call to `Exceptions.caught` to the function's local stack index variable. +* In order to ensure that a native exception's stack data is recorded properly and any subsequent finally block is executed with the correct global stack depth, any try/finally statement without a catch block has a trivial catch block added to ensure the currently-propagating exception has been correctly wrapped, to reset the global stack depth to the local stack index, and then to re-throw the exception. + = Resymbolization = Method names in deployed code will have been obfuscated and will not be particularly useful as encoded in the module permutations. To that end, a means for resymbolizing a stack trace has been implemented. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5780 commited - Adding emma_ant-2.0.5312.jar so we can reference it from our build fil...
Revision: 5780 Author: jlaba...@google.com Date: Thu Jul 23 13:46:11 2009 Log: Adding emma_ant-2.0.5312.jar so we can reference it from our build file. Also adding emma-2.0.5312-patched.jar, which is a direct copy of emma.jar, which should have been versioned. Patch by: jlabanca Review by: scottb http://code.google.com/p/google-web-toolkit/source/detail?r=5780 Added: /tools/redist/emma/emma-2.0.5312-patched.jar /tools/redist/emma/emma_ant-2.0.5312.jar Modified: /tools/redist/emma/README.txt === --- /dev/null +++ /tools/redist/emma/emma-2.0.5312-patched.jarThu Jul 23 13:46:11 2009 Binary file, no diff available. === --- /dev/null +++ /tools/redist/emma/emma_ant-2.0.5312.jarThu Jul 23 13:46:11 2009 Binary file, no diff available. === --- /tools/redist/emma/README.txt Mon Jan 19 15:16:47 2009 +++ /tools/redist/emma/README.txt Thu Jul 23 13:46:11 2009 @@ -7,7 +7,15 @@ emma-multiclassloader-fix.patch: the patch to the emma src to get aroud the classloader issue. -emma.jar: the jar file produced by the patched emma. +emma.jar: the jar file produced by the patched emma version 2.0.5312. The emma +version was mistakenly left off of the filename, so the jar was later copied to +emma-2.0.5312-patched.jar. The two jar files are identical. + +emma-2.0.5312-patched.jar: the jar file produced by the patched emma. This jar +is identical to emma.jar. + +emma_ant-2.0.5312.jar: the jar file containing custom EMMA ant tasks that can be +downloaded from sourceforge.net. com.mountainminds.eclemma.core_1.3.2.jar : eclemma jar containing the updated emma.jar --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5781 commited - Added emma code coverage generation to the build file. ant emma test ...
Revision: 5781 Author: jlaba...@google.com Date: Thu Jul 23 13:49:48 2009 Log: Added emma code coverage generation to the build file. ant emma test emma.merge will generate emma reports for each test, then merge them. Patch by: jlabanca Review by: fabbott http://code.google.com/p/google-web-toolkit/source/detail?r=5781 Modified: /trunk/build-tools/ant-gwt/build.xml /trunk/build.xml /trunk/common.ant.xml /trunk/dev/core/build.xml /trunk/tools/api-checker/build.xml /trunk/user/build.xml === --- /trunk/build-tools/ant-gwt/build.xmlWed Jun 10 14:39:00 2009 +++ /trunk/build-tools/ant-gwt/build.xmlThu Jul 23 13:49:48 2009 @@ -3,6 +3,10 @@ + + + + @@ -12,7 +16,7 @@ - + @@ -33,32 +37,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + === --- /trunk/build.xmlMon Jul 13 05:30:55 2009 +++ /trunk/build.xmlThu Jul 23 13:49:48 2009 @@ -5,6 +5,7 @@ + @@ -119,6 +122,14 @@ + + + + + + + + @@ -133,6 +144,7 @@ + @@ -163,6 +175,7 @@ + @@ -177,20 +190,28 @@ + + + + + + - + - + + + @@ -206,6 +227,19 @@ + + + + + + + + + + + + + @@ -303,6 +337,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + === --- /trunk/dev/core/build.xml Wed Jun 10 14:39:00 2009 +++ /trunk/dev/core/build.xml Thu Jul 23 13:49:48 2009 @@ -9,7 +9,7 @@ - + @@ -166,38 +166,14 @@ - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - + + === --- /trunk/tools/api-checker/build.xml Tue Jun 16 08:28:58 2009 +++ /trunk/tools/api-checker/build.xml Thu Jul 23 13:49:48 2009 @@ -10,6 +10,10 @@ + + + + @@ -20,7 +24,7 @@ - + @@ -42,33 +46,12 @@ - - - - - - - - - - - - - - - + + - - - - - - - - - + + === --- /trunk/user/build.xml Sun Jul 19 11:38:45 2009 +++ /trunk/user/build.xml Thu Jul 23 13:49:48 2009 @@ -3,10 +3,14 @@ + + + +
[gwt-contrib] [google-web-toolkit] r5779 commited - Alter the compiler so that it will emit code that simulates the JS sta...
Revision: 5779 Author: b...@google.com Date: Thu Jul 23 13:45:16 2009 Log: Alter the compiler so that it will emit code that simulates the JS stack in order to provide stack traces on browsers that do not provide stack trace data for native exceptions. Changes web-mode GWTTestCases to enable emulated stack data on browsers that do not provide stack data for all errors. http://gwt-code-reviews.appspot.com/47816/show Patch by: bobv Review by: spoon, bruce http://code.google.com/p/google-web-toolkit/source/detail?r=5779 Added: /trunk/dev/core/src/com/google/gwt/dev/js/JsStackEmulator.java /trunk/user/src/com/google/gwt/core/EmulateJsStack.gwt.xml /trunk/user/test/com/google/gwt/core/client/impl/EmulatedStackTraceTest.java Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsProgram.java /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java /trunk/user/src/com/google/gwt/core/CompilerParameters.gwt.xml /trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java /trunk/user/src/com/google/gwt/junit/JUnit.gwt.xml /trunk/user/super/com/google/gwt/emul/java/lang/StackTraceElement.java /trunk/user/super/com/google/gwt/emul/java/lang/Throwable.java /trunk/user/test/com/google/gwt/core/CoreSuite.java /trunk/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java === --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/dev/js/JsStackEmulator.java Thu Jul 23 13:45:16 2009 @@ -0,0 +1,846 @@ +/* + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.dev.js; + +import com.google.gwt.core.ext.BadPropertyValueException; +import com.google.gwt.core.ext.PropertyOracle; +import com.google.gwt.dev.jjs.HasSourceInfo; +import com.google.gwt.dev.jjs.SourceInfo; +import com.google.gwt.dev.js.ast.JsArrayAccess; +import com.google.gwt.dev.js.ast.JsArrayLiteral; +import com.google.gwt.dev.js.ast.JsBinaryOperation; +import com.google.gwt.dev.js.ast.JsBinaryOperator; +import com.google.gwt.dev.js.ast.JsBlock; +import com.google.gwt.dev.js.ast.JsCatch; +import com.google.gwt.dev.js.ast.JsContext; +import com.google.gwt.dev.js.ast.JsExprStmt; +import com.google.gwt.dev.js.ast.JsExpression; +import com.google.gwt.dev.js.ast.JsFor; +import com.google.gwt.dev.js.ast.JsFunction; +import com.google.gwt.dev.js.ast.JsInvocation; +import com.google.gwt.dev.js.ast.JsModVisitor; +import com.google.gwt.dev.js.ast.JsName; +import com.google.gwt.dev.js.ast.JsNameRef; +import com.google.gwt.dev.js.ast.JsNew; +import com.google.gwt.dev.js.ast.JsPostfixOperation; +import com.google.gwt.dev.js.ast.JsPrefixOperation; +import com.google.gwt.dev.js.ast.JsProgram; +import com.google.gwt.dev.js.ast.JsReturn; +import com.google.gwt.dev.js.ast.JsStatement; +import com.google.gwt.dev.js.ast.JsStringLiteral; +import com.google.gwt.dev.js.ast.JsThrow; +import com.google.gwt.dev.js.ast.JsTry; +import com.google.gwt.dev.js.ast.JsUnaryOperation; +import com.google.gwt.dev.js.ast.JsUnaryOperator; +import com.google.gwt.dev.js.ast.JsVars; +import com.google.gwt.dev.js.ast.JsVisitor; +import com.google.gwt.dev.js.ast.JsWhile; +import com.google.gwt.dev.js.ast.JsVars.JsVar; +import com.google.gwt.dev.util.collect.Lists; +import com.google.gwt.dev.util.collect.Maps; + +import java.io.File; +import java.util.List; +import java.util.Map; + +/** + * Emulates the JS stack in order to provide useful stack traces on browers that + * do not provide useful stack information. + * + * @see com.google.gwt.core.client.impl.StackTraceCreator + */ +public class JsStackEmulator { + + /** + * Resets the global stack depth to the local stack index and top stack frame + * after calls to Exceptions.caught. This is created by + * {...@link EntryExitVisitor#visit(JsCatch, JsContext)}. + */ + private class CatchStackReset extends JsModVisitor { + +/** + * The local stackIndex variable in the function. + */ +private final EntryExitVisitor eeVisitor; + +public CatchStackReset(EntryExitVisitor eeVisitor) { + this.eeVisitor = eeVisitor; +} + +@Override +public void endVisit(JsExprStmt x, JsContext ctx) { + // Looking for e = caught(e); + JsExp
[gwt-contrib] [google-web-toolkit] r5783 commited - Branch for work on intraprocedural optimizations
Revision: 5783 Author: cromwellian Date: Thu Jul 23 13:58:59 2009 Log: Branch for work on intraprocedural optimizations http://code.google.com/p/google-web-toolkit/source/detail?r=5783 Added: /changes/cromwellian/intraprocedural --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5756 commited - Fix incorrect computation in JTypeOracle.computeSingleJsoImplData() wh...
Revision: 5756 Author: b...@google.com Date: Mon Jul 20 14:25:19 2009 Log: Fix incorrect computation in JTypeOracle.computeSingleJsoImplData() which to include super-interfaces when determining if an interface is a tag interface. Patch by: bobv Review by: scottb http://code.google.com/p/google-web-toolkit/source/detail?r=5756 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java /trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/TypeHierarchyTest.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java Sun May 24 16:56:31 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java Mon Jul 20 14:25:19 2009 @@ -486,6 +486,36 @@ public boolean isSuperClass(JClassType type, JClassType qType) { return get(superClassMap, type).contains(qType); } + + /** + * Returns true if the given type and it's super-interfaces define no methods. + */ + public boolean isTagInterface(JInterfaceType type) { +Set seen = new IdentityHashSet(); +List q = new LinkedList(); +seen.add(type); +q.add(type); + +while (!q.isEmpty()) { + JInterfaceType intf = q.remove(0); + + List methods = intf.getMethods(); + int size = methods.size(); + if (size == 0 + || (size == 1 && methods.get(0).getName().equals("$clinit"))) { +// OK, add any super-interfaces; +for (JInterfaceType superIntf : intf.getImplements()) { + if (seen.add(superIntf)) { +q.add(superIntf); + } +} + } else { +return false; + } +} + +return true; + } /** * This method should be called after altering the types that are live in the @@ -683,14 +713,12 @@ } JInterfaceType intr = (JInterfaceType) refType; -if (intr.getMethods().size() <= 1) { +if (isTagInterface(intr)) { /* * Record a tag interface as being implemented by JSO, since they * don't actually have any methods and we want to avoid spurious * messages about multiple JSO types implementing a common interface. */ - assert intr.getMethods().size() == 0 - || intr.getMethods().get(0).getName().equals("$clinit"); jsoSingleImpls.put(intr, program.getJavaScriptObject()); /* === --- /trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/TypeHierarchyTest.java Sun May 24 10:37:46 2009 +++ /trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/TypeHierarchyTest.java Mon Jul 20 14:25:19 2009 @@ -15,12 +15,49 @@ */ package com.google.gwt.dev.jjs.test.singlejso; +import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.junit.client.GWTTestCase; /** * Tests SingleJso semantics in non-trivial type hierarchies. */ public class TypeHierarchyTest extends GWTTestCase { + + /** + * The bottom type for a non-trivial diamond-shaped inheritance pattern. + */ + static class DiamondImpl extends JavaScriptObject implements IDiamond2A, + IDiamond2B { +public static native DiamondImpl create() /*-{ + return {size : 42}; +}-*/; + +protected DiamondImpl() { +} + +public final native int size() /*-{ + return this.size; +}-*/; + } + + /** + * The root type for a non-trivial diamond-shaped inheritance pattern. + */ + interface IDiamond1 { +int size(); + } + + /** + * The left type for a non-trivial diamond-shaped inheritance pattern. + */ + interface IDiamond2A extends IDiamond1 { + } + + /** + * The right type for a non-trivial diamond-shaped inheritance pattern. + */ + interface IDiamond2B extends IDiamond1 { + } @Override public String getModuleName() { @@ -60,4 +97,14 @@ assertEquals("B2", b2.whoAmI()); } -} + public void testDiamond() { +IDiamond1 d1 = DiamondImpl.create(); +assertEquals(42, d1.size()); + +IDiamond2A d2a = DiamondImpl.create(); +assertEquals(42, d2a.size()); + +IDiamond2B d2b = DiamondImpl.create(); +assertEquals(42, d2b.size()); + } +} --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5782 commited - Personal branch for compiler optimization work.
Revision: 5782 Author: cromwellian Date: Thu Jul 23 13:57:57 2009 Log: Personal branch for compiler optimization work. http://code.google.com/p/google-web-toolkit/source/detail?r=5782 Added: /changes/cromwellian --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5775 commited - Created wiki page through web user interface.
Revision: 5775 Author: j...@google.com Date: Thu Jul 23 06:46:57 2009 Log: Created wiki page through web user interface. http://code.google.com/p/google-web-toolkit/source/detail?r=5775 Added: /wiki/WhyWidgetIsAClass.wiki === --- /dev/null +++ /wiki/WhyWidgetIsAClass.wikiThu Jul 23 06:46:57 2009 @@ -0,0 +1,61 @@ +#summary Why Widget is an abstract base class + +One question that often comes up about the GWT Widget class is why it is an abstract base class as opposed to an interface. After all, one should always prefer an interface to a class wherever possible, right? And indeed, there are many reasons to use interfaces, most notably that they're easier to test and mock, and that you can create new extensions of them more easily, because you can mix them into existing classes. + +So why is it that almost all client-side UI libraries, including GWT, provide an abstract base class rather than an interface for widgets/components? For example: + * GWT: `Widget` + * Swing: `JComponent` + * SWT: `Widget` + * Android: `View` + +One problem is that widgets tend to be "different", in that they have to enforce a lot of constraints required by their underlying implementations. SWT, for example, has to deal with the fact that win32 (and probably other systems) requires that a parent window be known when creating a child window. This is expressed in SWT through the constructor `Widget(Widget parent, int style)`. Such a constraint cannot be expressed using an interface. + +GWT's Widget class doesn't have to enforce that particular constraint, but there are others. One example is the logic found in `setParent()`, `onAttach()` and `onDetach()`, which contain very important, but subtle, logic -- failure to implement this properly will result in extremely difficult-to-debug memory leaks. + +== Workaround: Testing == + +Admittedly, this introduces some difficulties. Let's say you're writing unit tests for a custom widget, and you want to avoid using the Widget base class, so that you can easily run tests without requiring a display. One approach to this would be to create a View interface that is implemented by both the concrete widget implementation and a mock implementation. But how can you do this if you need it to be a Widget? An approach that has worked well for a number of teams looks like this: + +{{{ + interface View { +Widget asWidget(); +void setData(T data); + } + + class MyView extends Label implements View { +public void setData(T data) { + setText(data.toString()); +} + +public Widget asWidget() { + return this; +} + } + + class MockView implements View { +public Widget asWidget() { + return null; +} + +public void setData(T data) { + // Whatever. +} + } +}}} + +The `asWidget()` method allows you to avoid having `View` extend `Widget` at all -- only users of the view who need to actually add it to a panel will even call `asWidget()`. And the actual call will be inlined away by the compiler, which is nice. + +== Workaround: Union Types == + +It is sometimes convenient to be able to write methods that require a parameter that is both a widget, and also requires some interface to be implemented by it. For example, say I want to write a method that simply requires a `Widget` that implements `HasText`. There is no `WidgetThatHasText` interface (one can imagine the interface explosion that would stem from going down that path), and there couldn't be one because `Widget` is a class. One solution to this problem is to use something like the `View` approach above. But you could also use Java's union types, like so: + +{{{ + setHasTextWidget(new Label()); + setHasTextWidget(new HTML()); + + void setWidgetThatHasText(W foo) { +RootPanel.get().add(foo); + } +}}} + +It's a bit verbose, but perfectly functional, and the user of the method is not exposed to its verbosity. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5777 commited - Edited wiki page through web user interface.
Revision: 5777 Author: j...@google.com Date: Thu Jul 23 08:25:36 2009 Log: Edited wiki page through web user interface. http://code.google.com/p/google-web-toolkit/source/detail?r=5777 Modified: /wiki/WhyWidgetIsAClass.wiki === --- /wiki/WhyWidgetIsAClass.wikiThu Jul 23 06:46:57 2009 +++ /wiki/WhyWidgetIsAClass.wikiThu Jul 23 08:25:36 2009 @@ -50,8 +50,8 @@ It is sometimes convenient to be able to write methods that require a parameter that is both a widget, and also requires some interface to be implemented by it. For example, say I want to write a method that simply requires a `Widget` that implements `HasText`. There is no `WidgetThatHasText` interface (one can imagine the interface explosion that would stem from going down that path), and there couldn't be one because `Widget` is a class. One solution to this problem is to use something like the `View` approach above. But you could also use Java's union types, like so: {{{ - setHasTextWidget(new Label()); - setHasTextWidget(new HTML()); + setWidgetThatHasText(new Label()); + setWidgetThatHasText(new HTML()); void setWidgetThatHasText(W foo) { RootPanel.get().add(foo); --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5773 commited - Turn on the batching of test cases....
Revision: 5773 Author: amitman...@google.com Date: Wed Jul 22 10:25:37 2009 Log: Turn on the batching of test cases. Patch by: amitmanjhi http://code.google.com/p/google-web-toolkit/source/detail?r=5773 Modified: /trunk/common.ant.xml === --- /trunk/common.ant.xml Tue Jul 21 15:13:53 2009 +++ /trunk/common.ant.xml Wed Jul 22 10:25:37 2009 @@ -160,7 +160,7 @@ - + @@ -182,7 +182,7 @@ failureproperty="junit.failure" tempdir="@{test.out}" > - + --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5778 commited - Add libs that will be needed by forthcoming easymock based tests.
Revision: 5778 Author: rj...@google.com Date: Thu Jul 23 13:16:50 2009 Log: Add libs that will be needed by forthcoming easymock based tests. http://code.google.com/p/google-web-toolkit/source/detail?r=5778 Added: /tools/lib/asm /tools/lib/asm/COPYING /tools/lib/asm/asm-3.1-src.zip /tools/lib/asm/asm-3.1.jar /tools/lib/cglib /tools/lib/cglib/COPYING.txt /tools/lib/cglib/cglib-2.2.jar /tools/lib/cglib/cglib-src-2.2.jar /tools/lib/easymock /tools/lib/easymock/easymock-License.html /tools/lib/easymock/easymock-src.zip /tools/lib/easymock/easymock.jar /tools/lib/easymock/easymockclassextension-License.html /tools/lib/easymock/easymockclassextension-src.zip /tools/lib/easymock/easymockclassextension.jar === --- /dev/null +++ /tools/lib/asm/COPYING Thu Jul 23 13:16:50 2009 @@ -0,0 +1,29 @@ +Copyright (c) 2000-2005 INRIA, France Telecom +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. === --- /dev/null +++ /tools/lib/asm/asm-3.1-src.zip Thu Jul 23 13:16:50 2009 Binary file, no diff available. === --- /dev/null +++ /tools/lib/asm/asm-3.1.jar Thu Jul 23 13:16:50 2009 Binary file, no diff available. === --- /dev/null +++ /tools/lib/cglib/COPYING.txtThu Jul 23 13:16:50 2009 @@ -0,0 +1,204 @@ +cglib, Code Generation Library + + +Apache License + Version 2.0, January 2004 +http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + r
[gwt-contrib] [google-web-toolkit] r5772 commited - Removing typo'd branch.
Revision: 5772 Author: sco...@google.com Date: Wed Jul 22 08:58:00 2009 Log: Removing typo'd branch. http://code.google.com/p/google-web-toolkit/source/detail?r=5772 Deleted: /branches/snapshot-2009.07.24-r5768 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5776 commited - Rollbacks the offending commits, c5774 and part of c5773.
Revision: 5776 Author: amitman...@google.com Date: Thu Jul 23 07:56:17 2009 Log: Rollbacks the offending commits, c5774 and part of c5773. http://code.google.com/p/google-web-toolkit/source/detail?r=5776 Modified: /trunk/common.ant.xml /trunk/user/test/com/google/gwt/xml/client/XMLTest.java === --- /trunk/common.ant.xml Wed Jul 22 10:25:37 2009 +++ /trunk/common.ant.xml Thu Jul 23 07:56:17 2009 @@ -182,7 +182,7 @@ failureproperty="junit.failure" tempdir="@{test.out}" > - + === --- /trunk/user/test/com/google/gwt/xml/client/XMLTest.java Wed Jul 22 18:24:34 2009 +++ /trunk/user/test/com/google/gwt/xml/client/XMLTest.java Thu Jul 23 07:56:17 2009 @@ -268,12 +268,10 @@ public void testNavigation() { Document d = createTestDocument(); Element documentElement = d.getDocumentElement(); -// TODO (amitmanjhi): investigate why these tests are failing just in batch -// mode for both web and hosted mode tests. -//assertEquals("getPreviousSibling", documentElement.getPreviousSibling(), -//d.getChildNodes().item(0)); -//assertEquals("getNextSibling", documentElement.getNextSibling(), -//d.getChildNodes().item(2)); +assertEquals("getPreviousSibling", documentElement.getPreviousSibling(), +d.getChildNodes().item(0)); +assertEquals("getNextSibling", documentElement.getNextSibling(), +d.getChildNodes().item(2)); assertEquals("getDocumentElement", documentElement, d.getChildNodes().item( 1)); assertEquals("getTagName", documentElement.getTagName(), "doc"); @@ -310,9 +308,7 @@ assertEquals(top.getChildNodes().getLength(), 1); Comment commentNode = ns.createComment("comment ccc"); top.replaceChild(commentNode, yyy); -// TODO (amitmanjhi): investigate why this test is failing just in batch -// mode for both web and hosted mode tests. -// assertEquals(top.getFirstChild(), commentNode); +assertEquals(top.getFirstChild(), commentNode); assertEquals(top.getChildNodes().getLength(), 1); } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5770 commited - Creates snapshot-2009.07.21-r5768 from tr...@5768 via...
Revision: 5770 Author: r...@google.com Date: Wed Jul 22 07:48:12 2009 Log: Creates snapshot-2009.07.21-r5768 from tr...@5768 via svn copy -r5768 https://google-web-toolkit.googlecode.com/svn/trunk https://google-web-toolkit.googlecode.com/svn/branches/snapshot-2009.07.21-r5768 http://code.google.com/p/google-web-toolkit/source/detail?r=5770 Added: /branches/snapshot-2009.07.21-r5768 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5771 commited - Added branch-info.txt
Revision: 5771 Author: r...@google.com Date: Wed Jul 22 07:57:45 2009 Log: Added branch-info.txt http://code.google.com/p/google-web-toolkit/source/detail?r=5771 Added: /branches/snapshot-2009.07.21-r5768/branch-info.txt === --- /dev/null +++ /branches/snapshot-2009.07.21-r5768/branch-info.txt Wed Jul 22 07:57:45 2009 @@ -0,0 +1,8 @@ +branch-info.txt for the 2009.07.21 -r5768 snapshot branch. +Tracks interactions between this branch and other branches. +See: http://code.google.com/p/google-web-toolkit/wiki/ManagingMerges + +Copies: +/branches/snapshot-2009.07.21-r5768 was created (r5770) as a straight copy from /trunk/@5768 + +Merges: --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5768 commited - Adds some needed JTypeOracle javadoc....
Revision: 5768 Author: sco...@google.com Date: Tue Jul 21 18:31:48 2009 Log: Adds some needed JTypeOracle javadoc. Suggested by: bobv http://code.google.com/p/google-web-toolkit/source/detail?r=5768 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java Tue Jul 21 18:30:12 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java Tue Jul 21 18:31:48 2009 @@ -205,32 +205,85 @@ return instantiatedTypes.contains(type); } + /** + * A map of all interfaces to the set of classes that could theoretically + * implement them. + */ private final Map> couldBeImplementedMap = new IdentityHashMap>(); + /** + * A map of all classes to the set of interfaces that they could theoretically + * implement. + */ private final Map> couldImplementMap = new IdentityHashMap>(); + /** + * The set of all interfaces that are initially implemented by both a Java and + * Overlay type. + */ private final Set dualImpls = new IdentityHashSet(); + /** + * A map of all classes to the set of interfaces they directly implement, + * possibly through inheritance. + */ private final Map> implementsMap = new IdentityHashMap>(); private Set instantiatedTypes = null; + /** + * A map of all interfaces to the set of classes that directly implement them, + * possibly through inheritance. + */ private final Map> isImplementedMap = new IdentityHashMap>(); + /** + * Caches the {...@link Object} class. + */ private JClassType javaLangObject = null; + /** + * A map of all interfaces that are implemented by overlay types to the + * overlay type that initially implements it. + */ private final Map jsoSingleImpls = new IdentityHashMap(); + /** + * The associated {...@link JProgram}. + */ private final JProgram program; + /** + * A map of all classes to the set of classes that extend them, directly or + * indirectly. + */ private final Map> subClassMap = new IdentityHashMap>(); + /** + * A map of all interfaces to the set of interfaces that extend them, directly + * or indirectly. + */ private final Map> subInterfaceMap = new IdentityHashMap>(); + /** + * A map of all classes to the set of classes they extend, directly or + * indirectly. + */ private final Map> superClassMap = new IdentityHashMap>(); + /** + * A map of all interfaces to the set of interfaces they extend, directly or + * indirectly. + */ private final Map> superInterfaceMap = new IdentityHashMap>(); + /** + * A map of all methods with virtual overrides, onto the collection of + * overridden methods. Each key method's collections is a map of the set of + * subclasses who inherit the key method mapped onto the set of interface + * methods the key method virtually implements. For a definition of a virtual + * override, see {...@link #getAllVirtualOverrides(JMethod)}. + */ private final Map>> virtualUpRefMap = new IdentityHashMap>>(); public JTypeOracle(JProgram program) { @@ -459,10 +512,26 @@ } /** - * References to any methods which this method does not directly override - * within the class in which it is declared; however, some instantiable - * subclass will cause the implementation of this method to effectively - * override methods with identical signatures declared in unrelated classes. + * Returns the set of methods the given method virtually overrides. A virtual + * override is an association between a concrete method and an unrelated + * interface method with the exact same name and signature. The association + * occurs if and only if some subclass extends the concrete method's + * containing class and implements the interface method's containing + * interface. Example: + * + * + * interface IFoo { + * foo(); + * } + * class Unrelated { + * foo() { ... } + * } + * class Foo extends Unrelated implements IFoo { + * } + * + * + * In this case, Unrelated.foo() virtually implements + * IFoo.foo() in subclass Foo. */ public Set getAllVirtualOverrides(JMethod method) { Set results = new IdentityHashSet(); @@ -687,7 +756,8 @@ } /** - * Returns true if qType is a superinterface of type, directly or indirectly. + * Returns true if type extends the interface represented by qType, either + * directly or indirectly. */ private boolean extendsInterface(JInterfaceType type, JInterfaceType qType) { return get(superInterfaceMap, type).contains(qType); @@ -739,8 +809,8 @@ } /** - * Returns true if qType is an implemented interface of type, directly or - * indirectly. + * Returns true if type implements the interface represented by qType, either + * directly or indirectly. */ private boolean
[gwt-contrib] [google-web-toolkit] r5767 commited - Fixes internal type hierarchy for overlay types....
Revision: 5767 Author: sco...@google.com Date: Tue Jul 21 18:30:12 2009 Log: Fixes internal type hierarchy for overlay types. All interfaces implemented by any overlay types are now directly implemented by JSO itself. This resolves a subtle bug where things could get tightened to subclasses of JSO, which is never correct. Review by: bobv http://code.google.com/p/google-web-toolkit/source/detail?r=5767 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/JavaScriptObjectNormalizer.java === --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java Mon Jul 20 14:25:19 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java Tue Jul 21 18:30:12 2009 @@ -23,7 +23,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; @@ -210,7 +209,7 @@ private final Map> couldImplementMap = new IdentityHashMap>(); - private final Set dualImpl = new IdentityHashSet(); + private final Set dualImpls = new IdentityHashSet(); private final Map> implementsMap = new IdentityHashMap>(); @@ -364,6 +363,8 @@ couldImplementMap.clear(); isImplementedMap.clear(); couldBeImplementedMap.clear(); +jsoSingleImpls.clear(); +dualImpls.clear(); for (int i = 0; i < program.getDeclaredTypes().size(); ++i) { JReferenceType type = program.getDeclaredTypes().get(i); @@ -373,6 +374,31 @@ recordSuperSubInfo((JInterfaceType) type); } } + +/* + * Now that the basic type hierarchy is computed, move all interfaces that + * are implemented by overlay types onto JavaScriptObject itself before + * building the full maps. + */ +JClassType jsoType = program.getJavaScriptObject(); +Set jsoSubTypes = Collections.emptySet(); +if (jsoType != null) { + assert jsoType.getImplements().size() == 0; + jsoSubTypes = get(subClassMap, jsoType); + for (JClassType jsoSubType : jsoSubTypes) { +for (JInterfaceType intf : jsoSubType.getImplements()) { + jsoType.addImplements(intf); + jsoSingleImpls.put(intf, jsoSubType); + for (JInterfaceType superIntf : get(superInterfaceMap, intf)) { +if (!jsoSingleImpls.containsKey(superIntf)) { + jsoSingleImpls.put(superIntf, jsoSubType); +} + } +} +jsoSubType.clearImplements(); + } +} + for (int i = 0; i < program.getDeclaredTypes().size(); ++i) { JReferenceType type = program.getDeclaredTypes().get(i); if (type instanceof JClassType) { @@ -392,26 +418,17 @@ } } -computeSingleJsoImplData(); - } - - /** - * Returns true if qType is a superinterface of type, directly or indirectly. - */ - public boolean extendsInterface(JInterfaceType type, JInterfaceType qType) { -return get(superInterfaceMap, type).contains(qType); - } - - public JMethod findConcreteImplementation(JMethod method, - JClassType concreteType) { -for (JMethod m : concreteType.getMethods()) { - if (getAllOverrides(m).contains(method)) { -if (!m.isAbstract()) { - return m; -} +// Create dual mappings for any jso interface with a Java implementor. +int totalJsoTypes = jsoSubTypes.size() + 1; +for (JInterfaceType jsoIntf : jsoSingleImpls.keySet()) { + Set implementors = get(isImplementedMap, jsoIntf); + if (implementors.size() == totalJsoTypes) { +assert implementors.contains(jsoType); + } else { +assert implementors.size() > totalJsoTypes; +dualImpls.add(jsoIntf); } } -return null; } public Set getAllOverrides(JMethod method) { @@ -454,20 +471,12 @@ } public Set getInterfacesWithJavaAndJsoImpls() { -return Collections.unmodifiableSet(dualImpl); +return Collections.unmodifiableSet(dualImpls); } public Map getSingleJsoImpls() { return Collections.unmodifiableMap(jsoSingleImpls); } - - /** - * Returns true if qType is an implemented interface of type, directly or - * indirectly. - */ - public boolean implementsInterface(JClassType type, JInterfaceType qType) { -return get(implementsMap, type).contains(qType); - } public boolean isInstantiatedType(JReferenceType type) { return isInstantiatedType(type, instantiatedTypes); @@ -486,36 +495,6 @@ public boolean isSuperClass(JClassType type, JClassType qType) { return get(superClassMap, type).contains(qType); } - - /** - * Returns true if the given type and it's super-interfaces define no methods. - */ - public boolean isTagInterface(JInterfaceType type) { -Set seen = ne
[gwt-contrib] [google-web-toolkit] r5755 commited - Reinstating assertions default on in web tests, with -da to turn it of...
Revision: 5755 Author: fabb...@google.com Date: Mon Jul 20 11:52:26 2009 Log: Reinstating assertions default on in web tests, with -da to turn it off, from r5726, but this time with test fixes for IE-specific assertion trips. Patch by: flin, except CoverageTest.java & HandlerManagerTest.java fabbott, for those two test files Review by: fabbott, except CoverageTest.java and HandlerManagerTest.java jat, for those two test files http://code.google.com/p/google-web-toolkit/source/detail?r=5755 Added: /trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerDisableAssertions.java Modified: /trunk/dev/core/src/com/google/gwt/dev/GWTShell.java /trunk/dev/core/src/com/google/gwt/dev/HostedModeBase.java /trunk/dev/core/src/com/google/gwt/dev/Precompile.java /trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerEnableAssertions.java /trunk/dev/core/test/com/google/gwt/dev/GWTShellTest.java /trunk/user/src/com/google/gwt/junit/JUnitShell.java /trunk/user/test/com/google/gwt/dev/jjs/test/CoverageTest.java /trunk/user/test/com/google/gwt/event/shared/HandlerManagerTest.java === --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerDisableAssertions.java Mon Jul 20 11:52:26 2009 @@ -0,0 +1,47 @@ +/* + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.dev.util.arg; + +import com.google.gwt.util.tools.ArgHandlerFlag; + +/** + * Handler for -da arg to disable assertions in compiled code. + */ +public final class ArgHandlerDisableAssertions extends ArgHandlerFlag { + + private final OptionEnableAssertions option; + + public ArgHandlerDisableAssertions(OptionEnableAssertions option) { +this.option = option; + } + + @Override + public String getPurpose() { +return "Debugging: disables checking assertion statements in the compiled output."; + } + + @Override + public String getTag() { +return "-da"; + } + + @Override + public boolean setFlag() { +option.setEnableAssertions(false); +return true; + } + +} === --- /trunk/dev/core/src/com/google/gwt/dev/GWTShell.javaTue Jul 14 07:15:19 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/GWTShell.javaMon Jul 20 11:52:26 2009 @@ -90,7 +90,7 @@ /** * Concrete class to implement all shell options. */ - static class ShellOptionsImpl extends HostedModeBaseOptionsImpl implements + protected static class ShellOptionsImpl extends HostedModeBaseOptionsImpl implements HostedModeBaseOptions, WorkDirs, LegacyCompilerOptions { private int localWorkers; private File outDir; === --- /trunk/dev/core/src/com/google/gwt/dev/HostedModeBase.java Tue Jul 14 07:15:19 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/HostedModeBase.java Mon Jul 20 11:52:26 2009 @@ -32,6 +32,7 @@ import com.google.gwt.dev.shell.ShellModuleSpaceHost; import com.google.gwt.dev.util.Util; import com.google.gwt.dev.util.arg.ArgHandlerDisableAggressiveOptimization; +import com.google.gwt.dev.util.arg.ArgHandlerDisableAssertions; import com.google.gwt.dev.util.arg.ArgHandlerDisableCastChecking; import com.google.gwt.dev.util.arg.ArgHandlerDisableClassMetadata; import com.google.gwt.dev.util.arg.ArgHandlerDraftCompile; @@ -321,6 +322,7 @@ registerHandler(new ArgHandlerGenDir(options)); registerHandler(new ArgHandlerScriptStyle(options)); registerHandler(new ArgHandlerEnableAssertions(options)); + registerHandler(new ArgHandlerDisableAssertions(options)); registerHandler(new ArgHandlerDisableAggressiveOptimization(options)); registerHandler(new ArgHandlerDisableClassMetadata(options)); registerHandler(new ArgHandlerDisableCastChecking(options)); === --- /trunk/dev/core/src/com/google/gwt/dev/Precompile.java Tue Jul 14 07:15:19 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/Precompile.java Mon Jul 20 11:52:26 2009 @@ -43,6 +43,7 @@ import com.google.gwt.dev.util.PerfLogger; import com.google.gwt.dev.util.Util; import com.google.gwt.dev.util.arg.ArgHandlerDisableAggressiveOptimization; +import com.google.gwt.dev.util.arg.ArgHandlerDisableAssertions; import com.google.gwt.dev.util.arg.ArgHandlerDisableCastChecking; import com.google.gwt.dev.util.ar
[gwt-contrib] [google-web-toolkit] r5701 commited - Updated release notes for 1.7
Revision: 5701 Author: br...@google.com Date: Thu Jul 9 13:29:21 2009 Log: Updated release notes for 1.7 http://code.google.com/p/google-web-toolkit/source/detail?r=5701 Modified: /releases/1.7/distro-source/core/src/release_notes.html === --- /releases/1.7/distro-source/core/src/release_notes.html Mon Apr 6 09:57:48 2009 +++ /releases/1.7/distro-source/core/src/release_notes.html Thu Jul 9 13:29:21 2009 @@ -28,30 +28,70 @@ Google Web Toolkit Release Notes - @GWT_VERSION@ +@GWT_VERSION@ +1.6.4 1.6.3 - 1.6.2 - 1.5.3 - 1.5.2 - 1.5.1 (RC2) - 1.5.0 (RC) - 1.4.60 - 1.4.59 (RC2) - 1.4.10 (RC) - 1.3.3 - 1.3.1 (RC) - 1.2.22 - 1.2.21 (RC) - 1.1.10 - 1.1.0 (RC) - 1.0.21 +1.6.2 +1.5.3 +1.5.2 +1.5.1 (RC2) +1.5.0 (RC) +1.4.60 +1.4.59 (RC2) +1.4.10 (RC) +1.3.3 +1.3.1 (RC) +1.2.22 +1.2.21 (RC) +1.1.10 +1.1.0 (RC) +1.0.21 Release Notes for @GWT_VERSION@ + +This release adds explicit support for Internet Explorer 8, Firefox 3.5, and Safari 4 as well as a few high-priority bug fixes. +In all other respects, it is very similar to GWT 1.6. +Note, however, that this release is version 1.7 rather than version 1.6.5 to signify a potentially breaking change for libraries +that use deferred binding to specialize code based on user agent (see the next section for technical details). + + Potentially breaking changes and fixes + + + This release includes explicit support for IE8, which has some significant behavioral changes from prior versions of IE. + These changes are great enough that the new value ie8 has been added for the user.agent deferred binding client property. + If you have deferred binding rules (i.e.or ) or property providers + that are sensitive to user.agent, you may need to update them to account for the ie8 value. + For more information, see the http://code.google.com/p/google-web-toolkit/wiki/IE8Support";>technical notes. + + + Fixed Issues + + Updated GWT libraries to support IE8 + (http://code.google.com/p/google-web-toolkit/issues/detail?id=3558";>#3558, + http://code.google.com/p/google-web-toolkit/issues/detail?id=3329";>#3329) + +Native exception in Node.is() (http://code.google.com/p/google-web-toolkit/issues/detail?id=3644";>#3644) + + Incorrect firing of two click events from CheckBox and a related issue + (http://code.google.com/p/google-web-toolkit/issues/detail?id=3508";>#3508, + http://code.google.com/p/google-web-toolkit/issues/detail?id=3679";>#3679) + +Mouse wheel in FF3 (http://code.google.com/p/google-web-toolkit/issues/detail?id=2902";>#2902) +GWT outputs expressions too long for WebKit (http://code.google.com/p/google-web-toolkit/issues/detail?id=3455";>#3455) +java.sql.Date.valueOf error (http://code.google.com/p/google-web-toolkit/issues/detail?id=3731";>#3731) +Added a workaround for Firefox 3.5 regression (https://bugzilla.mozilla.org/show_bug.cgi?id=497780";>bugzilla #497780) + + + + + Release Notes for 1.6.4 + Fixed Issues + The classpath in the scripts created by junitCreator was updated to refer to /war/WEB-INF/classes rather than /bin. @@ -139,7 +179,7 @@ Added support for the contextmenu event, which allows users to detect and override the browser's default context menu Improved performance of NumberFormat - Added support for altering the number of decimals in a currency in NumberFormat +Added support for altering the number of decimals in a currency in NumberFormat Improved performance of Animations Improved the appearance of the default GWT style themes Improved the Showcase sample with more robust examples and more language translations @@ -172,12 +212,12 @@ This release has only a couple of minor changes from 1.4.59. - Fixed a bug in the benchmarking that prevented source code from showing up in reports. - Fixed a bug in the hosted mode servlet context emulation where getResource() would fail to - find a file in a module's public path. - Compiler output files of the form module.cache.html used to contain html - intended as a helpful not
[gwt-contrib] [google-web-toolkit] r5766 commited - This patch adds "batch" execution of GWTTestCases, significantly reduc...
Revision: 5766 Author: amitman...@google.com Date: Tue Jul 21 15:13:53 2009 Log: This patch adds "batch" execution of GWTTestCases, significantly reducing the synchronization and network overhead. Patch by: amitmanjhi Review (and simplifications) by: scottb http://code.google.com/p/google-web-toolkit/source/detail?r=5766 Added: /trunk/user/src/com/google/gwt/junit/BatchingStrategy.java Modified: /trunk/common.ant.xml /trunk/user/src/com/google/gwt/junit/JUnitMessageQueue.java /trunk/user/src/com/google/gwt/junit/JUnitShell.java /trunk/user/src/com/google/gwt/junit/client/GWTTestCase.java /trunk/user/src/com/google/gwt/junit/client/impl/JUnitHost.java /trunk/user/src/com/google/gwt/junit/client/impl/JUnitHostAsync.java /trunk/user/src/com/google/gwt/junit/rebind/GWTRunnerGenerator.java /trunk/user/src/com/google/gwt/junit/server/JUnitHostImpl.java /trunk/user/super/com/google/gwt/junit/translatable/com/google/gwt/junit/client/impl/GWTRunner.java === --- /dev/null +++ /trunk/user/src/com/google/gwt/junit/BatchingStrategy.java Tue Jul 21 15:13:53 2009 @@ -0,0 +1,67 @@ +/* + * Copyright 2009 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.junit; + +import com.google.gwt.junit.client.GWTTestCase; +import com.google.gwt.junit.client.impl.JUnitHost.TestInfo; + +import java.util.Set; + +/** + * An interface that specifies how tests should be batched. + */ +public interface BatchingStrategy { + + /** + * Returns the list of tests that should be executed along with this test. + */ + TestInfo[] getTestBlock(TestInfo currentTest); +} + +/** + * + * Strategy that does not batch tests. + */ +class NoBatchingStrategy implements BatchingStrategy { + public TestInfo[] getTestBlock(TestInfo currentTest) { +return new TestInfo[] {currentTest}; + } +} + +/** + * Strategy that batches all tests belonging to one module. + */ +class ModuleBatchingStrategy implements BatchingStrategy { + + /** + * Returns the list of all tests belonging to the module of + * currentTest. + */ + public TestInfo[] getTestBlock(TestInfo currentTest) { +String moduleName = currentTest.getTestModule(); +if (moduleName.endsWith(".JUnit")) { + moduleName = moduleName.substring(0, moduleName.length() + - ".JUnit".length()); +} +Set allTestsInModule = GWTTestCase.ALL_GWT_TESTS.get(moduleName); +if (allTestsInModule != null) { + assert allTestsInModule.size() > 0; + return allTestsInModule.toArray(new TestInfo[allTestsInModule.size()]); +} +// No data, default to just this test. +return new TestInfo[] {currentTest}; + } +} === --- /trunk/common.ant.xml Mon Jul 13 10:39:35 2009 +++ /trunk/common.ant.xml Tue Jul 21 15:13:53 2009 @@ -160,7 +160,7 @@ - + === --- /trunk/user/src/com/google/gwt/junit/JUnitMessageQueue.java Mon Jul 13 10:39:35 2009 +++ /trunk/user/src/com/google/gwt/junit/JUnitMessageQueue.java Tue Jul 21 15:13:53 2009 @@ -23,10 +23,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Map.Entry; /** - * A message queue to pass data between {...@link JUnitShell} and {...@link - * com.google.gwt.junit.server.JUnitHostImpl} in a thread-safe manner. + * A message queue to pass data between {...@link JUnitShell} and + * {...@link com.google.gwt.junit.server.JUnitHostImpl} in a thread-safe manner. * * * The public methods are called by the servlet to find out what test to execute @@ -45,8 +46,10 @@ */ public static class ClientStatus { public final String clientId; - -public JUnitResult currentTestResults = null; +/** + * Stores the testResults for the current block of tests. + */ +public Map currentTestBlockResults = null; public boolean hasRequestedCurrentTest = false; public boolean isNew = true; @@ -68,7 +71,7 @@ /** * The current test to execute. */ - private TestInfo currentTest; + private TestInfo[] currentBlock; /** * The number of TestCase clients executing in parallel. @@ -88,14 +91,14 @@ } /** - * Called by the servlet to query for for the next method to test. + * Called by the servlet to query for for the next block to test. * * @param timeout how lo
[gwt-contrib] [google-web-toolkit] r5769 commited - Creates snapshot-2009.07.21-r5768 from tr...@5768 via...
Revision: 5769 Author: r...@google.com Date: Wed Jul 22 07:45:04 2009 Log: Creates snapshot-2009.07.21-r5768 from tr...@5768 via svn copy -r5768 https://google-web-toolkit.googlecode.com/svn/trunk https://google-web-toolkit.googlecode.com/svn/branches/snapshot-2009.07.24-r5768 http://code.google.com/p/google-web-toolkit/source/detail?r=5769 Added: /branches/snapshot-2009.07.24-r5768 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5702 commited - Updated to include issue 3510
Revision: 5702 Author: br...@google.com Date: Thu Jul 9 13:54:25 2009 Log: Updated to include issue 3510 http://code.google.com/p/google-web-toolkit/source/detail?r=5702 Modified: /releases/1.7/distro-source/core/src/release_notes.html === --- /releases/1.7/distro-source/core/src/release_notes.html Thu Jul 9 13:29:21 2009 +++ /releases/1.7/distro-source/core/src/release_notes.html Thu Jul 9 13:54:25 2009 @@ -81,6 +81,7 @@ (http://code.google.com/p/google-web-toolkit/issues/detail?id=3508";>#3508, http://code.google.com/p/google-web-toolkit/issues/detail?id=3679";>#3679) +Compiler java.lang.StackOverflowError if you don't use -Xss to set a stack size (http://code.google.com/p/google-web-toolkit/issues/detail?id=3510";>#3510) Mouse wheel in FF3 (http://code.google.com/p/google-web-toolkit/issues/detail?id=2902";>#2902) GWT outputs expressions too long for WebKit (http://code.google.com/p/google-web-toolkit/issues/detail?id=3455";>#3455) java.sql.Date.valueOf error (http://code.google.com/p/google-web-toolkit/issues/detail?id=3731";>#3731) --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5765 commited - Fix bad assertion....
Revision: 5765 Author: b...@google.com Date: Tue Jul 21 14:50:34 2009 Log: Fix bad assertion. Patch by: bobv Review by: amitmanjhi (TBR) http://code.google.com/p/google-web-toolkit/source/detail?r=5765 Modified: /trunk/user/src/com/google/gwt/rpc/rebind/RpcProxyCreator.java === --- /trunk/user/src/com/google/gwt/rpc/rebind/RpcProxyCreator.java Tue Jul 21 11:59:13 2009 +++ /trunk/user/src/com/google/gwt/rpc/rebind/RpcProxyCreator.java Tue Jul 21 14:50:34 2009 @@ -304,10 +304,10 @@ deserializationSto.getSerializableTypes()); for (JMethod m : serviceIntf.getOverridableMethods()) { // Pick up any primitive return types, which get sent boxed - assert serializableTypes.contains(m.getReturnType()) - || m.getReturnType().isPrimitive() != null : "Missing non-primitive return type " - + m.getReturnType().getQualifiedSourceName(); - serializableTypes.add(m.getReturnType()); + JPrimitiveType mustBox = m.getReturnType().isPrimitive(); + if (mustBox != null) { +serializableTypes.add(m.getReturnType()); + } } StringBuilder sb = new StringBuilder("@ArtificialRescue({"); --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit] r5764 commited - Documented the initial load sequence.
Revision: 5764 Author: sp...@google.com Date: Tue Jul 21 13:52:01 2009 Log: Documented the initial load sequence. http://code.google.com/p/google-web-toolkit/source/detail?r=5764 Modified: /wiki/CodeSplitting.wiki === --- /wiki/CodeSplitting.wikiTue Jul 21 13:42:16 2009 +++ /wiki/CodeSplitting.wikiTue Jul 21 13:52:01 2009 @@ -248,6 +248,52 @@ and then break a link in the dependency chain that comes up. +=Specifying an initial load sequence= +By default, every split point is given an exclusive fragment rather +than an initial fragment. This gives your application maximum +flexibility in the order the split points are reached. However, +it means that the first split point reached must pay a significant +delay, because it must wait for the leftovers fragment to load +before its own code can load. + +If you know which split point in your app will come first, you +can improve the app's performance by specifying an initial load +sequence. Simply add a line such as the following to your +module's gwt.xml file: +{{{ + +}}} +The `value` part of the line specifies a split point. Currently the only way +to specify a split point is to include a complete JSNI reference to the method +enclosing the split point in question. + +For some applications, you will know not only the first split point reached, +but also the second and maybe even the third. You can continue extending +the initial load sequence by adding more lines to the configuration property. +For example, here is module code to specify an initial load sequence of +three split points. +{{{ + + + +}}} + +The down side to specifying an initial load sequence is that if the split +points are reached in a different order than specified, then there will +be an even bigger delay than before before that code is run. For example, +if the third split point in the initial sequence is actually reached first, +then the code for that split point will not load until the code for the first +two split points finishes loading. Worse, if some non-initial split point +is actually reached first, then all of the code for the entire initial load +sequence, in addition to the leftovers fragment, must load before the requested +split point's code can load. Thus, think very carefully before putting anything +in the initial load sequence if the split points might be reached in a different +order at run time. + =Common coding patterns= GWT's code splitting is new, so the best idioms and patterns for using --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: patch to enable web tests using HtmlUnit
The next patch I will upload contains the fixes I have indicated as done. I also did not review carefully all the broken tests. I mostly mechanically put the annotation just to get the whole test suite to pass. Currently, batching will not work with htmlUnit because the batching code does not yet understand the @DoNotRunWith annotation. When returning the batch of tests to execute, the batching code should filter out tests that are annotated @DoNotRunWith. I felt the fix could be postponed till later. Regarding having more specific platforms, I chose the simple HtmlUnit vs non currently, because currently the test-runner runs the same tests for all specified clients. There is no currently no support for having arguments "-htmlunit FF3,IE7" and having a test method marked as @DoNotRunWith(Platform.Htmlunit_IE7). Again, this is a TODO but till then, it will not be useful to have a separate Htmlunit_IE7 and Htmlunit_FF3. http://gwt-code-reviews.appspot.com/54809/diff/38/1001 File eclipse/user/.classpath (right): http://gwt-code-reviews.appspot.com/54809/diff/38/1001#newcode6 Line 6: Will fix in the next patch. On 2009/07/28 23:36:55, jat wrote: > Apparently the diff didn't match what was in trunk -- see the error: old chunk > mismatch http://gwt-code-reviews.appspot.com/54809/diff/38/1004 File user/src/com/google/gwt/junit/JUnitShell.java (right): http://gwt-code-reviews.appspot.com/54809/diff/38/1004#newcode238 Line 238: return runStyle != null; Changing it to true. On 2009/07/28 23:08:41, scottb wrote: > We're not doing any validation on the input. It's an assertion in > RunStyleHtmlUnit, and the return value from a new op can never be null. http://gwt-code-reviews.appspot.com/54809/diff/38/1004#newcode398 Line 398: private static final int TEST_BEGIN_TIMEOUT_MILLIS = 600; This is a mistake. Will change this. On 2009/07/28 23:08:41, scottb wrote: > Seems unrelated to this patch? http://gwt-code-reviews.appspot.com/54809/diff/38/1004#newcode694 Line 694: void compileForWebMode(String moduleName, String... userAgents) RunStyleHtmlUnit needs it, since multiple browsers might be passed in. On 2009/07/28 23:08:41, scottb wrote: > Again, this seems like a good fix, but unrelated. http://gwt-code-reviews.appspot.com/54809/diff/38/1004#newcode714 Line 714: Set bannedSet = new HashSet(); On 2009/07/28 23:08:41, scottb wrote: > Use an EnumSet. Done. http://gwt-code-reviews.appspot.com/54809/diff/38/1004#newcode735 Line 735: return runStyle instanceof RunStyleHtmlUnit I agree. For now, can I just put a TODO in here? On 2009/07/28 23:08:41, scottb wrote: > This should not be hard coded. The RunStyle needs to somehow specify how it > interacts with the platforms. http://gwt-code-reviews.appspot.com/54809 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: patch to enable web tests using HtmlUnit
I did not review the tests that were blocked, but they don't seem that bad in general. I am a bit surprised at a few of them, but we can improve them later. http://gwt-code-reviews.appspot.com/54809/diff/1/32 File user/src/com/google/gwt/junit/DoNotRunWith.java (right): http://gwt-code-reviews.appspot.com/54809/diff/1/32#newcode27 Line 27: * want each exception to be listed separately here. It seems like in some cases, such as testing a mobile platform feature, you might want to only test a specific platform. So, while I think exceptions for tests that don't work should be done this way, I also see the utility of having a RunWith annotation. This obviously can be done later. http://gwt-code-reviews.appspot.com/54809/diff/1/32#newcode29 Line 29: * TODO(amitmanjhi): Make this work with batching of test cases. What happens now regarding batching? http://gwt-code-reviews.appspot.com/54809/diff/1/34 File user/src/com/google/gwt/junit/JUnitShell.java (right): http://gwt-code-reviews.appspot.com/54809/diff/1/34#newcode398 Line 398: private static final int TEST_BEGIN_TIMEOUT_MILLIS = 600; I assume this was for testing and should be reverted. http://gwt-code-reviews.appspot.com/54809/diff/1/34#newcode736 Line 736: && bannedPlatforms.contains(Platform.Htmlunit); This can be done later, but in the next-gen build discussions we were talking about labelling a test as flaky on a platform and it would still be run but a failure wouldn't block the build. http://gwt-code-reviews.appspot.com/54809/diff/1/35 File user/src/com/google/gwt/junit/Platform.java (right): http://gwt-code-reviews.appspot.com/54809/diff/1/35#newcode22 Line 22: * between Htmlunit and non-Htmlunit platforms. How can you represent non-HTMLUnit platforms when there is only one value? Also, you might want to use different browser emulations in HTMLUnit and specify those as well (ie, HtmlunitFF3). http://gwt-code-reviews.appspot.com/54809/diff/1/33 File user/src/com/google/gwt/junit/RunStyleHtmlUnit.java (right): http://gwt-code-reviews.appspot.com/54809/diff/1/33#newcode93 Line 93: // TODO(jat): is this necessary? Did you investigate this TODO? http://gwt-code-reviews.appspot.com/54809/diff/38/1001 File eclipse/user/.classpath (right): http://gwt-code-reviews.appspot.com/54809/diff/38/1001#newcode6 Line 6: Apparently the diff didn't match what was in trunk -- see the error: old chunk mismatch http://gwt-code-reviews.appspot.com/54809 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: patch to enable web tests using HtmlUnit
I'll trust that RunStyleHtmlUnit itself works as advertised. I admit I'm a little dismayed at just how many tests have to be disabled-- especially since they imply problems with user-written test cases of their own code. StringTest is particularly distressing for me, but I'm sure many of the others might distress jgw. :) We will need to solve the deployment issue. http://gwt-code-reviews.appspot.com/54809/diff/38/1001 File eclipse/user/.classpath (right): http://gwt-code-reviews.appspot.com/54809/diff/38/1001#newcode1 Line 1: I don't see any changes. http://gwt-code-reviews.appspot.com/54809/diff/38/1002 File user/build.xml (right): http://gwt-code-reviews.appspot.com/54809/diff/38/1002#newcode1 Line 1: Will still need to solve the deployment issue for end users using HTMLUnit-based tests. http://gwt-code-reviews.appspot.com/54809/diff/38/1004 File user/src/com/google/gwt/junit/JUnitShell.java (right): http://gwt-code-reviews.appspot.com/54809/diff/38/1004#newcode238 Line 238: return runStyle != null; We're not doing any validation on the input. It's an assertion in RunStyleHtmlUnit, and the return value from a new op can never be null. http://gwt-code-reviews.appspot.com/54809/diff/38/1004#newcode398 Line 398: private static final int TEST_BEGIN_TIMEOUT_MILLIS = 600; Seems unrelated to this patch? http://gwt-code-reviews.appspot.com/54809/diff/38/1004#newcode694 Line 694: void compileForWebMode(String moduleName, String... userAgents) Again, this seems like a good fix, but unrelated. http://gwt-code-reviews.appspot.com/54809/diff/38/1004#newcode714 Line 714: Set bannedSet = new HashSet(); Use an EnumSet. http://gwt-code-reviews.appspot.com/54809/diff/38/1004#newcode735 Line 735: return runStyle instanceof RunStyleHtmlUnit This should not be hard coded. The RunStyle needs to somehow specify how it interacts with the platforms. http://gwt-code-reviews.appspot.com/54809 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: don't download class factories in the initial download
NP. I'm all, "AGH! Error being reported in Eclipse! GAH! MUST... KILL... IT!" LOL On Tue, Jul 28, 2009 at 5:54 PM, Lex Spoon wrote: > > On Tue, Jul 28, 2009 at 3:23 PM, Scott Blum wrote: > > There was an unused import of com.google.gwt.dev.jjs.ast.JModVisitor left > in > > here. Sorry, I just eyeballed reitveld and didn't patch it in. > > My bad! Thanks for fixing it. -Lex > > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: don't download class factories in the initial download
On Tue, Jul 28, 2009 at 3:23 PM, Scott Blum wrote: > There was an unused import of com.google.gwt.dev.jjs.ast.JModVisitor left in > here. Sorry, I just eyeballed reitveld and didn't patch it in. My bad! Thanks for fixing it. -Lex --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Testing new GWT RPC implementation (aka deRPC)
On Tue, Jul 28, 2009 at 3:03 AM, futzi wrote: > my first test showed, that Thanks for the data. Just to clarify, these payloads were only going from the server to the client? -- Bob Vawter Google Web Toolkit Team --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: don't download class factories in the initial download
There was an unused import of com.google.gwt.dev.jjs.ast.JModVisitor left in here. Sorry, I just eyeballed reitveld and didn't patch it in. On Tue, Jul 28, 2009 at 3:00 PM, wrote: > Thanks! > > > http://gwt-code-reviews.appspot.com/51822 > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: don't download class factories in the initial download
Deleting code is awesome! LGTM, to the extent that I understand what's going on. I'll trust you that the normal visitation patterns result in a working end product. http://gwt-code-reviews.appspot.com/51822 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: "Locking" Columns in PagingScrollTable
You can find my branch here: http://code.google.com/p/google-web-toolkit-incubator/source/browse/#svn/branches/dflorey/tableAddons Description of some addons: http://code.google.com/p/google-web-toolkit-incubator/wiki/TreeTable Cheers, Daniel On 28 Jul., 19:43, jay wrote: > What branch and what functionality have you already added? > > jay > > On Jul 28, 1:44 am, dflorey wrote: > > > > > I'm not sure about the current status of when things will proceed and > > move to trunk, but I'd like to see this feature in the core table > > framework! > > If you have some patches, I can of course add them to my branch as > > I've already added some functionality to the tables and at least try > > to merge back the incubator trunk into my branch from time to time. > > This is how I'd implement this feature (just brainstorming): > > Add another table to the ScrollTable (copy&paste the code from > > creating the header table). The width of the header table columns has > > to be kept in sync manually when the content of the data table > > changes. So you should grab the same events and sync the height of the > > rows of your "fixedColumnTable". > > It would be cool if there would be a way to define the "fixed" > > property in the CoumnDefinition. The is already a bunch of classes for > > each column property so it does not harm to introduce another one ;-) > > Check for the "fixed" property when constructing the table and add > > additional tables for fixed columns not next to each other and recalc > > the column index to populate the proper tables when populating data. > > Finally we would end up with a dynamic number of data tables (think of > > a table with a fixed first and last column = 3 data tables) that all > > have to be kept in sync regarding row height. > > > On Jul 28, 7:35 am, jay wrote: > > > > I'm about to embark on coming up with a way to "lock" 1 or more of the > > > left-most columns. E.g., the locked columns will not scroll > > > horizontally as the other columns are scrolled. > > > > I've googled around, and not found any other work towards this, so I'm > > > hoping it's not impossible. > > > > Currently, I'm using the PagingScrollTable... My first thought is that > > > I would create a wrapper that would internally separate the TableModel > > > into two, and create two separate PagingScrollTable instances, smushed > > > side-by-side. > > > > However, if I do this, one thing I really am unsure of is how to keep > > > the height of each row in sync? > > > > I appreciate any hints, tips, and/or tricks! > > > > jay --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: "Locking" Columns in PagingScrollTable
What branch and what functionality have you already added? jay On Jul 28, 1:44 am, dflorey wrote: > I'm not sure about the current status of when things will proceed and > move to trunk, but I'd like to see this feature in the core table > framework! > If you have some patches, I can of course add them to my branch as > I've already added some functionality to the tables and at least try > to merge back the incubator trunk into my branch from time to time. > This is how I'd implement this feature (just brainstorming): > Add another table to the ScrollTable (copy&paste the code from > creating the header table). The width of the header table columns has > to be kept in sync manually when the content of the data table > changes. So you should grab the same events and sync the height of the > rows of your "fixedColumnTable". > It would be cool if there would be a way to define the "fixed" > property in the CoumnDefinition. The is already a bunch of classes for > each column property so it does not harm to introduce another one ;-) > Check for the "fixed" property when constructing the table and add > additional tables for fixed columns not next to each other and recalc > the column index to populate the proper tables when populating data. > Finally we would end up with a dynamic number of data tables (think of > a table with a fixed first and last column = 3 data tables) that all > have to be kept in sync regarding row height. > > On Jul 28, 7:35 am, jay wrote: > > > > > I'm about to embark on coming up with a way to "lock" 1 or more of the > > left-most columns. E.g., the locked columns will not scroll > > horizontally as the other columns are scrolled. > > > I've googled around, and not found any other work towards this, so I'm > > hoping it's not impossible. > > > Currently, I'm using the PagingScrollTable... My first thought is that > > I would create a wrapper that would internally separate the TableModel > > into two, and create two separate PagingScrollTable instances, smushed > > side-by-side. > > > However, if I do this, one thing I really am unsure of is how to keep > > the height of each row in sync? > > > I appreciate any hints, tips, and/or tricks! > > > jay --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Error building GWT 2.0 on Windows
Hi, I'm using gwt-maven-plugin to compile a gwt 2.0 project on an windows xp env. I have the same plugin (jar) as on linux (compiled from 1.1 sources + a patch to use gwt 2.0 - can see it here: http://jira.codehaus.org/browse/MGWT-92), which on linux works just fine. However, after porting the same project on windows, when I try to compile it using gwt:compile, I get the following error: [ERROR] An internal compiler exception occurred com.google.gwt.dev.jjs.InternalCompilerException: Unable to locate index field: AsyncFragmentLoader.BROWSER_LOADER at com.google.gwt.dev.jjs.ast.JProgram.getIndexedField(JProgram.java: 681) at com.google.gwt.dev.jjs.impl.ReplaceRunAsyncs.getBrowserLoaderConstructor (ReplaceRunAsyncs.java:129) at com.google.gwt.dev.jjs.impl.ReplaceRunAsyncs.setNumEntriesInAsyncFragmentLoader (ReplaceRunAsyncs.java:188) at com.google.gwt.dev.jjs.impl.ReplaceRunAsyncs.execImpl (ReplaceRunAsyncs.java:145) at com.google.gwt.dev.jjs.impl.ReplaceRunAsyncs.exec (ReplaceRunAsyncs.java:121) at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile (JavaToJavaScriptCompiler.java:481) at com.google.gwt.dev.Precompile.precompile(Precompile.java:476) at com.google.gwt.dev.Precompile.precompile(Precompile.java:395) at com.google.gwt.dev.Compiler.run(Compiler.java:193) at com.google.gwt.dev.Compiler$1.run(Compiler.java:144) at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java: 88) at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger (CompileTaskRunner.java:82) at com.google.gwt.dev.Compiler.main(Compiler.java:151) This error sounds more like a gwt internal error and I have no idea how to solve it. Any hints on how to use gwt 2.0 on windows or fix this problem will be highly appreciated. Thanks, Evelyne --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Testing new GWT RPC implementation (aka deRPC)
Hi Bob, my first test showed, that 1. the performance of the RPC Call improved for less than 30.000 of my test objects. 2. the performance of the RPC Call was worse for more than 30.000 of my test objects. 3. when transfering lots of data, the "old" RPC mechanism leads to the well known "slow java script warning" in IE, which is not anymore the case with the new mechanism. I tested Internet Explorer 8 on a Macbook pro 3Ghz. In my example I transfered a list of serializable object (source code of the objects, see below) Old mechanism: Call took 15 ms for 0 Objects Call took 204 ms for 5000 Objects Call took 437 ms for 1 Objects Call took 624 ms for 15000 Objects Call took 812 ms for 2 Objects Call took 1076 ms for 25000 Objects Call took 1249 ms for 3 Objects Call took 1515 ms for 35000 Objects Call took 1748 ms for 4 Objects Call took 2000 ms for 45000 Objects Call took 2185 ms for 5 Objects Call took 2456 ms for 55000 Objects Call took 2716 ms for 6 Objects Call took 3058 ms for 65000 Objects Skript Warning New Mechanism Call took 15 ms for 0 Objects Call took 95 ms for 5000 Objects Call took 249 ms for 1 Objects Call took 390 ms for 15000 Objects Call took 671 ms for 2 Objects Call took 968 ms for 25000 Objects Call took 1279 ms for 3 Objects Call took 1608 ms for 35000 Objects Call took 2069 ms for 4 Objects Call took 2544 ms for 45000 Objects Call took 3090 ms for 5 Objects Call took 3745 ms for 55000 Objects Call took 4525 ms for 6 Objects Call took 5117 ms for 65000 Objects Call took 6132 ms for 7 Objects Call took 6772 ms for 75000 Objects Call took 8191 ms for 8 Objects Call took 8846 ms for 85000 Objects Call took 9871 ms for 9 Objects Call took 11888 ms for 95000 Objects Call took 12247 ms for 10 Objects Do you have an assumption for the non linear performance? Regards, Mark = example source code for transfered objects (not complete) = public class SQLStringValue extends SQLFieldValue implements Serializable { private static final long serialVersionUID = -7208567545126057591L; String i; public SQLStringValue() { } public SQLStringValue(String i) throws SQLFieldValueException { if (i == null) throw new SQLFieldValueException("String parameter cannot be null"); this.i = i; } public SQLStringValue(SQLStringValue value) { this.i = value.i; } @Override public String getStringValue() { return ""+i; } @Override public boolean getBooleanValue() { return SQLBooleanValue.convert(i); } @Override public boolean isNull() { return false; } public SQLStringValue clone() { return new SQLStringValue(this); } @Override public SQLColumnInfo.ColumnTypes getType() { return SQLColumnInfo.ColumnTypes.stringType; } @Override public Object getObject() { return i; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((i == null) ? 0 : i.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; SQLStringValue other = (SQLStringValue) obj; if (i == null) { if (other.i != null) return false; } else if (!i.equals(other.i)) return false; return true; } } public class SQLFieldValue implements Serializable, Cloneable { private static final long serialVersionUID = 3042603979355146072L; public static SQLFieldValue getInstance(Object object) throws SQLFieldValueException { if (object == null) return new SQLFieldValue(); if (object instanceof String) return new SQLStringValue((String)object); throw new SQLFieldValueException("Unrecognized type " + object.getClass().getName()); } public SQLFieldValue() { } public SQLFieldValue clone() { return new SQLFieldValue(); } public SQLColumnInfo.ColumnTypes getType() { return SQLColumnInfo.ColumnTypes.unknownType; } public int getIntValue() { return 0; } public long getLongValue() { return 0; } public
[gwt-contrib] Re: Allow new strings to be created in the JS AST
> http://gwt-code-reviews.appspot.com/51820/diff/1/8#newcode79 > Line 79: * fragments need only be downloaded once. > I thought the LoadOrderOracle was a fine idea, so as to no longer require > passing in the JProgram. I guess it ran into some issue. No issue; I just wanted to get all of the functional changes checked in and have a subsequent API cleanup pass. > I guess this patch is continuing how the in-trunk code works, but it looks like > it would be simpler to use Strings everywhere than to use JsStringLiterals plus > a custom comparator. Losing the JsStringLiterals would also lose their associated SourceInfo. Committed at r5812. The stack trace emulation code is committed at r5813. http://gwt-code-reviews.appspot.com/51820 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Tweak docs for Event#addNativePreviewHandler to warn of multi-app fail
http://gwt-code-reviews.appspot.com/51821/diff/1/2 File user/src/com/google/gwt/user/client/Event.java (right): http://gwt-code-reviews.appspot.com/51821/diff/1/2#newcode393 Line 393: * the same event type. I don't think preview handlers aren't event type specific. http://gwt-code-reviews.appspot.com/51821 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Tweak docs for Event#addNativePreviewHandler to warn of multi-app fail
Reviewers: jlabanca, Description: Adds a warning to the javadoc for Event#addNativePreviewHandler explaining its cross-app limitations. Please review this at http://gwt-code-reviews.appspot.com/51821 Affected files: user/src/com/google/gwt/user/client/Event.java Index: user/src/com/google/gwt/user/client/Event.java --- user/src/com/google/gwt/user/client/Event.java (revision 5759) +++ user/src/com/google/gwt/user/client/Event.java (working copy) @@ -387,6 +387,12 @@ public class Event extends NativeEvent { * {...@link NativePreviewEvent} that was added is the first to be fired. * * + * + * Please note that nondeterministic behavior will result + * if more than one GWT application registers preview handlers for + * the same event type. + * + * * @param handler the {...@link NativePreviewHandler} * @return {...@link HandlerRegistration} used to remove this handler */ --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Support animated images in ImageResource
Reviewers: Ray Ryan, jgw, Message: Review requested. Description: This patch changes the way ImageBundleBuilder loads images to be able to detect image files that contain multiple sub-images. Animated image files do not undergo any transformation, but are emitted as-is via the ResourceContext (the raw bytes are subject to browser-specific deployment strategies). This change allows users of CssResource to use animated .gif files with the @sprite syntax. Please review this at http://gwt-code-reviews.appspot.com/54808 Affected files: M user/src/com/google/gwt/resources/client/ImageResource.java M user/src/com/google/gwt/resources/client/impl/ImageResourcePrototype.java M user/src/com/google/gwt/resources/rg/ImageBundleBuilder.java M user/src/com/google/gwt/resources/rg/ImageResourceGenerator.java M user/test/com/google/gwt/resources/client/ImageResourceTest.java A user/test/com/google/gwt/resources/client/animated.gif --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: TextArea getCursorPos fix for IE in pyjamas, is it the right approach?
This should be fixed now. We had to do some fancy (hacky) stuff to make it work, but getCursorPos() should return the correct value now. The problem is that IE automatically trims newlines off the end of the selected text, making it difficult to know exactly how many characters are selected. Now, we move the cursor back 1 character at a time, which allows us to figure out how many \r\n are being truncated. Thanks, John LaBanca jlaba...@google.com On Tue, Jul 28, 2009 at 10:26 AM, Joel Webber wrote: > I believe John committed several fixes to TextBoxImplIE6 recently, and it > looks like this patch might not apply any more. Have a look at the source > here to see if you think it still makes sense: > http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/client/ui/impl/TextBoxImplIE6.java > > > On Mon, Jul 27, 2009 at 6:00 PM, lkcl wrote: > >> >> folks, hi, >> >> as you know, pyjamas tracks GWT fairly closely, with the UI widget API >> being near-identical to that of GWT, and even to the point where i >> wrote a java2py.py script which converts GWT java code [mostly] to >> python, to make the process of porting GWT widgets over to python that >> much easier. we even copy over the platform overrides with the >> Javascript sections, wholesale. >> >> on very rare occasions, we encounter bugs before you do :) >> >> i was wondering therefore if you've encountered this: >> >> http://code.google.com/p/pyjamas/issues/detail?id=205 >> >> your thoughts appreciated. >> >> l. >> >> >> > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: TextArea getCursorPos fix for IE in pyjamas, is it the right approach?
I believe John committed several fixes to TextBoxImplIE6 recently, and it looks like this patch might not apply any more. Have a look at the source here to see if you think it still makes sense: http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/client/ui/impl/TextBoxImplIE6.java On Mon, Jul 27, 2009 at 6:00 PM, lkcl wrote: > > folks, hi, > > as you know, pyjamas tracks GWT fairly closely, with the UI widget API > being near-identical to that of GWT, and even to the point where i > wrote a java2py.py script which converts GWT java code [mostly] to > python, to make the process of porting GWT widgets over to python that > much easier. we even copy over the platform overrides with the > Javascript sections, wholesale. > > on very rare occasions, we encounter bugs before you do :) > > i was wondering therefore if you've encountered this: > > http://code.google.com/p/pyjamas/issues/detail?id=205 > > your thoughts appreciated. > > l. > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Allow new strings to be created in the JS AST
FYI: A complete re-merge of this, plus the stack trace code and IE event handler fixup is at http://gwt-code-reviews.appspot.com/54807 http://gwt-code-reviews.appspot.com/51820 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Comment on IE8Support in google-web-toolkit
Comment by sateesh78: Upgrade gwt-dnd, gwt-incubator and gwt-log also, if you are using them. For more information: http://code.google.com/p/google-web-toolkit/wiki/IE8Support --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: "Locking" Columns in PagingScrollTable
I'm not sure about the current status of when things will proceed and move to trunk, but I'd like to see this feature in the core table framework! If you have some patches, I can of course add them to my branch as I've already added some functionality to the tables and at least try to merge back the incubator trunk into my branch from time to time. This is how I'd implement this feature (just brainstorming): Add another table to the ScrollTable (copy&paste the code from creating the header table). The width of the header table columns has to be kept in sync manually when the content of the data table changes. So you should grab the same events and sync the height of the rows of your "fixedColumnTable". It would be cool if there would be a way to define the "fixed" property in the CoumnDefinition. The is already a bunch of classes for each column property so it does not harm to introduce another one ;-) Check for the "fixed" property when constructing the table and add additional tables for fixed columns not next to each other and recalc the column index to populate the proper tables when populating data. Finally we would end up with a dynamic number of data tables (think of a table with a fixed first and last column = 3 data tables) that all have to be kept in sync regarding row height. On Jul 28, 7:35 am, jay wrote: > I'm about to embark on coming up with a way to "lock" 1 or more of the > left-most columns. E.g., the locked columns will not scroll > horizontally as the other columns are scrolled. > > I've googled around, and not found any other work towards this, so I'm > hoping it's not impossible. > > Currently, I'm using the PagingScrollTable... My first thought is that > I would create a wrapper that would internally separate the TableModel > into two, and create two separate PagingScrollTable instances, smushed > side-by-side. > > However, if I do this, one thing I really am unsure of is how to keep > the height of each row in sync? > > I appreciate any hints, tips, and/or tricks! > > jay --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---