[gwt-contrib] Compiling demos in incubator
Hi, I am trying to compile the demos which are included in incubator. I tried ant build.demos but this only builds the demos which are in src-demo/, not the ones in src/com/google/gwt/demos How can I compile them ? Thanks, Uwe --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Compiling demos in incubator
Uwe, If you change build.xml line 435 to use ${demo.src.dir} instead of src-demo then you can specify any demo to build using command line parameters: -Ddemo.src.dir=src -Ddemo.filter=**/GlassPanelDemo.gwt.xml Note that many of the src/com/google/gwt/demos modules are obsolete and at least one (CurrencyWidgetDemo) no longer compiles. - Isaac On Fri, Feb 27, 2009 at 8:35 AM, Uwe Maurer uwe.mau...@google.com wrote: Hi, I am trying to compile the demos which are included in incubator. I tried ant build.demos but this only builds the demos which are in src-demo/, not the ones in src/com/google/gwt/demos How can I compile them ? Thanks, Uwe --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Compiling demos in incubator
Thanks, I will try this. Uwe On Feb 27, 3:03 pm, Isaac Truett itru...@gmail.com wrote: Uwe, If you change build.xml line 435 to use ${demo.src.dir} instead of src-demo then you can specify any demo to build using command line parameters: -Ddemo.src.dir=src -Ddemo.filter=**/GlassPanelDemo.gwt.xml Note that many of the src/com/google/gwt/demos modules are obsolete and at least one (CurrencyWidgetDemo) no longer compiles. - Isaac On Fri, Feb 27, 2009 at 8:35 AM, Uwe Maurer uwe.mau...@google.com wrote: Hi, I am trying to compile the demos which are included in incubator. I tried ant build.demos but this only builds the demos which are in src-demo/, not the ones in src/com/google/gwt/demos How can I compile them ? Thanks, Uwe --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Code Review: Updated SliderBar to use the new event handling
Hi, I added methods to use the new event handling to the Slider Bar. Also I changed to order of the two public interfaces to make CheckStyle happy. Thanks, Uwe --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~--- Index: src/com/google/gwt/widgetideas/client/SliderBar.java === --- src/com/google/gwt/widgetideas/client/SliderBar.java(revision 1538) +++ src/com/google/gwt/widgetideas/client/SliderBar.java(working copy) @@ -16,6 +16,11 @@ package com.google.gwt.widgetideas.client; import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.KeyCodes; +import com.google.gwt.event.logical.shared.HasValueChangeHandlers; +import com.google.gwt.event.logical.shared.ValueChangeEvent; +import com.google.gwt.event.logical.shared.ValueChangeHandler; +import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; @@ -24,9 +29,9 @@ import com.google.gwt.user.client.ui.ChangeListener; import com.google.gwt.user.client.ui.ChangeListenerCollection; import com.google.gwt.user.client.ui.FocusPanel; +import com.google.gwt.user.client.ui.HasValue; import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.ImageBundle; -import com.google.gwt.user.client.ui.KeyboardListener; import com.google.gwt.user.client.ui.SourcesChangeEvents; import java.util.ArrayList; @@ -62,8 +67,50 @@ * line }/li /ul */ public class SliderBar extends FocusPanel implements ResizableWidget, -SourcesChangeEvents { +SourcesChangeEvents, HasValueDouble, HasValueChangeHandlersDouble { /** + * A formatter used to format the labels displayed in the widget. + */ + public static interface LabelFormatter { +/** + * Generate the text to display in each label based on the label's value. + * + * Override this method to change the text displayed within the SliderBar. + * + * @param slider the Slider bar + * @param value the value the label displays + * @return the text to display for the label + */ +String formatLabel(SliderBar slider, double value); + } + + /** + * An {...@link ImageBundle} that provides images for {...@link SliderBar}. + */ + public static interface SliderBarImages extends ImageBundle { +/** + * An image used for the sliding knob. + * + * @return a prototype of this image + */ +AbstractImagePrototype slider(); + +/** + * An image used for the sliding knob. + * + * @return a prototype of this image + */ +AbstractImagePrototype sliderDisabled(); + +/** + * An image used for the sliding knob while sliding. + * + * @return a prototype of this image + */ +AbstractImagePrototype sliderSliding(); + } + + /** * The timer used to continue to shift the knob as the user holds down one of * the left/right arrow keys. Only IE auto-repeats, so we just keep catching * the events. @@ -130,48 +177,6 @@ } /** - * A formatter used to format the labels displayed in the widget. - */ - public static interface LabelFormatter { -/** - * Generate the text to display in each label based on the label's value. - * - * Override this method to change the text displayed within the SliderBar. - * - * @param slider the Slider bar - * @param value the value the label displays - * @return the text to display for the label - */ -String formatLabel(SliderBar slider, double value); - } - - /** - * An {...@link ImageBundle} that provides images for {...@link SliderBar}. - */ - public static interface SliderBarImages extends ImageBundle { -/** - * An image used for the sliding knob. - * - * @return a prototype of this image - */ -AbstractImagePrototype slider(); - -/** - * An image used for the sliding knob. - * - * @return a prototype of this image - */ -AbstractImagePrototype sliderDisabled(); - -/** - * An image used for the sliding knob while sliding. - * - * @return a prototype of this image - */ -AbstractImagePrototype sliderSliding(); - } - - /** * The change listeners. */ private ChangeListenerCollection changeListeners; @@ -329,7 +334,10 @@ * Add a change listener to this SliderBar. * * @param listener the listener to add + * + * @deprecated Please use addValueChangeHandler */ + @Deprecated public void addChangeListener(ChangeListener listener) { if (changeListeners == null) { changeListeners = new ChangeListenerCollection(); @@ -337,6 +345,11 @@ changeListeners.add(listener); } + @Override + public HandlerRegistration
[gwt-contrib] [google-web-toolkit commit] r4895 - wiki
Author: br...@google.com Date: Fri Feb 27 07:32:06 2009 New Revision: 4895 Modified: wiki/WebModeExceptions.wiki Log: Fixed typo Modified: wiki/WebModeExceptions.wiki == --- wiki/WebModeExceptions.wiki (original) +++ wiki/WebModeExceptions.wiki Fri Feb 27 07:32:06 2009 @@ -63,7 +63,7 @@ = 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 have been implemented. +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. * The Linker artifact `CompilationResult` provides a method `getSymbolMap()` which returns a string mapping of JSNI identifiers for types, methods, and fields to their obfuscated identifiers. * A `symbolMaps` linker is added in `Core.gwt.xml` that emits the symbol map data as a series of files `permutationStrongName_symbolMap.properties`. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Code Review: Updated SliderBar to use the new event handling
The changes look great. Thank you for doing this. Any chance you could you create a gen2 version of SliderBar and deprecate the widgetideas version instead on modifying the widgetideas version in place? We are slowly retiring the old widgetideas package in favor of the gen2 package hierarchy, so every time we would have to make a breaking API change to a widgetideas widget, we try to deprecate the old one and move the new one into a gen2 package instead. In this case, as the slider is a way to pick a value from a range, it would go into the gen2.picker.client package. Cheers, Emily On Fri, Feb 27, 2009 at 10:32 AM, Uwe Maurer uwe.mau...@google.com wrote: Hi, I added methods to use the new event handling to the Slider Bar. Also I changed to order of the two public interfaces to make CheckStyle happy. Thanks, Uwe -- There are only 10 types of people in the world: Those who understand binary, and those who don't --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4896 - in releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase: client/content/other...
Author: jlaba...@google.com Date: Fri Feb 27 08:09:14 2009 New Revision: 4896 Modified: releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwAnimation.java releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwCookies.java releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwVerticalPanel.java releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/tables/CwFlexTable.java releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/public/chrome/Showcase.css releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/public/chrome/Showcase_rtl.css releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/public/dark/Showcase.css releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/public/dark/Showcase_rtl.css releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/public/standard/Showcase.css releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/public/standard/Showcase_rtl.css Log: In Showcase, gave some buttons a fixed width so they would line up nicely. Patch by: jlabanca Review by: ecc Issue: 3396 Modified: releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwAnimation.java == --- releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwAnimation.java (original) +++ releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwAnimation.java Fri Feb 27 08:09:14 2009 @@ -257,6 +257,7 @@ // Add start button startButton = new Button(constants.cwAnimationStart()); +startButton.addStyleName(sc-FixedWidthButton); startButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { animation.run(2000); @@ -266,6 +267,7 @@ // Add cancel button cancelButton = new Button(constants.cwAnimationCancel()); +cancelButton.addStyleName(sc-FixedWidthButton); cancelButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { animation.cancel(); Modified: releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwCookies.java == --- releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwCookies.java (original) +++ releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwCookies.java Fri Feb 27 08:09:14 2009 @@ -130,6 +130,7 @@ // Display the existing cookies existingCookiesBox = new ListBox(); Button deleteCookieButton = new Button(constants.cwCookiesDeleteCookie()); +deleteCookieButton.addStyleName(sc-FixedWidthButton); mainLayout.setHTML(0, 0, b + constants.cwCookiesExistingLabel() + /b); mainLayout.setWidget(0, 1, existingCookiesBox); @@ -143,6 +144,7 @@ // Display the name of the cookie cookieValueBox = new TextBox(); Button setCookieButton = new Button(constants.cwCookiesSetCookie()); +setCookieButton.addStyleName(sc-FixedWidthButton); mainLayout.setHTML(2, 0, b + constants.cwCookiesValueLabel() + /b); mainLayout.setWidget(2, 1, cookieValueBox); mainLayout.setWidget(2, 2, setCookieButton); Modified: releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwVerticalPanel.java == --- releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwVerticalPanel.java (original) +++ releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwVerticalPanel.java Fri Feb 27 08:09:14 2009 @@ -83,7 +83,7 @@ // Add some content to the panel for (int i = 1; i 10; i++) { - vPanel.add(new Button(constants.cwVerticalPanelButton() + + i)); + vPanel.add(new Button(constants.cwVerticalPanelButton() + + i)); } // Return the content Modified: releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/tables/CwFlexTable.java == --- releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/tables/CwFlexTable.java (original) +++ releases/1.6/samples/showcase/src/com/google/gwt/sample/showcase/client/content/tables/CwFlexTable.java Fri Feb 27 08:09:14 2009 @@ -106,6 +106,7 @@ addRow(flexTable); } }); +addRowButton.addStyleName(sc-FixedWidthButton); Button removeRowButton = new Button(constants.cwFlexTableRemoveRow(), new
[gwt-contrib] Re: Make DateBox fire ValueChangeEvent more reliably.
Thanks for the fast turn around, committed as r4898 2009/2/27 jlaba...@google.com LGTM http://gwt-code-reviews.appspot.com/7804 -- There are only 10 types of people in the world: Those who understand binary, and those who don't --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4898 - in releases/1.6: reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum use...
Author: e...@google.com Date: Fri Feb 27 11:32:09 2009 New Revision: 4898 Added: releases/1.6/user/test/com/google/gwt/user/client/ui/WidgetTestBase.java Modified: releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDateBox.java releases/1.6/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java releases/1.6/user/src/com/google/gwt/user/datepicker/client/DateBox.java releases/1.6/user/test/com/google/gwt/user/client/ui/DateBoxTest.java releases/1.6/user/test/com/google/gwt/user/client/ui/DateValueChangeTester.java Log: Fixes issue r3414 by making date box fire value change events reliably Review by:jlabanca Modified: releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDateBox.java == --- releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDateBox.java (original) +++ releases/1.6/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDateBox.java Fri Feb 27 11:32:09 2009 @@ -24,6 +24,7 @@ import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.museum.client.common.AbstractIssue; +import com.google.gwt.museum.client.common.EventReporter; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HorizontalPanel; @@ -176,6 +177,12 @@ + \ End: \ + (d2 == null ? null : f.format(d2)) + \); } })); + +EventReporterDate, DateBox reporter = new EventReporterDate, DateBox(); +start.addValueChangeHandler(reporter); +end.addValueChangeHandler(reporter); +reporter.report(Events are logged here); +v.add(reporter); return v; } Modified: releases/1.6/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java == --- releases/1.6/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java (original) +++ releases/1.6/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java Fri Feb 27 11:32:09 2009 @@ -117,6 +117,11 @@ public I getValue() { return value; } + + @Override + public String toDebugString() { +return super.toDebugString() + getValue(); + } @Override protected void dispatch(ValueChangeHandlerI handler) { Modified: releases/1.6/user/src/com/google/gwt/user/datepicker/client/DateBox.java == --- releases/1.6/user/src/com/google/gwt/user/datepicker/client/DateBox.java (original) +++ releases/1.6/user/src/com/google/gwt/user/datepicker/client/DateBox.java Fri Feb 27 11:32:09 2009 @@ -223,7 +223,7 @@ } public void onValueChange(ValueChangeEventDate event) { - setValue(event.getValue()); + setValue(parseDate(false), event.getValue(),true); hideDatePicker(); preventDatePickerPopup(); box.setFocus(true); @@ -432,16 +432,7 @@ } public void setValue(Date date, boolean fireEvents) { -Date oldDate = parseDate(false); -if (date != null) { - picker.setCurrentMonth(date); -} -picker.setValue(date, false); -setDate(date); - -if (fireEvents) { - DateChangeEvent.fireIfNotEqualDates(this, oldDate, date); -} +setValue(picker.getValue(), date, fireEvents); } /** @@ -473,19 +464,23 @@ }); } - /** - * Does the actual work of setting the date. Performs no validation, fires no - * events. - */ - private void setDate(Date value) { + private void setValue(Date oldDate, Date date, boolean fireEvents) { +if (date != null) { + picker.setCurrentMonth(date); +} +picker.setValue(date, false); format.reset(this, false); -box.setText(getFormat().format(this, value)); +box.setText(getFormat().format(this, date)); + +if (fireEvents) { + DateChangeEvent.fireIfNotEqualDates(this, oldDate, date); +} } private void updateDateFromTextBox() { Date parsedDate = parseDate(true); if (parsedDate != null) { - setValue(parsedDate); + setValue(picker.getValue(), parsedDate,true); } } } Modified: releases/1.6/user/test/com/google/gwt/user/client/ui/DateBoxTest.java == --- releases/1.6/user/test/com/google/gwt/user/client/ui/DateBoxTest.java (original) +++ releases/1.6/user/test/com/google/gwt/user/client/ui/DateBoxTest.java Fri Feb 27 11:32:09 2009 @@ -15,13 +15,14 @@ */ package com.google.gwt.user.client.ui; -import com.google.gwt.junit.client.GWTTestCase; +import com.google.gwt.dom.client.Document; +import
[gwt-contrib] [google-web-toolkit commit] r1248 - trunk/user/src/com/google/gwt/junit/server
Author: gwt.team.scottb Date: Tue Jul 17 16:53:40 2007 New Revision: 1248 Modified: trunk/user/src/com/google/gwt/junit/server/JUnitHostImpl.java Log: Must access fields at the actual declared class. Modified: trunk/user/src/com/google/gwt/junit/server/JUnitHostImpl.java == --- trunk/user/src/com/google/gwt/junit/server/JUnitHostImpl.java (original) +++ trunk/user/src/com/google/gwt/junit/server/JUnitHostImpl.java Tue Jul 17 16:53:40 2007 @@ -137,7 +137,7 @@ .getDeclaredConstructor(new Class[]{Throwable.class}); ctor.setAccessible(true); ex = (Throwable) ctor.newInstance(new Object[]{cause}); -setField(exClass, detailMessage, ex, ew.message); +setField(Throwable.class, detailMessage, ex, ew.message); } catch (Throwable e3) { // try ExType() try { @@ -145,7 +145,7 @@ ctor.setAccessible(true); ex = (Throwable) ctor.newInstance(null); ex.initCause(cause); - setField(exClass, detailMessage, ex, ew.message); + setField(Throwable.class, detailMessage, ex, ew.message); } catch (Throwable e4) { // we're out of options this.log(Failed to deserialize getException of type ' --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4897 - releases/1.6/user/src/com/google/gwt/user/tools
Author: jlaba...@google.com Date: Fri Feb 27 10:43:54 2009 New Revision: 4897 Modified: releases/1.6/user/src/com/google/gwt/user/tools/AppClassTemplate.javasrc releases/1.6/user/src/com/google/gwt/user/tools/AppCss.csssrc Log: Updated webAppCreator to include a much better error handling message when an RPC error occurs. Patch by: jlabanca Review by: bruce Issue: 3395 Modified: releases/1.6/user/src/com/google/gwt/user/tools/AppClassTemplate.javasrc == --- releases/1.6/user/src/com/google/gwt/user/tools/AppClassTemplate.javasrc (original) +++ releases/1.6/user/src/com/google/gwt/user/tools/AppClassTemplate.javasrc Fri Feb 27 10:43:54 2009 @@ -7,7 +7,6 @@ import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; -import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.DialogBox; @@ -21,6 +20,13 @@ * Entry point classes define codeonModuleLoad()/code. */ public class @moduleShortName implements EntryPoint { + /** + * The message displayed to the user when the server cannot be reached or + * returns an error. + */ + private static final String SERVER_ERROR = An error occurred while + + attempting to contact the server. Please check your network + + connection and try again.; /** * Create a remote service proxy to talk to the server-side Greeting service. @@ -103,11 +109,17 @@ serverResponseLabel.setText(); greetingService.greetServer(textToServer, new AsyncCallbackString() { public void onFailure(Throwable caught) { -Window.alert(Rpc failure); -sendButton.setEnabled(true); +// Show the RPC error message to the user +dialogBox.setText(Remote Procedure Call - Failure); +serverResponseLabel.addStyleName(serverResponseLabelError); +serverResponseLabel.setHTML(SERVER_ERROR); +dialogBox.center(); +closeButton.setFocus(true); } public void onSuccess(String result) { +dialogBox.setText(Remote Procedure Call); + serverResponseLabel.removeStyleName(serverResponseLabelError); serverResponseLabel.setHTML(result); dialogBox.center(); closeButton.setFocus(true); Modified: releases/1.6/user/src/com/google/gwt/user/tools/AppCss.csssrc == --- releases/1.6/user/src/com/google/gwt/user/tools/AppCss.csssrc (original) +++ releases/1.6/user/src/com/google/gwt/user/tools/AppCss.csssrc Fri Feb 27 10:43:54 2009 @@ -24,6 +24,10 @@ margin: 5px; } +.serverResponseLabelError { + color: red; +} + /** Set ids using widget.getElement().setId(idOfElement) */ #closeButton { margin: 15px 6px 6px; --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Filed against Issue 1518032 in bugganizer
Reviewers: ecc, Description: java.lang.IndexOutOfBoundsException: No child at index -1 when findDeepestOpenChild(FastTree.java:792) is called. Please review this at http://gwt-code-reviews.appspot.com/8803 Affected files: src/com/google/gwt/gen2/complexpanel/client/FastTree.java test/com/google/gwt/gen2/complexpanel/client/FastTreeTest.java Index: test/com/google/gwt/gen2/complexpanel/client/FastTreeTest.java === --- test/com/google/gwt/gen2/complexpanel/client/FastTreeTest.java (revision 1542) +++ test/com/google/gwt/gen2/complexpanel/client/FastTreeTest.java (working copy) @@ -271,6 +271,24 @@ assertTrue(item3.isSelected()); assertFalse(item1.isSelected()); } + + public void testFindDeepestOpenChild() { +FastTree tree = createBeforeSelectTestableTree(false); +FastTreeItem item = tree.getItem(0); +item.setState(true); +tree.setSelectedItem(item); +assertTrue(item.isOpen()); +assertEquals(2, item.getChildCount()); + +// no try something funky +item.removeItems(); + +try { + assertNotNull(tree.findDeepestOpenChild(item)); +} catch (IndexOutOfBoundsException iobe) { + fail(Out of bound exception thrown!); +} + } /** * helper method for testing beforeSelect event. Index: src/com/google/gwt/gen2/complexpanel/client/FastTree.java === --- src/com/google/gwt/gen2/complexpanel/client/FastTree.java (revision 1542) +++ src/com/google/gwt/gen2/complexpanel/client/FastTree.java (working copy) @@ -694,6 +694,14 @@ // Logical detach. childWidgets.remove(widget); } + + // @VisibleForTesting + FastTreeItem findDeepestOpenChild(FastTreeItem item) { +if (!item.isOpen() || item.getChildCount() == 0) { + return item; +} +return findDeepestOpenChild(item.getChild(item.getChildCount() - 1)); + } /** * Helper to build the root item. @@ -788,13 +796,6 @@ return; } - private FastTreeItem findDeepestOpenChild(FastTreeItem item) { -if (!item.isOpen()) { - return item; -} -return findDeepestOpenChild(item.getChild(item.getChildCount() - 1)); - } - private FastTreeItem findItemByChain(ArrayListElement chain, int index, FastTreeItem root) { if (index == chain.size()) { --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Filed against Issue 1518032 in bugganizer
LGTM http://gwt-code-reviews.appspot.com/8803 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4770 - releases/1.6/dev/core/test/com/google/gwt/dev
Author: sco...@google.com Date: Tue Feb 17 14:05:35 2009 New Revision: 4770 Modified: releases/1.6/dev/core/test/com/google/gwt/dev/ArgProcessorTestBase.java releases/1.6/dev/core/test/com/google/gwt/dev/CompilerTest.java releases/1.6/dev/core/test/com/google/gwt/dev/GWTCompilerTest.java releases/1.6/dev/core/test/com/google/gwt/dev/GWTShellTest.java releases/1.6/dev/core/test/com/google/gwt/dev/HostedModeTest.java Log: Added missing copyright. Modified: releases/1.6/dev/core/test/com/google/gwt/dev/ArgProcessorTestBase.java == --- releases/1.6/dev/core/test/com/google/gwt/dev/ArgProcessorTestBase.java (original) +++ releases/1.6/dev/core/test/com/google/gwt/dev/ArgProcessorTestBase.java Tue Feb 17 14:05:35 2009 @@ -1,3 +1,18 @@ +/* + * 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; import com.google.gwt.util.tools.Utility; Modified: releases/1.6/dev/core/test/com/google/gwt/dev/CompilerTest.java == --- releases/1.6/dev/core/test/com/google/gwt/dev/CompilerTest.java (original) +++ releases/1.6/dev/core/test/com/google/gwt/dev/CompilerTest.java Tue Feb 17 14:05:35 2009 @@ -1,3 +1,18 @@ +/* + * 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; import com.google.gwt.core.ext.TreeLogger; Modified: releases/1.6/dev/core/test/com/google/gwt/dev/GWTCompilerTest.java == --- releases/1.6/dev/core/test/com/google/gwt/dev/GWTCompilerTest.java (original) +++ releases/1.6/dev/core/test/com/google/gwt/dev/GWTCompilerTest.java Tue Feb 17 14:05:35 2009 @@ -1,3 +1,18 @@ +/* + * 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; import com.google.gwt.core.ext.TreeLogger; Modified: releases/1.6/dev/core/test/com/google/gwt/dev/GWTShellTest.java == --- releases/1.6/dev/core/test/com/google/gwt/dev/GWTShellTest.java (original) +++ releases/1.6/dev/core/test/com/google/gwt/dev/GWTShellTest.java Tue Feb 17 14:05:35 2009 @@ -1,3 +1,18 @@ +/* + * 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; import com.google.gwt.core.ext.TreeLogger; Modified: releases/1.6/dev/core/test/com/google/gwt/dev/HostedModeTest.java == --- releases/1.6/dev/core/test/com/google/gwt/dev/HostedModeTest.java (original) +++ releases/1.6/dev/core/test/com/google/gwt/dev/HostedModeTest.java Tue Feb 17
[gwt-contrib] [google-web-toolkit commit] r4797 - in releases/1.6: dev/core/src/com/google/gwt/dev/shell distro-source/core/src
Author: br...@google.com Date: Thu Feb 19 14:43:57 2009 New Revision: 4797 Modified: releases/1.6/dev/core/src/com/google/gwt/dev/shell/BrowserDialog.java releases/1.6/dev/core/src/com/google/gwt/dev/shell/DialogBase.java releases/1.6/dev/core/src/com/google/gwt/dev/shell/PlatformSpecific.java releases/1.6/distro-source/core/src/index.html Log: General polish. 1) Modified BrowserDialog DialogBase to fix a long-standing aesthetic problem on the About dialog (the OK button used to look lopsided due to extra spaces); in the process, I dumbed-down the DialogBase, which was overgeneralized to work with an OK button, Cancel button, neither, either, or both. Now it always has one button, Close. 2) In PlatformSpecific, reduced the log level of the update notification from WARN to INFO. Finding out about a GWT upgrade is a happy event, and WARN log entries make people feel anxious. INFO is the default log level, so people will be just as likely to see it. jat did the design the review, in the sense that I said, Hey, John. Do you care if I do this? and he said, No, I don't. So I did. 3) Updated index.html to point to 1.6 doc links. Also, for the first time, I switched AJAX to the mixed-case Ajax so that our index.html will look a whole lot cooler. Review by: jgw (desk review) Modified: releases/1.6/dev/core/src/com/google/gwt/dev/shell/BrowserDialog.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/shell/BrowserDialog.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/shell/BrowserDialog.java Thu Feb 19 14:43:57 2009 @@ -41,7 +41,7 @@ private final TreeLogger logger; public BrowserDialog(Shell parent, TreeLogger logger, String html) { -super(parent, 550, 520, true, false); +super(parent, 550, 520); this.logger = logger; this.html = html; this.url = null; Modified: releases/1.6/dev/core/src/com/google/gwt/dev/shell/DialogBase.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/shell/DialogBase.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/shell/DialogBase.java Thu Feb 19 14:43:57 2009 @@ -37,31 +37,17 @@ private class Buttons extends GridPanel { public Buttons(Composite parent) { - super(parent, SWT.NONE, hasCancel ? 2 : 1, true); + super(parent, SWT.NONE, 1, true, 12, 6); - if (hasOk) { -okButton = new Button(this, SWT.PUSH); -setGridData(okButton, 1, 1, FILL, FILL, false, false); -okButton.setText(OK); -okButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { -clickOkButton(); - } -}); - } - - if (hasCancel) { -cancelButton = new Button(this, SWT.PUSH); -setGridData(cancelButton, 1, 1, FILL, FILL, false, false); -cancelButton.setText(Cancel); -cancelButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { -clickCancelButton(); - } -}); - } + okButton = new Button(this, SWT.PUSH); + setGridData(okButton, 1, 1, FILL, FILL, false, false); + okButton.setText(Close); + okButton.addSelectionListener(new SelectionAdapter() { +@Override +public void widgetSelected(SelectionEvent e) { + clickOkButton(); +} + }); shell.setDefaultButton(okButton); } @@ -75,10 +61,8 @@ Control contents = createContents(this); setGridData(contents, 1, 1, FILL, FILL, true, true); - if (hasOk || hasCancel) { -Buttons buttons = new Buttons(this); -setGridData(buttons, 1, 1, RIGHT, BOTTOM, false, false); - } + Buttons buttons = new Buttons(this); + setGridData(buttons, 1, 1, RIGHT, BOTTOM, false, false); } } @@ -93,14 +77,8 @@ return msgBox.open() == SWT.YES; } - private Button cancelButton; - private boolean cancelled = true; - private boolean hasCancel; - - private boolean hasOk; - private int minHeight; private int minWidth; @@ -110,16 +88,9 @@ private Shell shell; public DialogBase(Shell parent, int minWidth, int minHeight) { -this(parent, minWidth, minHeight, true, true); - } - - public DialogBase(Shell parent, int minWidth, int minHeight, - boolean hasOkButton, boolean hasCancelButton) { super(parent, SWT.NONE); this.minWidth = minWidth; this.minHeight = minHeight; -hasOk = hasOkButton; -hasCancel = hasCancelButton; } public Shell getShell() { Modified: releases/1.6/dev/core/src/com/google/gwt/dev/shell/PlatformSpecific.java ==
[gwt-contrib] [google-web-toolkit commit] r4801 - in releases/1.6/dev/core: src/com/google/gwt/dev/javac test/com/google/gwt/dev/javac
Author: sco...@google.com Date: Thu Feb 19 19:01:19 2009 New Revision: 4801 Modified: releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java releases/1.6/dev/core/test/com/google/gwt/dev/javac/JsniCheckerTest.java Log: Remove spurious warnings generated by referencing nullField and nullMethod. Modified: releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java Thu Feb 19 19:01:19 2009 @@ -156,7 +156,7 @@ if (!refErrors.isEmpty()) { errors.put(jsniRefString, refErrors); } - } else { + } else if (!jsniRef.className().equals(null)) { GWTProblem.recordInCud(ProblemSeverities.Warning, meth, cud, Referencing class ' + jsniRef.className() + : unable to resolve class, expect subsequent failures, Modified: releases/1.6/dev/core/test/com/google/gwt/dev/javac/JsniCheckerTest.java == --- releases/1.6/dev/core/test/com/google/gwt/dev/javac/JsniCheckerTest.java (original) +++ releases/1.6/dev/core/test/com/google/gwt/dev/javac/JsniCheckerTest.java Thu Feb 19 19:01:19 2009 @@ -223,6 +223,28 @@ Referencing method 'Buggy.m': return type 'long' is not safe to access in JSNI code); } + public void testNullField() { +StringBuffer code = new StringBuffer(); +code.append(class Buggy {\n); +code.append( static native Object main() /*-{\n); +code.append(return @null::nullField;\n); +code.append( }-*/;\n); +code.append(}\n); + +shouldGenerateNoWarning(code); + } + + public void testNullMethod() { +StringBuffer code = new StringBuffer(); +code.append(class Buggy {\n); +code.append( static native Object main() /*-{\n); +code.append(return @null::nullMethod()();\n); +code.append( }-*/;\n); +code.append(}\n); + +shouldGenerateNoWarning(code); + } + public void testOverloadedMethodWithNoWarning() { StringBuffer code = new StringBuffer(); code.append(class Buggy {\n); @@ -378,6 +400,10 @@ private void shouldGenerateNoError(CharSequence code, CharSequence extraCode) { shouldGenerateError(code, extraCode, -1, null); + } + + private void shouldGenerateNoWarning(CharSequence code) { +shouldGenerateWarning(code, -1, null); } private void shouldGenerateWarning(CharSequence buggyCode, --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4796 - in releases/1.6/user: src/com/google/gwt/dom/client test/com/google/gwt/user/client/ui
Author: jlaba...@google.com Date: Thu Feb 19 08:18:41 2009 New Revision: 4796 Modified: releases/1.6/user/src/com/google/gwt/dom/client/DOMImplMozilla.java releases/1.6/user/test/com/google/gwt/user/client/ui/DOMRtlTest.java Log: Fixed DOMRtlTest.testGetAbsolutePositionWhenScrolled(). We now allow the return value of getAbsoluteLeft to be off by 1px, which is possible in FF2 if the element is in a scrollable div. Patch by: jlabanca Review by: ecc (desk) Modified: releases/1.6/user/src/com/google/gwt/dom/client/DOMImplMozilla.java == --- releases/1.6/user/src/com/google/gwt/dom/client/DOMImplMozilla.java (original) +++ releases/1.6/user/src/com/google/gwt/dom/client/DOMImplMozilla.java Thu Feb 19 08:18:41 2009 @@ -51,6 +51,8 @@ // here due to a change in getBoxObjectFor which causes inconsistencies // on whether the calculations are inside or outside of the element's // border. + // If the element is in a scrollable div, getBoxObjectFor(elem) can return + // a value that varies by 1 pixel. return $doc.getBoxObjectFor(elem).screenX - $doc.getBoxObjectFor($doc.documentElement).screenX; } Modified: releases/1.6/user/test/com/google/gwt/user/client/ui/DOMRtlTest.java == --- releases/1.6/user/test/com/google/gwt/user/client/ui/DOMRtlTest.java (original) +++ releases/1.6/user/test/com/google/gwt/user/client/ui/DOMRtlTest.java Thu Feb 19 08:18:41 2009 @@ -33,10 +33,8 @@ /** * Tests {...@link DOM#getAbsoluteLeft(Element)} for consistency when the element * contains children and has scrollbars. - * - * TODO(jlabanca): Activate this test (deactivated on 2/18/09) */ - public void disabledTestGetAbsolutePositionWhenScrolled() { + public void testGetAbsolutePositionWhenScrolled() { assertTrue(LocaleInfo.getCurrentLocale().isRTL()); final Element outer = DOM.createDiv(); final Element inner = DOM.createDiv(); @@ -45,7 +43,7 @@ outer.getStyle().setProperty(position, absolute); outer.getStyle().setProperty(overflow, auto); outer.getStyle().setPropertyPx(top, 0); -outer.getStyle().setPropertyPx(left, 0); +outer.getStyle().setPropertyPx(left, 100); outer.getStyle().setPropertyPx(width, 200); outer.getStyle().setPropertyPx(height, 200); RootPanel.getBodyElement().appendChild(outer); @@ -58,9 +56,11 @@ // Check the position when scrolled outer.setScrollLeft(50); -assertTrue(outer.getScrollLeft() 0); -assertEquals(-50, inner.getAbsoluteLeft() -- Document.get().getBodyOffsetLeft()); +assertEquals(outer.getScrollLeft(), 50); +int absLeft = inner.getAbsoluteLeft() - Document.get().getBodyOffsetLeft(); +// TODO (jlabanca): FF2 incorrectly reports the absolute left as 49. When +// we drop FF2 support, the only valid return value is 50. +assertTrue(50 == absLeft || 49 == absLeft); // Cleanup test RootPanel.getBodyElement().removeChild(outer); --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4802 - in releases/1.6/dev/core: src/com/google/gwt/dev test/com/google/gwt/dev
Author: sco...@google.com Date: Thu Feb 19 19:04:33 2009 New Revision: 4802 Modified: releases/1.6/dev/core/src/com/google/gwt/dev/ServletValidator.java releases/1.6/dev/core/test/com/google/gwt/dev/ServletValidatorTest.java Log: Removed deprecated api calls. Modified: releases/1.6/dev/core/src/com/google/gwt/dev/ServletValidator.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/ServletValidator.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/ServletValidator.java Thu Feb 19 19:04:33 2009 @@ -40,7 +40,7 @@ public static ServletValidator create(TreeLogger logger, File webXml) { try { - return create(logger, webXml.toURL()); + return create(logger, webXml.toURI().toURL()); } catch (MalformedURLException e) { logger.log(TreeLogger.WARN, Unable to process ' + webXml.getAbsolutePath() + ' for servlet validation, e); Modified: releases/1.6/dev/core/test/com/google/gwt/dev/ServletValidatorTest.java == --- releases/1.6/dev/core/test/com/google/gwt/dev/ServletValidatorTest.java (original) +++ releases/1.6/dev/core/test/com/google/gwt/dev/ServletValidatorTest.java Thu Feb 19 19:04:33 2009 @@ -68,7 +68,7 @@ public void testBadUrl() throws Exception { UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder(); builder.setLowestLogLevel(TreeLogger.WARN); -URL url = new File(nonexistent.web.xml).toURL(); +URL url = new File(nonexistent.web.xml).toURI().toURL(); builder.expectWarn(Unable to process ' + url.toExternalForm() + ' for servlet validation, IOException.class); UnitTestTreeLogger logger = builder.createLogger(); --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4805 - releases/1.6/dev/core/src/com/google/gwt/dev
Author: sco...@google.com Date: Thu Feb 19 21:08:56 2009 New Revision: 4805 Modified: releases/1.6/dev/core/src/com/google/gwt/dev/LegacyCompilerOptions.java releases/1.6/dev/core/src/com/google/gwt/dev/Link.java Log: General polish: marking a couple of interfaces deprecated to avoid confusion. Modified: releases/1.6/dev/core/src/com/google/gwt/dev/LegacyCompilerOptions.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/LegacyCompilerOptions.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/LegacyCompilerOptions.java Thu Feb 19 21:08:56 2009 @@ -21,7 +21,7 @@ /** * The complete set of options for the GWT compiler. */ -public interface LegacyCompilerOptions extends PrecompileOptions, LegacyLinkOptions, -OptionLocalWorkers { +...@deprecated +public interface LegacyCompilerOptions extends PrecompileOptions, +LegacyLinkOptions, OptionLocalWorkers { } - \ No newline at end of file Modified: releases/1.6/dev/core/src/com/google/gwt/dev/Link.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/Link.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/Link.java Thu Feb 19 21:08:56 2009 @@ -44,6 +44,7 @@ /** * Options for Link. */ + @Deprecated public interface LegacyLinkOptions extends CompileTaskOptions, OptionOutDir { } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4818 - in trunk: dev/oophm/overlay/com/google/gwt/dev/shell user/src/com/google/gwt/user/client/...
Author: sco...@google.com Date: Fri Feb 20 09:36:24 2009 New Revision: 4818 Modified: trunk/dev/oophm/overlay/com/google/gwt/dev/shell/PlatformSpecific.java trunk/user/src/com/google/gwt/user/client/ui/Button.java trunk/user/src/com/google/gwt/user/client/ui/PopupPanel.java trunk/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java trunk/user/super/com/google/gwt/emul/java/lang/Class.java trunk/user/test/com/google/gwt/http/HTTPSuite.java trunk/user/test/com/google/gwt/http/client/HTTPRequestTest.java trunk/user/test/com/google/gwt/http/server/RequestBuilderTestServlet.java Log: Checkstyle fixes. Review by: jat Modified: trunk/dev/oophm/overlay/com/google/gwt/dev/shell/PlatformSpecific.java == --- trunk/dev/oophm/overlay/com/google/gwt/dev/shell/PlatformSpecific.java (original) +++ trunk/dev/oophm/overlay/com/google/gwt/dev/shell/PlatformSpecific.java Fri Feb 20 09:36:24 2009 @@ -15,6 +15,10 @@ */ package com.google.gwt.dev.shell; +import com.google.gwt.core.ext.TreeLogger; +import com.google.gwt.core.ext.TreeLogger.HelpInfo; +import com.google.gwt.dev.shell.CheckForUpdates.UpdateResult; + import java.lang.reflect.Constructor; import java.net.URL; import java.util.concurrent.Callable; @@ -22,10 +26,6 @@ import java.util.concurrent.FutureTask; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; - -import com.google.gwt.core.ext.TreeLogger; -import com.google.gwt.core.ext.TreeLogger.HelpInfo; -import com.google.gwt.dev.shell.CheckForUpdates.UpdateResult; /** * Performs platform-specific class selection. Modified: trunk/user/src/com/google/gwt/user/client/ui/Button.java == --- trunk/user/src/com/google/gwt/user/client/ui/Button.java(original) +++ trunk/user/src/com/google/gwt/user/client/ui/Button.javaFri Feb 20 09:36:24 2009 @@ -18,7 +18,6 @@ import com.google.gwt.dom.client.ButtonElement; import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.ButtonElement; import com.google.gwt.event.dom.client.ClickHandler; /** Modified: trunk/user/src/com/google/gwt/user/client/ui/PopupPanel.java == --- trunk/user/src/com/google/gwt/user/client/ui/PopupPanel.java (original) +++ trunk/user/src/com/google/gwt/user/client/ui/PopupPanel.javaFri Feb 20 09:36:24 2009 @@ -96,8 +96,8 @@ * * ul * liCENTER - Expand from the center of the popup/li - * liONE_WAY_CORNER - Expand from the top left corner, do not animate hiding - * /li + * liONE_WAY_CORNER - Expand from the top left corner, do not animate + * hiding /li * /ul */ static enum AnimationType { @@ -109,14 +109,14 @@ */ static class ResizeAnimation extends Animation { /** - * The offset height and width of the current {...@link PopupPanel}. + * The {...@link PopupPanel} being affected. */ -private int offsetHeight, offsetWidth = -1; +private PopupPanel curPanel = null; /** - * The {...@link PopupPanel} being affected. + * The offset height and width of the current {...@link PopupPanel}. */ -private PopupPanel curPanel = null; +private int offsetHeight, offsetWidth = -1; /** * A boolean indicating whether we are showing or hiding the popup. @@ -281,10 +281,10 @@ */ private AnimationType animType = AnimationType.CENTER; - private HandlerRegistration nativePreviewHandlerRegistration; - private boolean autoHide, previewAllNativeEvents, modal, showing; + private ListElement autoHidePartners; + // Used to track requested size across changing child widgets private String desiredHeight; @@ -292,16 +292,16 @@ private boolean isAnimationEnabled = false; - private ListElement autoHidePartners; + // the left style attribute in pixels + private int leftPosition = -1; + + private HandlerRegistration nativePreviewHandlerRegistration; /** * The {...@link ResizeAnimation} used to open and close the {...@link PopupPanel}s. */ private ResizeAnimation resizeAnimation = new ResizeAnimation(this); - // the left style attribute in pixels - private int leftPosition = -1; - // The top style attribute in pixels private int topPosition = -1; @@ -478,8 +478,8 @@ } /** - * Returns codetrue/code if the popup should be automatically hidden when - * the user clicks outside of it. + * Returns codetrue/code if the popup should be automatically hidden + * when the user clicks outside of it. * * @return true if autoHide is enabled, false if disabled */ @@ -585,14 +585,6 @@ return true; } - @Override - protected void onUnload() { -//
[gwt-contrib] [google-web-toolkit commit] r4820 - in trunk/user: src/com/google/gwt/user/client/ui test/com/google/gwt/user/client/ui
Author: j...@google.com Date: Fri Feb 20 11:26:27 2009 New Revision: 4820 Modified: trunk/user/src/com/google/gwt/user/client/ui/CheckBox.java trunk/user/test/com/google/gwt/user/client/ui/RadioButtonTest.java Log: Fixes CheckBox.replaceInputElement() to not reverse the order of the input label elements. This was causing RadioButtons to have their elements reversed when setName() was called. Patch by: jgw Review by: jlabanca (desk check) Modified: trunk/user/src/com/google/gwt/user/client/ui/CheckBox.java == --- trunk/user/src/com/google/gwt/user/client/ui/CheckBox.java (original) +++ trunk/user/src/com/google/gwt/user/client/ui/CheckBox.java Fri Feb 20 11:26:27 2009 @@ -387,8 +387,7 @@ // Clear out the old input element setEventListener(asOld(inputElem), null); -getElement().removeChild(inputElem); -getElement().insertBefore(newInputElem, null); +getElement().replaceChild(newInputElem, inputElem); // Sink events on the new element Event.sinkEvents(elem, Event.getEventsSunk(inputElem)); Modified: trunk/user/test/com/google/gwt/user/client/ui/RadioButtonTest.java == --- trunk/user/test/com/google/gwt/user/client/ui/RadioButtonTest.java (original) +++ trunk/user/test/com/google/gwt/user/client/ui/RadioButtonTest.java Fri Feb 20 11:26:27 2009 @@ -110,4 +110,22 @@ assertFalse(r2.getValue()); assertTrue(r3.getValue()); } + + /** + * Ensures that the element order doesn't get reversed when the radio's + * name is changed. + */ + public void testOrderAfterSetName() { +RadioButton radio = new RadioButton(oldName); +assertEquals(oldName, radio.getName()); + +radio.setName(newName); +assertEquals(newName, radio.getName()); + +Element parent = radio.getElement(); +Element firstChild = parent.getFirstChildElement().cast(); +Element secondChild = firstChild.getNextSiblingElement().cast(); +assertEquals(input, firstChild.getTagName().toLowerCase()); +assertEquals(label, secondChild.getTagName().toLowerCase()); + } } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4823 - in releases/1.6/dev/core/src/com/google/gwt/dev: . jdt jjs util
Author: sco...@google.com Date: Fri Feb 20 11:49:09 2009 New Revision: 4823 Modified: releases/1.6/dev/core/src/com/google/gwt/dev/Precompile.java releases/1.6/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java releases/1.6/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java releases/1.6/dev/core/src/com/google/gwt/dev/util/Util.java Log: Fixes issue 3357; using -validateOnly with I18N caused spurious validation errors because we were trying to rebind every visible class. Review by: bruce (desk) Modified: releases/1.6/dev/core/src/com/google/gwt/dev/Precompile.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/Precompile.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/Precompile.javaFri Feb 20 11:49:09 2009 @@ -246,8 +246,8 @@ public boolean run(TreeLogger logger) throws UnableToCompleteException { FutureTaskUpdateResult updater = null; if (!options.isUpdateCheckDisabled()) { -updater = PlatformSpecific.checkForUpdatesInBackgroundThread(logger, -CheckForUpdates.ONE_DAY); +updater = PlatformSpecific.checkForUpdatesInBackgroundThread( +logger, CheckForUpdates.ONE_DAY); } boolean success = new Precompile(options).run(logger); if (success) { @@ -298,7 +298,8 @@ compilationState, rpo); PerfLogger.start(Precompile); UnifiedAst unifiedAst = JavaToJavaScriptCompiler.precompile(logger, - frontEnd, declEntryPts, jjsOptions, rpo.getPermuationCount() == 1); + frontEnd, declEntryPts, null, jjsOptions, + rpo.getPermuationCount() == 1); PerfLogger.end(); // Merge all identical permutations together. @@ -340,13 +341,14 @@ CompilationState compilationState = module.getCompilationState(logger); String[] declEntryPts = module.getEntryPointTypeNames(); + String[] additionalRootTypes = null; if (declEntryPts.length == 0) { -// Pretend that every single compilation unit is an entry point. +// No declared entry points, just validate all visible classes. SetCompilationUnit compilationUnits = compilationState.getCompilationUnits(); -declEntryPts = new String[compilationUnits.size()]; +additionalRootTypes = new String[compilationUnits.size()]; int i = 0; for (CompilationUnit unit : compilationUnits) { - declEntryPts[i++] = unit.getTypeName(); + additionalRootTypes[i++] = unit.getTypeName(); } } @@ -359,7 +361,7 @@ WebModeCompilerFrontEnd frontEnd = new WebModeCompilerFrontEnd( compilationState, rpo); JavaToJavaScriptCompiler.precompile(logger, frontEnd, declEntryPts, - jjsOptions, true); + additionalRootTypes, jjsOptions, true); return true; } catch (UnableToCompleteException e) { // Already logged. Modified: releases/1.6/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java Fri Feb 20 11:49:09 2009 @@ -23,7 +23,6 @@ import com.google.gwt.dev.jdt.FindDeferredBindingSitesVisitor.DeferredBindingSite; import com.google.gwt.dev.util.Empty; import com.google.gwt.dev.util.JsniRef; -import com.google.gwt.dev.util.Util; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; @@ -31,6 +30,7 @@ import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; +import java.util.Collections; import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -176,7 +176,7 @@ } dependentTypeNames.add(typeName); } -Util.addAll(dependentTypeNames, resultTypes); +Collections.addAll(dependentTypeNames, resultTypes); } catch (UnableToCompleteException e) { FindDeferredBindingSitesVisitor.reportRebindProblem(site, Failed to resolve ' + reqType + ' via deferred binding); Modified: releases/1.6/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java Fri Feb 20 11:49:09 2009 @@ -72,8 +72,8 @@ import com.google.gwt.dev.js.JsVerboseNamer; import com.google.gwt.dev.js.ast.JsProgram;
[gwt-contrib] [google-web-toolkit commit] r4824 - in trunk/dev/core: src/com/google/gwt/dev/cfg src/com/google/gwt/dev/resource/impl test/c...
Author: amitman...@google.com Date: Fri Feb 20 12:06:33 2009 New Revision: 4824 Added: trunk/dev/core/src/com/google/gwt/dev/resource/impl/DefaultFilters.java trunk/dev/core/test/com/google/gwt/dev/resource/impl/DefaultFiltersTest.java Modified: trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java Log: This patch provides custom implementations for pattern matching of resources that are much faster than the ant implementations they replace, in the common cases. For uncommon cases, the implementations defer to Ant's pattern matching. Patch by: amitmanjhi Review by: jat (desk review) Modified: trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java == --- trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java(original) +++ trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.javaFri Feb 20 12:06:33 2009 @@ -26,16 +26,14 @@ import com.google.gwt.dev.javac.JavaSourceOracle; import com.google.gwt.dev.javac.impl.JavaSourceOracleImpl; import com.google.gwt.dev.resource.Resource; +import com.google.gwt.dev.resource.impl.DefaultFilters; import com.google.gwt.dev.resource.impl.PathPrefix; import com.google.gwt.dev.resource.impl.PathPrefixSet; -import com.google.gwt.dev.resource.impl.ResourceFilter; import com.google.gwt.dev.resource.impl.ResourceOracleImpl; import com.google.gwt.dev.util.Empty; import com.google.gwt.dev.util.PerfLogger; import com.google.gwt.dev.util.Util; -import org.apache.tools.ant.types.ZipScanner; - import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -54,11 +52,6 @@ * XML for unit tests. */ public class ModuleDef implements PublicOracle { - /** - * Default to recursive inclusion of java files if no explicit include - * directives are specified. - */ - private static final String[] DEFAULT_SOURCE_FILE_INCLUDES_LIST = new String[] {**/*.java}; private static final ComparatorMap.EntryString, ? REV_NAME_CMP = new ComparatorMap.EntryString, ?() { public int compare(Map.EntryString, ? entry1, Map.EntryString, ? entry2) { @@ -123,9 +116,11 @@ private PathPrefixSet sourcePrefixSet = new PathPrefixSet(); private final Styles styles = new Styles(); + private final DefaultFilters defaultFilters; public ModuleDef(String name) { this.name = name; +defaultFilters = new DefaultFilters(); } public synchronized void addEntryPointTypeName(String typeName) { @@ -155,15 +150,9 @@ if (lazyPublicOracle != null) { throw new IllegalStateException(Already normalized); } - -final ZipScanner scanner = getScanner(includeList, excludeList, -defaultExcludes, caseSensitive); - -publicPrefixSet.add(new PathPrefix(publicPackage, new ResourceFilter() { - public boolean allows(String path) { -return scanner.match(path); - } -}, true)); +publicPrefixSet.add(new PathPrefix(publicPackage, +defaultFilters.customResourceFilter(includeList, excludeList, +defaultExcludes, caseSensitive), true)); } public void addSourcePackage(String sourcePackage, String[] includeList, @@ -178,25 +167,9 @@ if (lazySourceOracle != null) { throw new IllegalStateException(Already normalized); } - -if (includeList.length == 0) { - /* - * If no includes list was provided then, use the default. - */ - includeList = DEFAULT_SOURCE_FILE_INCLUDES_LIST; -} - -final ZipScanner scanner = getScanner(includeList, excludeList, -defaultExcludes, caseSensitive); - -ResourceFilter sourceFileFilter = new ResourceFilter() { - public boolean allows(String path) { -return path.endsWith(.java) scanner.match(path); - } -}; - -PathPrefix pathPrefix = new PathPrefix(sourcePackage, sourceFileFilter, -isSuperSource); +PathPrefix pathPrefix = new PathPrefix(sourcePackage, +defaultFilters.customJavaFilter(includeList, excludeList, +defaultExcludes, caseSensitive), isSuperSource); sourcePrefixSet.add(pathPrefix); } @@ -466,29 +439,6 @@ lazyJavaSourceOracle = new JavaSourceOracleImpl(lazySourceOracle); PerfLogger.end(); - } - - private ZipScanner getScanner(String[] includeList, String[] excludeList, - boolean defaultExcludes, boolean caseSensitive) { -/* - * Hijack Ant's ZipScanner to handle inclusions/exclusions exactly as Ant - * does. We're only using its pattern-matching capabilities; the code path - * I'm using never tries to hit the filesystem in Ant 1.6.5. - */ -ZipScanner scanner = new ZipScanner(); -if (includeList.length 0) { - scanner.setIncludes(includeList); -} -if (excludeList.length 0) { - scanner.setExcludes(excludeList); -} -if (defaultExcludes) { - scanner.addDefaultExcludes(); -} -
[gwt-contrib] [google-web-toolkit commit] r4799 - in trunk: . user
Author: b...@google.com Date: Thu Feb 19 15:38:40 2009 New Revision: 4799 Modified: trunk/common.ant.xml trunk/user/build.xml Log: Allow test parallelization to be set externally. Patch by: bobv Review by: spoon (desk) Modified: trunk/common.ant.xml == --- trunk/common.ant.xml(original) +++ trunk/common.ant.xmlThu Feb 19 15:38:40 2009 @@ -37,6 +37,7 @@ property name=gwt.build.jni location=${gwt.build}/jni / property name=gwt.build.staging location=${gwt.build}/staging / property name=gwt.build.dist location=${gwt.build}/dist / + property name=gwt.threadsPerProcessor value=1 / property name=project.build location=${gwt.build.out}/${project.tail} / property name=project.lib location=${gwt.build.lib}/gwt-${ant.project.name}.jar / property name=project.jni location=${gwt.build}/${project.tail} / Modified: trunk/user/build.xml == --- trunk/user/build.xml(original) +++ trunk/user/build.xmlThu Feb 19 15:38:40 2009 @@ -157,7 +157,7 @@ is executing -- limit failonerror=true hours=2 -parallel threadsPerProcessor=1 +parallel threadsPerProcessor=${gwt.threadsPerProcessor} !-- selenium-test is a no-op unless gwt.selenium.hosts is defined -- antcall target=selenium-test/ !-- remoteweb-test is a no-op unless gwt.remote.browsers is defined -- --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4817 - trunk/user/src/com/google/gwt/core/client/impl
Author: b...@google.com Date: Fri Feb 20 04:53:55 2009 New Revision: 4817 Modified: trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java Log: Fix null derefenece in Mozilla browsers if we attempt to create a JavaScriptException after encountering a throw null; scenario. Patch by: bobv Review by: jgw (TBR) Modified: trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java == --- trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java (original) +++ trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java Fri Feb 20 04:53:55 2009 @@ -112,7 +112,7 @@ } protected native JsArrayString getStack(JavaScriptObject e) /*-{ - return !!e.stack ? e.stack.split('\n') : []; + return (e e.stack) ? e.stack.split('\n') : []; }-*/; protected int toSplice() { @@ -160,7 +160,7 @@ } private native JsArrayString getMessage(JavaScriptObject e) /*-{ - return !!e.message ? e.message.split('\n') : []; + return (e e.message) ? e.message.split('\n') : []; }-*/; private native void setLength(JsArrayString obj, int length) /*-{ --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4846 - releases/1.6/distro-source/core/src
Author: br...@google.com Date: Mon Feb 23 19:46:27 2009 New Revision: 4846 Modified: releases/1.6/distro-source/core/src/index.html Log: Fixed hyperlinks to samples in recognition of the new project directory structure. Modified: releases/1.6/distro-source/core/src/index.html == --- releases/1.6/distro-source/core/src/index.html (original) +++ releases/1.6/distro-source/core/src/index.html Mon Feb 23 19:46:27 2009 @@ -113,43 +113,43 @@ Their purpose is to demonstrate the mechanics of different techniques you can use when building applications with GWT. ul li -a href=samples/Hello/www/com.google.gwt.sample.hello.Hello/Hello.htmlHello World/a +a href=samples/Hello/war/Hello.htmlHello World/a div The simplest application you can write with GWT. /div /li li -a href=samples/Showcase/www/com.google.gwt.sample.showcase.Showcase/Showcase.htmlShowcase/a +a href=samples/Showcase/war/Showcase.htmlShowcase/a div Complex UI illustrating Widgets in action. /div /li li -a href=samples/DynaTable/www/com.google.gwt.sample.dynatable.DynaTable/DynaTable.htmlDynamic Table/a +a href=samples/DynaTable/war/DynaTable.htmlDynamic Table/a div How to take advantage of polymorphic RPC. /div /li li -a href=samples/Mail/www/com.google.gwt.sample.mail.Mail/Mail.htmlMail/a +a href=samples/Mail/war/Mail.htmlMail/a div Look and feel similar to a traditional desktop application. /div /li li -a href=samples/JSON/www/com.google.gwt.sample.json.JSON/JSON.htmlJSON/a +a href=samples/JSON/war/JSON.htmlJSON/a div Interoperation with a JSON service. /div /li li -a href=samples/I18N/www/com.google.gwt.sample.i18n.I18N/I18N.htmlI18N/a +a href=samples/I18N/war/I18N.htmlI18N/a div A glimpse at GWT's internationalization facilities. /div /li li - a href=samples/SimpleXML/www/com.google.gwt.sample.simplexml.SimpleXML/SimpleXML.htmlSimpleXML/a + a href=samples/SimpleXML/war/SimpleXML.htmlSimpleXML/a div Using GWT's XML parsing classes. /div --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4850 - releases/1.6/user/src/com/google/gwt/user/tools
Author: a...@google.com Date: Tue Feb 24 10:17:19 2009 New Revision: 4850 Modified: releases/1.6/user/src/com/google/gwt/user/tools/web.xmlsrc Log: Add a doctype to the template for our generated web.xml on new projects. review by: scottb Modified: releases/1.6/user/src/com/google/gwt/user/tools/web.xmlsrc == --- releases/1.6/user/src/com/google/gwt/user/tools/web.xmlsrc (original) +++ releases/1.6/user/src/com/google/gwt/user/tools/web.xmlsrc Tue Feb 24 10:17:19 2009 @@ -1,4 +1,8 @@ ?xml version=1.0 encoding=UTF-8? +!DOCTYPE web-app +PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN +http://java.sun.com/dtd/web-app_2_3.dtd; + web-app !-- Default page to serve -- --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4831 - in trunk/user: src/com/google/gwt/core/client/impl test/com/google/gwt/core/client/impl
Author: b...@google.com Date: Fri Feb 20 16:52:41 2009 New Revision: 4831 Modified: trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java trunk/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java Log: Fix test breaks on Linux hosted-mode browser running in web mode; sometimes a function's toString() will start with spaces. Patch by: bobv Review by: jgw (TBR) Modified: trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java == --- trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java (original) +++ trunk/user/src/com/google/gwt/core/client/impl/StackTraceCreator.java Fri Feb 20 16:52:41 2009 @@ -204,7 +204,7 @@ static String extractNameFromToString(String fnToString) { String toReturn = ; - +fnToString = fnToString.trim(); int index = fnToString.indexOf((); if (index != -1) { int start = fnToString.startsWith(function) ? 8 : 0; @@ -215,7 +215,7 @@ } private static native JsArrayString splice(JsArrayString arr, int length) /*-{ -arr.splice(0, length); +(arr.length = length) arr.splice(0, length); return arr; }-*/; } Modified: trunk/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java == --- trunk/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java (original) +++ trunk/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java Fri Feb 20 16:52:41 2009 @@ -18,8 +18,6 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.JavaScriptException; import com.google.gwt.core.client.JsArrayString; -import com.google.gwt.core.client.impl.StackTraceCreator.Collector; -import com.google.gwt.core.client.impl.StackTraceCreator.CollectorMoz; import com.google.gwt.junit.client.GWTTestCase; /** @@ -27,41 +25,33 @@ * static so that their names can be reliably determined in web mode. */ public class StackTraceCreatorTest extends GWTTestCase { - @Override - public String getModuleName() { -return com.google.gwt.core.Core; - } - public static void testJavaScriptException() { -StackTraceElement[] stack = null; +Throwable t = null; try { throwNative(); + fail(No exception thrown); } catch (JavaScriptException e) { /* * Some browsers may or may not be able to implement this at all, so we'll * at least make sure that an array is returned; */ - stack = e.getStackTrace(); + assertNotNull(e.getStackTrace()); + if (e.getStackTrace().length == 0) { +assertTrue(hosted mode, GWT.isScript()); +return; + } else { +t = e; + } } -assertNotNull(stack); String myName = null; if (!GWT.isScript()) { myName = testJavaScriptException; -} else if (GWT.Collector create(Collector.class) instanceof CollectorMoz) { - myName = throwNativeName(); +} else { + myName = testJavaScriptExceptionName(); } -if (myName != null) { - boolean found = false; - for (StackTraceElement elt : stack) { -if (elt.getMethodName().equals(myName)) { - found = true; - break; -} - } - assertTrue(Did not find + myName + in the stack + stack, found); -} +checkStack(myName, t); } /** @@ -79,36 +69,51 @@ } public static void testStackTraces() { -if (!GWT.isScript()) { - // StackTraceCreator.createStackTrace() is useless in hosted mode - return; -} - -// Since we're in web mode, we can find the name of this method's function -String myName = testStackTracesName(); - -StackTraceElement[] stack; +Throwable t; try { throw new RuntimeException(); -} catch (Throwable t) { - stack = t.getStackTrace(); +} catch (Throwable t2) { + t = t2; } -assertNotNull(stack); -assertTrue(stack.length 0); +String myName = null; +if (!GWT.isScript()) { + myName = testStackTraces; +} else { + myName = testStackTracesName(); +} + +checkStack(myName, t); + } + + private static void checkStack(String myName, Throwable t) { +assertNotNull(myName, myName); +assertNotNull(t, t); + +assertEquals(Needs a trim(), myName.trim(), myName); +assertFalse(function, myName.startsWith(function)); +assertFalse((, myName.contains(()); + +StackTraceElement[] stack = t.getStackTrace(); +assertNotNull(stack, stack); +assertTrue(stack.length, stack.length 0); boolean found = false; +StringBuilder observedStack = new StringBuilder(); for (int i = 0, j = stack.length; i j; i++) { StackTraceElement elt = stack[i]; String value = elt.getMethodName(); -
[gwt-contrib] [google-web-toolkit commit] r4830 - in trunk/dev/core: src/com/google/gwt/dev/resource/impl test/com/google/gwt/dev/resource/...
Author: amitman...@google.com Date: Fri Feb 20 15:14:45 2009 New Revision: 4830 Modified: trunk/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java trunk/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java Log: This patch fixes the caching logic so that Gwt no longer re-reads and re-processes all jars on the classpath on every refresh. Patch by: amitmanjhi Review by: jat (desk review) Modified: trunk/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java == --- trunk/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileClassPathEntry.java Fri Feb 20 15:14:45 2009 @@ -20,6 +20,7 @@ import java.io.File; import java.util.Enumeration; +import java.util.HashMap; import java.util.HashSet; import java.util.IdentityHashMap; import java.util.Map; @@ -52,11 +53,21 @@ TreeLogger.DEBUG, $0); } + private static class ZipFileSnapshot { +private final int prefixSetSize; +private final MapAbstractResource, PathPrefix cachedAnswers; + +ZipFileSnapshot(int prefixSetSize, +MapAbstractResource, PathPrefix cachedAnswers) { + this.prefixSetSize = prefixSetSize; + this.cachedAnswers = cachedAnswers; +} + } + private SetZipFileResource allZipFileResources; - private MapAbstractResource, PathPrefix cachedAnswers; + private final MapPathPrefixSet, ZipFileSnapshot cachedSnapshots = new HashMapPathPrefixSet, ZipFileSnapshot( + 2); // currently gwt has just 2 ResourceOracles. private String cachedLocation; - private PathPrefixSet lastPrefixSet; - private int lastPrefixSetSize; private final ZipFile zipFile; public ZipFileClassPathEntry(ZipFile zipFile) { @@ -74,13 +85,13 @@ allZipFileResources = buildIndex(logger); } -if (cachedAnswers == null || lastPrefixSet != pathPrefixSet -|| lastPrefixSetSize != pathPrefixSet.getSize()) { - cachedAnswers = computeApplicableResources(logger, pathPrefixSet); - lastPrefixSet = pathPrefixSet; - lastPrefixSetSize = pathPrefixSet.getSize(); +ZipFileSnapshot snapshot = cachedSnapshots.get(pathPrefixSet); +if (snapshot == null || snapshot.prefixSetSize != pathPrefixSet.getSize()) { + snapshot = new ZipFileSnapshot(pathPrefixSet.getSize(), + computeApplicableResources(logger, pathPrefixSet)); + cachedSnapshots.put(pathPrefixSet, snapshot); } -return cachedAnswers; +return snapshot.cachedAnswers; } @Override Modified: trunk/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java == --- trunk/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java (original) +++ trunk/dev/core/test/com/google/gwt/dev/resource/impl/ResourceOracleImplTest.java Fri Feb 20 15:14:45 2009 @@ -15,6 +15,10 @@ */ package com.google.gwt.dev.resource.impl; +import com.google.gwt.core.ext.TreeLogger; +import com.google.gwt.dev.resource.Resource; +import com.google.gwt.util.tools.Utility; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -28,10 +32,7 @@ import java.util.List; import java.util.Map; import java.util.Set; - -import com.google.gwt.core.ext.TreeLogger; -import com.google.gwt.dev.resource.Resource; -import com.google.gwt.util.tools.Utility; +import java.util.jar.JarFile; /** * Tests {...@link ResourceOracleImpl}. @@ -129,6 +130,37 @@ } return null; } + } + + public void testCachingOfJarResources() throws IOException, + URISyntaxException { +TreeLogger logger = createTestTreeLogger(); +ClassPathEntry cpe1jar = new ZipFileClassPathEntry(new JarFile( + findJarFile(com/google/gwt/dev/resource/impl/testdata/cpe1.jar))); + +// test basic caching +PathPrefixSet pps1 = new PathPrefixSet(); +pps1.add(new PathPrefix(com/google/gwt, null, false)); +MapAbstractResource, PathPrefix resourceMap1 = cpe1jar.findApplicableResources( +logger, pps1); +assertSame(resourceMap1, cpe1jar.findApplicableResources(logger, pps1)); + +// test that cache is invalidated if PathPrefixSet is modified. +pps1.add(new PathPrefix(com/google/gwt/user, null, false)); +MapAbstractResource, PathPrefix resourceMap2 = cpe1jar.findApplicableResources( +logger, pps1); +assertNotSame(resourceMap1, resourceMap2); + +PathPrefixSet pps2 = new PathPrefixSet(); +pps2.add(new PathPrefix(org/example/bar, null, false)); +MapAbstractResource, PathPrefix resourceMap3 = cpe1jar.findApplicableResources( +logger, pps2); +// check that the entry did go in the cache +assertSame(resourceMap3,
[gwt-contrib] [google-web-toolkit commit] r4851 - in trunk: . dev/core/src/com/google/gwt/core/ext dev/core/src/com/google/gwt/core/ext/soy...
Author: b...@google.com Date: Tue Feb 24 14:28:39 2009 New Revision: 4851 Removed: trunk/dev/core/super/com/google/gwt/core/client/SingleJsoImpl.java Modified: trunk/ (props changed) trunk/dev/core/src/com/google/gwt/core/ext/ServletContainer.java (props changed) trunk/dev/core/src/com/google/gwt/core/ext/ServletContainerLauncher.java (props changed) trunk/dev/core/src/com/google/gwt/core/ext/soyc/impl/SnippetIterator.java (props changed) trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java trunk/dev/core/src/com/google/gwt/dev/javac/JSORestrictionsChecker.java trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java trunk/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java trunk/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteSingleJsoImplDispatches.java (contents, props changed) trunk/dev/core/src/com/google/gwt/dev/shell/rewrite/WriteJsoImpl.java trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerDisableAggressiveOptimization.java (props changed) trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerEnableAssertions.java (props changed) trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java (props changed) trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirOptional.java (props changed) trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirRequired.java (props changed) trunk/dev/core/test/com/google/gwt/dev/javac/JSORestrictionsTest.java trunk/distro-source/core/src/doc/helpInfo/jsoRestrictions.html trunk/distro-source/linux/src/webAppCreator (props changed) trunk/distro-source/mac/src/webAppCreator (props changed) trunk/distro-source/windows/src/webAppCreator.cmd (props changed) trunk/eclipse/samples/Hello/Hello-gwtc.launch (props changed) trunk/samples/dynatable/war/DynaTable.css (props changed) trunk/samples/dynatable/war/DynaTable.html (props changed) trunk/samples/hello/war/Hello.html (props changed) trunk/samples/i18n/war/I18N.css (props changed) trunk/samples/i18n/war/I18N.html (props changed) trunk/samples/json/war/JSON.css (props changed) trunk/samples/json/war/JSON.html (props changed) trunk/samples/mail/war/Mail.css (props changed) trunk/samples/mail/war/Mail.html (props changed) trunk/samples/mail/war/gradient.gif (props changed) trunk/samples/mail/war/leftCorner.gif (props changed) trunk/samples/mail/war/rightCorner.gif (props changed) trunk/samples/showcase/war/Showcase.html (props changed) trunk/samples/simplerpc/war/SimpleRPC.css (props changed) trunk/samples/simplerpc/war/SimpleRPC.html (props changed) trunk/samples/simplexml/war/SimpleXML.css (props changed) trunk/samples/simplexml/war/SimpleXML.html (props changed) trunk/user/src/com/google/gwt/event/dom/client/HandlesAllFocusEvents.java (props changed) trunk/user/src/com/google/gwt/event/dom/client/HandlesAllKeyEvents.java (props changed) trunk/user/src/com/google/gwt/event/dom/client/HandlesAllMouseEvents.java (props changed) trunk/user/src/com/google/gwt/event/dom/client/KeyCodes.java (props changed) trunk/user/src/com/google/gwt/event/dom/client/PrivateMap.java (props changed) trunk/user/src/com/google/gwt/event/logical/shared/HasValueChangeHandlers.java (props changed) trunk/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java (props changed) trunk/user/src/com/google/gwt/event/logical/shared/ValueChangeHandler.java (props changed) trunk/user/src/com/google/gwt/event/shared/DefaultHandlerRegistration.java (props changed) trunk/user/src/com/google/gwt/event/shared/GwtEvent.java (props changed) trunk/user/src/com/google/gwt/event/shared/HandlerRegistration.java (props changed) trunk/user/src/com/google/gwt/user/client/ui/ListenerWrapper.java (props changed) trunk/user/src/com/google/gwt/user/tools/WebAppCreator.java (props changed) trunk/user/test/com/google/gwt/dev/jjs/test/SingleJsoImplTest.java trunk/user/test/com/google/gwt/event/dom/client/DomEventTest.java (props changed) trunk/user/test/com/google/gwt/event/logical/shared/LogicalEventsTest.java (props changed) Log: Remove the need for an explicit SingleJsoImpl annotation. The single-JSO-ness of interfaces will be automatically calculated. Hosted-mode bug fixes for SingleJsoImpl. Patch by: bobv Review by: spoon Modified: trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java == --- trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java (original) +++
[gwt-contrib] [google-web-toolkit commit] r4853 - releases/1.6/user/src/com/google/gwt/user/client/ui
Author: e...@google.com Date: Tue Feb 24 15:08:45 2009 New Revision: 4853 Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/ListBox.java Log: We deprecate ListBox's setMultipleSelect, fixing issue 249. Review by:rjrjr Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/ListBox.java == --- releases/1.6/user/src/com/google/gwt/user/client/ui/ListBox.java (original) +++ releases/1.6/user/src/com/google/gwt/user/client/ui/ListBox.javaTue Feb 24 15:08:45 2009 @@ -312,7 +312,9 @@ * fail on Internet Explorer 6.0./em * * @param multiple codetrue/code to allow multiple selections + * @deprecated use {...@link #ListBox(boolean) instead */ + @Deprecated public void setMultipleSelect(boolean multiple) { // TODO: we can remove the above doc admonition once we address issue 1007 getSelectElement().setMultiple(multiple); --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4870 - releases/1.6/user/src/com/google/gwt/dom/client
Author: j...@google.com Date: Wed Feb 25 12:30:46 2009 New Revision: 4870 Modified: releases/1.6/user/src/com/google/gwt/dom/client/DOMImplIE6.java Log: Merging tr...@c4859 into 1.6 release branch. Modified: releases/1.6/user/src/com/google/gwt/dom/client/DOMImplIE6.java == --- releases/1.6/user/src/com/google/gwt/dom/client/DOMImplIE6.java (original) +++ releases/1.6/user/src/com/google/gwt/dom/client/DOMImplIE6.java Wed Feb 25 12:30:46 2009 @@ -232,6 +232,10 @@ */ @SuppressWarnings(unused) private native double getZoomMultiple() /*-{ -return $doc.body.parentElement.offsetWidth / $doc.body.offsetWidth; +if ($doc.compatMode == 'CSS1Compat') { + return 1; +} else { + return $doc.body.parentElement.offsetWidth / $doc.body.offsetWidth; +} }-*/; } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4872 - releases/1.6
Author: j...@google.com Date: Wed Feb 25 12:34:28 2009 New Revision: 4872 Modified: releases/1.6/branch-info.txt Log: Updating branch-info.txt. Modified: releases/1.6/branch-info.txt == --- releases/1.6/branch-info.txt(original) +++ releases/1.6/branch-info.txtWed Feb 25 12:34:28 2009 @@ -7,6 +7,8 @@ Merges: /trunk revisions c3688,c3703,c3700,c3704,c3707,c3715,c3717,c3724,c3725 were merged (r3739) into this branch +/trunk revision c4859 was merged (r4870) into this branch +/trunk revision c4867 was merged (r4871) into this branch /releases/1.5/@r3630:3863 was merged (r3864) into this branch /releases/1.6/@r3739:3876 was merged (r3877) into trunk /releases/1.6/@r3878:3944 was merged (r3945) into trunk, skipping c3878 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4859 - trunk/user/src/com/google/gwt/dom/client
Author: jlaba...@google.com Date: Tue Feb 24 21:25:29 2009 New Revision: 4859 Modified: trunk/user/src/com/google/gwt/dom/client/DOMImplIE6.java Log: Fixed a bug in DOMImplIE.getAbsoluteLeft() where the wrong value can be returned in strict mode if the user sets a width on the body element. Patch by: jlabanca Review by: jgw Modified: trunk/user/src/com/google/gwt/dom/client/DOMImplIE6.java == --- trunk/user/src/com/google/gwt/dom/client/DOMImplIE6.java(original) +++ trunk/user/src/com/google/gwt/dom/client/DOMImplIE6.javaTue Feb 24 21:25:29 2009 @@ -232,6 +232,10 @@ */ @SuppressWarnings(unused) private native double getZoomMultiple() /*-{ -return $doc.body.parentElement.offsetWidth / $doc.body.offsetWidth; +if ($doc.compatMode == 'CSS1Compat') { + return 1; +} else { + return $doc.body.parentElement.offsetWidth / $doc.body.offsetWidth; +} }-*/; } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4867 - trunk/user/src/com/google/gwt/user/client/ui/impl
Author: j...@google.com Date: Wed Feb 25 09:37:22 2009 New Revision: 4867 Modified: trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java Log: Disables the popup scrollbar hack for FF3 and later on Mac OS X, where it is no longer necessary. Patch by: jgw Review by: jlabanca (Desk check) Modified: trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java == --- trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java (original) +++ trunk/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java Wed Feb 25 09:37:22 2009 @@ -48,12 +48,26 @@ /** * Cache the value to avoid repeated calls. */ - private static boolean isMac = isMac(); + private static boolean isFF2Mac = isFF2Mac(); - private static native boolean isMac() /*-{ -if (navigator.userAgent.indexOf(Macintosh) != -1) { - return true; -} + private static native boolean isFF2Mac() /*-{ +function makeVersion(result) { + return (parseInt(result[1]) * 1000) + parseInt(result[2]); +} + +var ua = navigator.userAgent; +if (ua.indexOf(Macintosh) != -1) { + // Version logic taken from UserAgent.gwt.xml. + var result = /rv:([0-9]+)\.([0-9]+)/.exec(ua); + if (result result.length == 3) { +// Gecko 1.8 and earlier had the scrollbar bug on OS X. +// (Firefox3 == Gecko 1.9) +if (makeVersion(result) = 1008) { + return true; +} + } +} + return false; }-*/; @@ -61,7 +75,7 @@ public Element createElement() { final Element outerElem = DOM.createDiv(); -if (isMac) { +if (isFF2Mac) { // To solve the scrollbar rendering problem on the Mac, we have to make // the PopupPanel a 'heavyweight' element by setting a style of // 'overflow:auto' on the outermost div. This ensures that all of the @@ -95,12 +109,12 @@ @Override public Element getContainerElement(Element outerElem) { -return isMac ? DOM.getFirstChild(outerElem) : outerElem; +return isFF2Mac ? DOM.getFirstChild(outerElem) : outerElem; } @Override public Element getStyleElement(Element outerElem) { -return isMac ? outerElem : super.getStyleElement(outerElem); +return isFF2Mac ? outerElem : super.getStyleElement(outerElem); } @Override --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4871 - releases/1.6/user/src/com/google/gwt/user/client/ui/impl
Author: j...@google.com Date: Wed Feb 25 12:32:54 2009 New Revision: 4871 Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java Log: Merging tr...@c4867 into the 1.6 release branch. Modified: releases/1.6/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java == --- releases/1.6/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java (original) +++ releases/1.6/user/src/com/google/gwt/user/client/ui/impl/PopupImplMozilla.java Wed Feb 25 12:32:54 2009 @@ -48,12 +48,26 @@ /** * Cache the value to avoid repeated calls. */ - private static boolean isMac = isMac(); + private static boolean isFF2Mac = isFF2Mac(); - private static native boolean isMac() /*-{ -if (navigator.userAgent.indexOf(Macintosh) != -1) { - return true; -} + private static native boolean isFF2Mac() /*-{ +function makeVersion(result) { + return (parseInt(result[1]) * 1000) + parseInt(result[2]); +} + +var ua = navigator.userAgent; +if (ua.indexOf(Macintosh) != -1) { + // Version logic taken from UserAgent.gwt.xml. + var result = /rv:([0-9]+)\.([0-9]+)/.exec(ua); + if (result result.length == 3) { +// Gecko 1.8 and earlier had the scrollbar bug on OS X. +// (Firefox3 == Gecko 1.9) +if (makeVersion(result) = 1008) { + return true; +} + } +} + return false; }-*/; @@ -61,7 +75,7 @@ public Element createElement() { final Element outerElem = DOM.createDiv(); -if (isMac) { +if (isFF2Mac) { // To solve the scrollbar rendering problem on the Mac, we have to make // the PopupPanel a 'heavyweight' element by setting a style of // 'overflow:auto' on the outermost div. This ensures that all of the @@ -95,12 +109,12 @@ @Override public Element getContainerElement(Element outerElem) { -return isMac ? DOM.getFirstChild(outerElem) : outerElem; +return isFF2Mac ? DOM.getFirstChild(outerElem) : outerElem; } @Override public Element getStyleElement(Element outerElem) { -return isMac ? outerElem : super.getStyleElement(outerElem); +return isFF2Mac ? outerElem : super.getStyleElement(outerElem); } @Override --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4866 - releases/1.6/dev/core/src/com/google/gwt/dev
Author: sco...@google.com Date: Wed Feb 25 08:58:45 2009 New Revision: 4866 Modified: releases/1.6/dev/core/src/com/google/gwt/dev/HostedMode.java Log: Correct the help text for HostdMode -server argument. Modified: releases/1.6/dev/core/src/com/google/gwt/dev/HostedMode.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/HostedMode.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/HostedMode.javaWed Feb 25 08:58:45 2009 @@ -69,7 +69,7 @@ @Override public String getPurpose() { - return Prevents the embedded Tomcat server from running, even if a port is specified; + return Specify a different embedded web server to run (must implement ServletContainerLauncher); } @Override --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4772 - in releases/1.6: dev/core/src/com/google/gwt/dev dev/core/src/com/google/gwt/dev/util dev...
Author: sco...@google.com Date: Tue Feb 17 16:26:01 2009 New Revision: 4772 Added: releases/1.6/dev/core/src/com/google/gwt/dev/ServletValidator.java (contents, props changed) releases/1.6/dev/core/test/com/google/gwt/dev/ServletValidatorTest.java (contents, props changed) releases/1.6/dev/core/test/com/google/gwt/dev/invalid.web.xml (contents, props changed) releases/1.6/dev/core/test/com/google/gwt/dev/valid.web.xml (contents, props changed) releases/1.6/distro-source/core/src/doc/helpInfo/servletMappings.html (contents, props changed) Modified: releases/1.6/dev/core/src/com/google/gwt/dev/HostedMode.java releases/1.6/dev/core/src/com/google/gwt/dev/util/UnitTestTreeLogger.java Log: Validate servlet tags in GWT modules against the actual web.xml being used. Review by: bruce (TBR) Modified: releases/1.6/dev/core/src/com/google/gwt/dev/HostedMode.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/HostedMode.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/HostedMode.javaTue Feb 17 16:26:01 2009 @@ -25,6 +25,7 @@ import com.google.gwt.dev.cfg.ModuleDef; import com.google.gwt.dev.shell.ArtifactAcceptor; import com.google.gwt.dev.shell.jetty.JettyLauncher; +import com.google.gwt.dev.util.InstalledHelpInfo; import com.google.gwt.dev.util.Util; import com.google.gwt.dev.util.arg.ArgHandlerExtraDir; import com.google.gwt.dev.util.arg.ArgHandlerLocalWorkers; @@ -337,20 +338,18 @@ } } +ServletValidator servletValidator = null; +File webXml = new File(options.getWarDir(), WEB-INF/web.xml); +if (webXml.exists()) { + servletValidator = ServletValidator.create(getTopLogger(), webXml); +} + for (String moduleName : options.getModuleNames()) { TreeLogger loadLogger = getTopLogger().branch(TreeLogger.DEBUG, - Bootstrap link for command-line module + moduleName); + Bootstrap link for command-line module ' + moduleName + '); try { ModuleDef module = loadModule(loadLogger, moduleName, false); - -// TODO: Validate servlet tags. -String[] servletPaths = module.getServletPaths(); -if (servletPaths.length 0) { - loadLogger.log(TreeLogger.WARN, - Ignoring legacy servlet tag(s) in module ' + moduleName - + '; add servlet tags to your web.xml instead); -} - +validateServletTags(loadLogger, servletValidator, module, webXml); link(loadLogger, module); } catch (UnableToCompleteException e) { // Already logged. @@ -488,5 +487,29 @@ newlyGeneratedArtifacts); linkerStack.produceOutputDirectory(linkLogger, artifacts, moduleOutDir, moduleExtraDir); + } + + private void validateServletTags(TreeLogger logger, + ServletValidator servletValidator, ModuleDef module, File webXml) { +TreeLogger servletLogger = logger.branch(TreeLogger.DEBUG, +Validating servlet tags for module ' + module.getName() + ', +null, new InstalledHelpInfo(servletMappings.html)); +String[] servletPaths = module.getServletPaths(); +if (servletValidator == null servletPaths.length 0) { + servletLogger.log( + TreeLogger.WARN, + Module declares + + servletPaths.length + + servlet declaration(s), but a valid 'web.xml' was not found at ' + + webXml.getAbsolutePath() + '); +} else { + for (String servletPath : servletPaths) { +String servletClass = module.findServletForPath(servletPath); +assert (servletClass != null); +// Prefix module name to convert module mapping to global mapping. +servletPath = / + module.getName() + servletPath; +servletValidator.validate(servletLogger, servletClass, servletPath); + } +} } } Added: releases/1.6/dev/core/src/com/google/gwt/dev/ServletValidator.java == --- (empty file) +++ releases/1.6/dev/core/src/com/google/gwt/dev/ServletValidator.java Tue Feb 17 16:26:01 2009 @@ -0,0 +1,176 @@ +/* + * 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; + +import com.google.gwt.core.ext.TreeLogger; +import
[gwt-contrib] [google-web-toolkit commit] r4773 - releases/1.6/dev/core/src/com/google/gwt/dev/javac
Author: sco...@google.com Date: Tue Feb 17 16:44:29 2009 New Revision: 4773 Modified: releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java Log: Added a note regarding the unnecessary cast. Modified: releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java Tue Feb 17 16:44:29 2009 @@ -209,6 +209,7 @@ ProblemReferenceBinding prb = (ProblemReferenceBinding) binding; if (prb.problemId() == ProblemReasons.NotVisible) { // It's just a visibility problem, so try drilling down manually + // UNNECESSARY CAST: javac is barfing without it for some reason. ReferenceBinding drilling = (ReferenceBinding) prb.closestMatch(); for (int i = prb.compoundName.length; i compoundName.length; i++) { drilling = drilling.getMemberType(compoundName[i]); --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4873 - trunk/dev/core/src/com/google/gwt/dev/js/ast
Author: amitman...@google.com Date: Wed Feb 25 14:45:55 2009 New Revision: 4873 Modified: trunk/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java Log: This patch adds identifiers that cause loading of the java plugin in the browser to the blacklist of identifiers that must not be used in the generated javascript Patch by: amitmanjhi Review by: jgw (desk review) Modified: trunk/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java == --- trunk/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/js/ast/JsRootScope.java Wed Feb 25 14:45:55 2009 @@ -102,6 +102,13 @@ // Functions commonly defined on Object toString, getClass, constructor, prototype, +/* + * These keywords trigger the loading of the java-plugin. For the + * next-generation plugin, this results in starting a new Java process. + */ +java, Packages, netscape, sun, JavaObject, JavaClass, +JavaArray, JavaMember, + // GWT-defined identifiers $wnd, $doc, $moduleName, $moduleBase, $gwt_version, --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4876 - releases/1.6/user/test/com/google/gwt/i18n/client
Author: j...@google.com Date: Wed Feb 25 16:40:45 2009 New Revision: 4876 Modified: releases/1.6/user/test/com/google/gwt/i18n/client/DateTimeFormat_de_Test.java Log: Fix test based on new CLDR data. Patch by: jat Modified: releases/1.6/user/test/com/google/gwt/i18n/client/DateTimeFormat_de_Test.java == --- releases/1.6/user/test/com/google/gwt/i18n/client/DateTimeFormat_de_Test.java (original) +++ releases/1.6/user/test/com/google/gwt/i18n/client/DateTimeFormat_de_Test.java Wed Feb 25 16:40:45 2009 @@ -26,6 +26,7 @@ @SuppressWarnings(deprecation) public class DateTimeFormat_de_Test extends GWTTestCase { + @Override public String getModuleName() { return com.google.gwt.i18n.I18NTest_de; } @@ -38,7 +39,7 @@ public void test_EEEMMMddyy() { Date date = new Date(2006 - 1900, 6, 27, 13, 10, 10); -assertEquals(Do, Jul 27, 06, +assertEquals(Do., Jul 27, 06, DateTimeFormat.getFormat(EEE, MMM d, yy).format(date)); } --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4874 - in trunk/dev/core/src/com/google/gwt: core/ext/linker core/ext/linker/impl dev
Author: sp...@google.com Date: Wed Feb 25 15:59:54 2009 New Revision: 4874 Modified: trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java trunk/dev/core/src/com/google/gwt/dev/Compiler.java trunk/dev/core/src/com/google/gwt/dev/GWTCompiler.java trunk/dev/core/src/com/google/gwt/dev/Link.java Log: Discard the serialized AST before linking, to save memory. Also, tweaks CompilationResult.compareToComparable() to not read in the JavaScript files from disk, to speed things up when memory is tight. Review by: bobv Modified: trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java == --- trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java (original) +++ trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java Wed Feb 25 15:59:54 2009 @@ -35,11 +35,9 @@ * the code that should be run when the application starts up. The remaining * elements are loaded via * {...@link com.google.gwt.core.client.GWT#runAsync(com.google.gwt.core.client.RunAsyncCallback) - * GWT.runAsync}. The linker should provide a function named - * code__gwtStartLoadingFragment/code that can takes an integer as - * argument and loads that specified code segment. To see how this function is - * used, see {...@link com.google.gwt.core.client.AsyncFragmentLoader - * AsyncFragmentLoader}. + * GWT.runAsync}. See {...@link com.google.gwt.core.client.AsyncFragmentLoader + * AsyncFragmentLoader} for details on the necessary linker support for + * runAsync. */ public abstract String[] getJavaScript(); @@ -93,22 +91,11 @@ @Override protected final int compareToComparableArtifact(CompilationResult o) { -String[] js = getJavaScript(); -String[] otherJs = o.getJavaScript(); -if (js.length != otherJs.length) { - return js.length - otherJs.length; -} -for (int i = 0; i js.length; i++) { - int diff = js[i].compareTo(otherJs[i]); - if (diff != 0) { -return diff; - } -} -return 0; +return getStrongName().compareTo(o.getStrongName()); } @Override protected final ClassCompilationResult getComparableArtifactType() { return CompilationResult.class; } -} \ No newline at end of file +} Modified: trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java == --- trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java (original) +++ trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java Wed Feb 25 15:59:54 2009 @@ -273,8 +273,7 @@ String strongName = Util.computeStrongName(Util.getBytes(permutationResult.getJs())); StandardCompilationResult result = resultsByStrongName.get(strongName); if (result == null) { - result = new StandardCompilationResult(permutationResult.getJs(), - strongName, resultFile); + result = new StandardCompilationResult(null, strongName, resultFile); resultsByStrongName.put(result.getStrongName(), result); artifacts.add(result); Modified: trunk/dev/core/src/com/google/gwt/dev/Compiler.java == --- trunk/dev/core/src/com/google/gwt/dev/Compiler.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/Compiler.java Wed Feb 25 15:59:54 2009 @@ -17,15 +17,17 @@ import com.google.gwt.core.ext.TreeLogger; import com.google.gwt.core.ext.UnableToCompleteException; +import com.google.gwt.core.ext.linker.ArtifactSet; import com.google.gwt.dev.CompileTaskRunner.CompileTask; import com.google.gwt.dev.Link.LinkOptionsImpl; import com.google.gwt.dev.Precompile.PrecompileOptionsImpl; import com.google.gwt.dev.cfg.ModuleDef; import com.google.gwt.dev.cfg.ModuleDefLoader; -import com.google.gwt.dev.util.FileBackedObject; +import com.google.gwt.dev.jjs.JJSOptions; import com.google.gwt.dev.shell.CheckForUpdates; import com.google.gwt.dev.shell.PlatformSpecific; import com.google.gwt.dev.shell.CheckForUpdates.UpdateResult; +import com.google.gwt.dev.util.FileBackedObject; import com.google.gwt.dev.util.PerfLogger; import com.google.gwt.dev.util.Util; import com.google.gwt.dev.util.arg.ArgHandlerExtraDir; @@ -111,7 +113,7 @@ public void setOutDir(File outDir) { linkOptions.setOutDir(outDir); } - + public void setWarDir(File outDir) { linkOptions.setWarDir(outDir); } @@ -130,8 +132,8 @@ public boolean run(TreeLogger logger) throws UnableToCompleteException { FutureTaskUpdateResult updater = null; if (!options.isUpdateCheckDisabled()) { -
[gwt-contrib] [google-web-toolkit commit] r4877 - in trunk: dev/core/src/com/google/gwt/dev/jdt user/test/com/google/gwt/dev/jjs/test user/...
Author: b...@google.com Date: Wed Feb 25 17:31:39 2009 New Revision: 4877 Added: trunk/user/test/com/google/gwt/dev/jjs/test/jsoimpls/ trunk/user/test/com/google/gwt/dev/jjs/test/jsoimpls/UnreferencedImplOfJsoInterface.java (contents, props changed) trunk/user/test/com/google/gwt/dev/jjs/test/jsointfs/ trunk/user/test/com/google/gwt/dev/jjs/test/jsointfs/JsoInterfaceWithUnreferencedImpl.java (contents, props changed) Modified: trunk/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java trunk/user/test/com/google/gwt/dev/jjs/test/SingleJsoImplTest.java Log: Fix web-mode compilation of SingleJsoImpl types when the implementing JSO type is never explicitly referenced by client code. Patch by: bobv Review by: scottb Modified: trunk/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java == --- trunk/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/jdt/WebModeCompilerFrontEnd.java Wed Feb 25 17:31:39 2009 @@ -17,7 +17,10 @@ import com.google.gwt.core.ext.TreeLogger; import com.google.gwt.core.ext.UnableToCompleteException; +import com.google.gwt.core.ext.typeinfo.JClassType; +import com.google.gwt.core.ext.typeinfo.TypeOracle; import com.google.gwt.dev.javac.CompilationState; +import com.google.gwt.dev.javac.CompilationUnit; import com.google.gwt.dev.javac.CompiledClass; import com.google.gwt.dev.javac.JdtCompiler.CompilationUnitAdapter; import com.google.gwt.dev.jdt.FindDeferredBindingSitesVisitor.MessageSendSite; @@ -32,7 +35,9 @@ import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; +import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; @@ -59,28 +64,62 @@ this.fragmentLoaderCreator = fragmentLoaderCreator; } + /** + * Build the initial set of compilation units. + */ public CompilationUnitDeclaration[] getCompilationUnitDeclarations( TreeLogger logger, String[] seedTypeNames) throws UnableToCompleteException { -// Build the initial set of compilation units. +TypeOracle oracle = compilationState.getTypeOracle(); +SetJClassType intfTypes = oracle.getSingleJsoImplInterfaces(); MapString, CompiledClass classMapBySource = compilationState.getClassFileMapBySource(); -ICompilationUnit[] icus = new ICompilationUnit[seedTypeNames.length]; -for (int i = 0; i seedTypeNames.length; i++) { - String seedTypeName = seedTypeNames[i]; - CompiledClass compiledClass = classMapBySource.get(seedTypeName); - if (compiledClass == null) { -logger.log(TreeLogger.ERROR, -Unable to find compilation unit for type ' + seedTypeName + '); -throw new UnableToCompleteException(); + +/* + * The alreadyAdded set prevents duplicate CompilationUnits from being added + * to the icu list in the case of multiple JSO implementations as inner + * classes in the same top-level class or seed classes as SingleJsoImpls + * (e.g. JSO itself as the SingleImpl for all tag interfaces). + */ +SetCompilationUnit alreadyAdded = new HashSetCompilationUnit(); + +ListICompilationUnit icus = new ArrayListICompilationUnit( +seedTypeNames.length + intfTypes.size()); + +for (String seedTypeName : seedTypeNames) { + CompilationUnit unit = getUnitForType(logger, classMapBySource, + seedTypeName); + + if (alreadyAdded.add(unit)) { +icus.add(new CompilationUnitAdapter(unit)); + } else { +logger.log(TreeLogger.WARN, Duplicate compilation unit ' ++ unit.getDisplayLocation() + 'in seed types); + } +} + +/* + * Add all SingleJsoImpl types that we know about. It's likely that the + * concrete types are never explicitly referenced from the seed types. + */ +for (JClassType intf : intfTypes) { + String implName = oracle.getSingleJsoImpl(intf).getQualifiedSourceName(); + CompilationUnit unit = getUnitForType(logger, classMapBySource, implName); + + if (alreadyAdded.add(unit)) { +icus.add(new CompilationUnitAdapter(unit)); +logger.log(TreeLogger.SPAM, Forced compilation of unit ' ++ unit.getDisplayLocation() ++ ' becasue it contains a SingleJsoImpl type); } - icus[i] = new CompilationUnitAdapter(compiledClass.getUnit()); } -// Compile, which will pull in everything else via -// doFindAdditionalTypesUsingMagic() -// -CompilationUnitDeclaration[] cuds = compile(logger, icus); +/* + * Compile, which will pull in everything else via + * doFindAdditionalTypesUsingMagic() + */ +CompilationUnitDeclaration[] cuds = compile(logger, +
[gwt-contrib] [google-web-toolkit commit] r4775 - in releases/1.6/dev/core/src/com/google/gwt/dev: . shell/jetty
Author: sco...@google.com Date: Tue Feb 17 17:26:50 2009 New Revision: 4775 Modified: releases/1.6/dev/core/src/com/google/gwt/dev/ServletValidator.java releases/1.6/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java Log: Disable XML validation in internal jetty. Modified: releases/1.6/dev/core/src/com/google/gwt/dev/ServletValidator.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/ServletValidator.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/ServletValidator.java Tue Feb 17 17:26:50 2009 @@ -16,7 +16,6 @@ package com.google.gwt.dev; import com.google.gwt.core.ext.TreeLogger; -import com.google.gwt.dev.util.InstalledHelpInfo; import org.mortbay.jetty.servlet.ServletHandler; import org.mortbay.jetty.servlet.ServletHolder; @@ -51,7 +50,10 @@ public static ServletValidator create(TreeLogger logger, URL webXmlUrl) { String webXmlUrlString = webXmlUrl.toExternalForm(); +String oldProp = System.getProperty(org.mortbay.xml.XmlParser.Validating, +false); try { + System.setProperty(org.mortbay.xml.XmlParser.Validating, false); WebXmlConfiguration wxc = new WebXmlConfiguration(); ServletHandler myServletHandler = new ServletHandler(); wxc.setWebAppContext(new WebAppContext(null, null, myServletHandler, null)); @@ -79,14 +81,9 @@ logger.log(TreeLogger.WARN, Unable to process ' + webXmlUrlString + ' for servlet validation, e); return null; +} finally { + System.setProperty(org.mortbay.xml.XmlParser.Validating, oldProp); } - } - - public static TreeLogger createServletValidatorBranch(TreeLogger logger, - String moduleName) { -return logger.branch(TreeLogger.DEBUG, -Validating servlet tags for module ' + moduleName + ', null, -new InstalledHelpInfo(servletMappings.html)); } static String generateMissingMappingMessage(String servletClass, Modified: releases/1.6/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java Tue Feb 17 17:26:50 2009 @@ -263,6 +263,9 @@ } } +// Turn off XML validation. +System.setProperty(org.mortbay.xml.XmlParser.Validating, false); + SelectChannelConnector connector = new SelectChannelConnector(); connector.setPort(port); --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4774 - releases/1.6/samples/dynatable/src/com/google/gwt/sample/dynatable
Author: sco...@google.com Date: Tue Feb 17 17:26:23 2009 New Revision: 4774 Modified: releases/1.6/samples/dynatable/src/com/google/gwt/sample/dynatable/DynaTable.gwt.xml Log: Re-enable servlet tag in DynaTable now that we validate. Modified: releases/1.6/samples/dynatable/src/com/google/gwt/sample/dynatable/DynaTable.gwt.xml == --- releases/1.6/samples/dynatable/src/com/google/gwt/sample/dynatable/DynaTable.gwt.xml (original) +++ releases/1.6/samples/dynatable/src/com/google/gwt/sample/dynatable/DynaTable.gwt.xml Tue Feb 17 17:26:23 2009 @@ -15,8 +15,5 @@ module rename-to=dynatable inherits name='com.google.gwt.user.User' / entry-point class='com.google.gwt.sample.dynatable.client.DynaTable' / - !-- - Re-enable this when we have web.xml validation. - servlet path='/calendar' class='com.google.gwt.sample.dynatable.server.SchoolCalendarServiceImpl'/ - -- + servlet path='/calendar' class='com.google.gwt.sample.dynatable.server.SchoolCalendarServiceImpl'/ /module --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r4779 - in trunk/user: src/com/google/gwt/http src/com/google/gwt/http/client src/com/google/gwt/...
Author: j...@google.com Date: Wed Feb 18 05:39:02 2009 New Revision: 4779 Added: trunk/user/src/com/google/gwt/xhr/ trunk/user/src/com/google/gwt/xhr/XMLHttpRequest.gwt.xml trunk/user/src/com/google/gwt/xhr/client/ trunk/user/src/com/google/gwt/xhr/client/ReadyStateChangeHandler.java trunk/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java trunk/user/test/com/google/gwt/http/client/HTTPRequestTest.java Removed: trunk/user/src/com/google/gwt/http/client/XMLHTTPRequest.java trunk/user/src/com/google/gwt/user/client/impl/HTTPRequestImplIE6.java Modified: trunk/user/src/com/google/gwt/http/HTTP.gwt.xml trunk/user/src/com/google/gwt/http/client/Request.java trunk/user/src/com/google/gwt/http/client/RequestBuilder.java trunk/user/src/com/google/gwt/http/client/RequestCallback.java trunk/user/src/com/google/gwt/user/HTTPRequest.gwt.xml trunk/user/src/com/google/gwt/user/client/HTTPRequest.java trunk/user/test/com/google/gwt/http/HTTPSuite.java trunk/user/test/com/google/gwt/http/client/RequestBuilderTest.java trunk/user/test/com/google/gwt/http/client/RequestTest.java trunk/user/test/com/google/gwt/http/server/RequestBuilderTestServlet.java Log: Adds a native XMLHttpRequest implementation, updates RequestBuilder to use it, and removes the long-deprecated XMLHTTPRequest object from the User module. This object uses no deferred-binding and is intended to be suitable for use in Core. Patch by: jgw Review by: spoon Modified: trunk/user/src/com/google/gwt/http/HTTP.gwt.xml == --- trunk/user/src/com/google/gwt/http/HTTP.gwt.xml (original) +++ trunk/user/src/com/google/gwt/http/HTTP.gwt.xml Wed Feb 18 05:39:02 2009 @@ -18,5 +18,10 @@ !-- package must inherit this module. -- !-- -- module - inherits name=com.google.gwt.core.Core/ + inherits name=com.google.gwt.core.Core/ + inherits name=com.google.gwt.xhr.XMLHttpRequest/ + + !-- Inheriting User module for Window and Timer. These should be factored +out of User soon. -- + inherits name=com.google.gwt.user.User/ /module Modified: trunk/user/src/com/google/gwt/http/client/Request.java == --- trunk/user/src/com/google/gwt/http/client/Request.java (original) +++ trunk/user/src/com/google/gwt/http/client/Request.java Wed Feb 18 05:39:02 2009 @@ -16,22 +16,23 @@ package com.google.gwt.http.client; import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; import com.google.gwt.user.client.Timer; +import com.google.gwt.xhr.client.XMLHttpRequest; /** * An HTTP request that is waiting for a response. Requests can be queried for * their pending status or they can be canceled. * - * h3Required Module/h3 - * Modules that use this class should inherit + * h3Required Module/h3 Modules that use this class should inherit * codecom.google.gwt.http.HTTP/code. * - * {...@gwt.include com/google/gwt/examples/http/InheritsExample.gwt.xml} + * {...@gwt.include + * com/google/gwt/examples/http/InheritsExample.gwt.xml} * */ public class Request { + /** * Creates a {...@link Response} instance for the given JavaScript XmlHttpRequest * object. @@ -39,45 +40,98 @@ * @param xmlHttpRequest xmlHttpRequest object for which we need a response * @return a {...@link Response} object instance */ - private static Response createResponse(final JavaScriptObject xmlHttpRequest) { -assert (XMLHTTPRequest.isResponseReady(xmlHttpRequest)); + private static Response createResponse(final XMLHttpRequest xmlHttpRequest) { +assert (isResponseReady(xmlHttpRequest)); Response response = new Response() { @Override public String getHeader(String header) { StringValidator.throwIfEmptyOrNull(header, header); -return XMLHTTPRequest.getResponseHeader(xmlHttpRequest, header); +return xmlHttpRequest.getResponseHeader(header); } @Override public Header[] getHeaders() { -return XMLHTTPRequest.getHeaders(xmlHttpRequest); +return Request.getHeaders(xmlHttpRequest); } @Override public String getHeadersAsString() { -return XMLHTTPRequest.getAllResponseHeaders(xmlHttpRequest); +return xmlHttpRequest.getAllResponseHeaders(); } @Override public int getStatusCode() { -return XMLHTTPRequest.getStatusCode(xmlHttpRequest); +return xmlHttpRequest.getStatus(); } @Override public String getStatusText() { -return
[gwt-contrib] [google-web-toolkit commit] r4782 - in releases/1.6/dev/core: src/com/google/gwt/dev/javac test/com/google/gwt/dev/javac
Author: sco...@google.com Date: Wed Feb 18 09:58:34 2009 New Revision: 4782 Modified: releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java releases/1.6/dev/core/test/com/google/gwt/dev/javac/JsniCheckerTest.java Log: Cleanup of JsniChecker per spoon suggestions. Suggested by: spoon Review by: spoon (TBR) Modified: releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java Wed Feb 18 09:58:34 2009 @@ -36,7 +36,6 @@ import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding; import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; -import org.eclipse.jdt.internal.compiler.lookup.TagBits; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeIds; import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; @@ -140,27 +139,28 @@ for (String jsniRefString : sloppyRefsVisitor.getJsniRefs()) { JsniRef jsniRef = JsniRef.parse(jsniRefString); if (jsniRef != null) { - SetString refErrors = new LinkedHashSetString(); ReferenceBinding clazz = findClass(jsniRef); - if (clazz != null) { -if (clazz.isAnonymousType()) { - GWTProblem.recordInCud( - ProblemSeverities.Warning, - meth, - cud, - Referencing class ' + jsniRef.className() - + : JSNI references to anonymous classes are deprecated, - null); + if (looksLikeAnonymousClass(jsniRef) + || (clazz != null clazz.isAnonymousType())) { +GWTProblem.recordInCud(ProblemSeverities.Warning, meth, cud, +Referencing class ' + jsniRef.className() ++ : JSNI references to anonymous classes are deprecated, +null); + } else if (clazz != null) { +SetString refErrors = new LinkedHashSetString(); +if (jsniRef.isMethod()) { + checkMethodRef(clazz, jsniRef, refErrors); } else { - if (jsniRef.isMethod()) { -checkMethodRef(clazz, jsniRef, refErrors); - } else { -checkFieldRef(clazz, jsniRef, refErrors); - } - if (!refErrors.isEmpty()) { -errors.put(jsniRefString, refErrors); - } + checkFieldRef(clazz, jsniRef, refErrors); } +if (!refErrors.isEmpty()) { + errors.put(jsniRefString, refErrors); +} + } else { +GWTProblem.recordInCud(ProblemSeverities.Warning, meth, cud, +Referencing class ' + jsniRef.className() ++ : unable to resolve class, expect subsequent failures, +null); } } } @@ -200,16 +200,14 @@ } private ReferenceBinding findClass(JsniRef jsniRef) { - String className = jsniRef.className().replace('$', '.'); - char[][] compoundName = CharOperation.splitOn('.', - className.toCharArray()); + char[][] compoundName = getCompoundName(jsniRef); TypeBinding binding = cud.scope.getType(compoundName, compoundName.length); if (binding instanceof ProblemReferenceBinding) { ProblemReferenceBinding prb = (ProblemReferenceBinding) binding; if (prb.problemId() == ProblemReasons.NotVisible) { // It's just a visibility problem, so try drilling down manually - ReferenceBinding drilling = prb.closestReferenceMatch(); + ReferenceBinding drilling = prb.closestReferenceMatch(); for (int i = prb.compoundName.length; i compoundName.length; i++) { drilling = drilling.getMemberType(compoundName[i]); } @@ -221,19 +219,16 @@ !(binding instanceof ProblemReferenceBinding)) { return (ReferenceBinding) binding; } - // See if it looks like an anonymous inner class, we can't look those up. - for (char[] part : compoundName) { -if (Character.isDigit(part[0])) { - return new ReferenceBinding() { -{ - tagBits = TagBits.IsAnonymousType; -} - }; -} - } return null; } +private char[][] getCompoundName(JsniRef jsniRef) { + String className = jsniRef.className().replace('$', '.'); + char[][] compoundName = CharOperation.splitOn('.', + className.toCharArray()); + return compoundName; +} + private FieldBinding getField(ReferenceBinding clazz, JsniRef jsniRef) {
[gwt-contrib] [google-web-toolkit commit] r4778 - in releases/1.6: dev/core/src/com/google/gwt/dev/javac eclipse/dev/linux eclipse/dev/mac ...
Author: sco...@google.com Date: Tue Feb 17 19:41:31 2009 New Revision: 4778 Modified: releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java releases/1.6/eclipse/dev/linux/.classpath releases/1.6/eclipse/dev/mac/.classpath releases/1.6/eclipse/dev/windows/.classpath Log: Updated gwt-dev Eclipse projects to use updated JDT. Updated weird cast case. Modified: releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java == --- releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/javac/JsniChecker.java Tue Feb 17 19:41:31 2009 @@ -209,8 +209,7 @@ ProblemReferenceBinding prb = (ProblemReferenceBinding) binding; if (prb.problemId() == ProblemReasons.NotVisible) { // It's just a visibility problem, so try drilling down manually - // UNNECESSARY CAST: javac is barfing without it for some reason. - ReferenceBinding drilling = (ReferenceBinding) prb.closestMatch(); + ReferenceBinding drilling = prb.closestReferenceMatch(); for (int i = prb.compoundName.length; i compoundName.length; i++) { drilling = drilling.getMemberType(compoundName[i]); } Modified: releases/1.6/eclipse/dev/linux/.classpath == --- releases/1.6/eclipse/dev/linux/.classpath (original) +++ releases/1.6/eclipse/dev/linux/.classpath Tue Feb 17 19:41:31 2009 @@ -8,7 +8,7 @@ classpathentry kind=var path=GWT_TOOLS/lib/eclipse/org.eclipse.swt.gtk-linux-3.2.1.jar sourcepath=/GWT_TOOLS/lib/eclipse/org.eclipse.swt.gtk-linux-3.2.1.src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/apache/ant-1.6.5.jar sourcepath=/GWT_TOOLS/lib/apache/ant-1.6.5-src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/apache/tapestry-util-text-4.0.2.jar sourcepath=/GWT_TOOLS/lib/apache/tapestry-util-text-4.0.2-src.zip/ - classpathentry kind=var path=GWT_TOOLS/lib/eclipse/jdt-3.3.1.jar sourcepath=/GWT_TOOLS/lib/eclipse/jdt-3.3.1-src.zip/ + classpathentry kind=var path=GWT_TOOLS/lib/eclipse/jdt-3.4.2.jar sourcepath=/GWT_TOOLS/lib/eclipse/jdt-3.4.2-src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/jetty/jetty-6.1.11.jar sourcepath=/GWT_TOOLS/lib/jetty/jetty-6.1.11-src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/junit/junit-3.8.1.jar sourcepath=/GWT_TOOLS/lib/junit/junit-3.8.1-src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/tomcat/ant-launcher-1.6.5.jar/ Modified: releases/1.6/eclipse/dev/mac/.classpath == --- releases/1.6/eclipse/dev/mac/.classpath (original) +++ releases/1.6/eclipse/dev/mac/.classpath Tue Feb 17 19:41:31 2009 @@ -8,7 +8,7 @@ classpathentry kind=var path=GWT_TOOLS/lib/eclipse/org.eclipse.swt.carbon-macosx-3.2.1.jar sourcepath=/GWT_TOOLS/lib/eclipse/org.eclipse.swt.carbon-macosx-3.2.1.src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/apache/ant-1.6.5.jar sourcepath=/GWT_TOOLS/lib/apache/ant-1.6.5-src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/apache/tapestry-util-text-4.0.2.jar sourcepath=/GWT_TOOLS/lib/apache/tapestry-util-text-4.0.2-src.zip/ - classpathentry kind=var path=GWT_TOOLS/lib/eclipse/jdt-3.3.1.jar sourcepath=/GWT_TOOLS/lib/eclipse/jdt-3.3.1-src.zip/ + classpathentry kind=var path=GWT_TOOLS/lib/eclipse/jdt-3.4.2.jar sourcepath=/GWT_TOOLS/lib/eclipse/jdt-3.4.2-src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/jetty/jetty-6.1.11.jar sourcepath=/GWT_TOOLS/lib/jetty/jetty-6.1.11-src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/junit/junit-3.8.1.jar sourcepath=/GWT_TOOLS/lib/junit/junit-3.8.1-src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/tomcat/ant-launcher-1.6.5.jar/ Modified: releases/1.6/eclipse/dev/windows/.classpath == --- releases/1.6/eclipse/dev/windows/.classpath (original) +++ releases/1.6/eclipse/dev/windows/.classpath Tue Feb 17 19:41:31 2009 @@ -8,7 +8,7 @@ classpathentry kind=var path=GWT_TOOLS/lib/eclipse/org.eclipse.swt.win32-win32-3.2.1.jar sourcepath=/GWT_TOOLS/lib/eclipse/org.eclipse.swt.win32-win32-3.2.1.src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/apache/ant-1.6.5.jar sourcepath=/GWT_TOOLS/lib/apache/ant-1.6.5-src.zip/ classpathentry kind=var path=GWT_TOOLS/lib/apache/tapestry-util-text-4.0.2.jar sourcepath=/GWT_TOOLS/lib/apache/tapestry-util-text-4.0.2-src.zip/ - classpathentry kind=var path=GWT_TOOLS/lib/eclipse/jdt-3.3.1.jar sourcepath=/GWT_TOOLS/lib/eclipse/jdt-3.3.1-src.zip/ + classpathentry kind=var path=GWT_TOOLS/lib/eclipse/jdt-3.4.2.jar
[gwt-contrib] [google-web-toolkit commit] r4899 - trunk/user/src/com/google/gwt/user/client/rpc/impl
Author: fabb...@google.com Date: Fri Feb 27 18:26:56 2009 New Revision: 4899 Modified: trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java Log: Partial rollback of c4888: we shouldn't, but have some users depending on the implementation class RemoteServiceProxy. The change in ProxyCreator remains. Review by: bruce Modified: trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java == --- trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java (original) +++ trunk/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java Fri Feb 27 18:26:56 2009 @@ -79,6 +79,10 @@ return requestId++; } + protected static int getRequestId() { +return requestId; + } + /** * Return codetrue/code if the encoded response contains a value * returned by the method invocation. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---