-
+
@@ -124,7 +124,7 @@
-
+
diff --git a/eclipse/dev/.classpath b/eclipse/dev/.classpath
index ac771cbca58..a84d801f71e 100644
--- a/eclipse/dev/.classpath
+++ b/eclipse/dev/.classpath
@@ -21,7 +21,7 @@
-
+
diff --git a/eclipse/dev/codeserver/.classpath b/eclipse/dev/codeserver/.classpath
index 88a6968b93b..bc64bf5c128 100644
--- a/eclipse/dev/codeserver/.classpath
+++ b/eclipse/dev/codeserver/.classpath
@@ -3,7 +3,7 @@
-
+
diff --git a/eclipse/settings/code-style/gwt-checkstyle-suppressions.xml b/eclipse/settings/code-style/gwt-checkstyle-suppressions.xml
deleted file mode 100644
index c5181f9688f..00000000000
--- a/eclipse/settings/code-style/gwt-checkstyle-suppressions.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/eclipse/settings/code-style/gwt-checkstyle-tests.xml b/eclipse/settings/code-style/gwt-checkstyle-tests.xml
index a9b5a73977f..9b6bfb18dd5 100644
--- a/eclipse/settings/code-style/gwt-checkstyle-tests.xml
+++ b/eclipse/settings/code-style/gwt-checkstyle-tests.xml
@@ -7,13 +7,13 @@ Checkstyle-Configuration: GWT Checks for Tests
Description:
A more lenient set of style checks for test cases, needed because test often need to do funkier stuff.
-->
-
+
-
+
@@ -23,7 +23,6 @@ A more lenient set of style checks for test cases, needed because test often nee
-
@@ -90,20 +89,17 @@ A more lenient set of style checks for test cases, needed because test often nee
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
@@ -215,33 +211,30 @@ A more lenient set of style checks for test cases, needed because test often nee
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/eclipse/settings/code-style/gwt-checkstyle.xml b/eclipse/settings/code-style/gwt-checkstyle.xml
index 2455ce28a60..222dfb5b7fd 100644
--- a/eclipse/settings/code-style/gwt-checkstyle.xml
+++ b/eclipse/settings/code-style/gwt-checkstyle.xml
@@ -7,13 +7,13 @@ Checkstyle-Configuration: GWT Checks
Description:
-->
-
+
-
+
@@ -21,13 +21,12 @@ Description:
+
+
+
+
-
-
-
-
-
-
+
@@ -40,6 +39,7 @@ Description:
+
@@ -53,7 +53,7 @@ Description:
-
+
@@ -86,20 +86,17 @@ Description:
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
@@ -198,33 +195,31 @@ Description:
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
-
-
-
diff --git a/eclipse/user/.classpath b/eclipse/user/.classpath
index 75f936204d0..1fa63d0ffcc 100644
--- a/eclipse/user/.classpath
+++ b/eclipse/user/.classpath
@@ -44,7 +44,7 @@
-
+
diff --git a/maven/google-poms/gwt/pom-template.xml b/maven/google-poms/gwt/pom-template.xml
index dc7f26bd3d5..777f51ed37f 100644
--- a/maven/google-poms/gwt/pom-template.xml
+++ b/maven/google-poms/gwt/pom-template.xml
@@ -22,7 +22,7 @@
9.4.44.v20210927
- 9.2
+ 9.6
diff --git a/maven/poms/gwt/pom-template.xml b/maven/poms/gwt/pom-template.xml
index 0f288bae1e9..0825e6cf471 100644
--- a/maven/poms/gwt/pom-template.xml
+++ b/maven/poms/gwt/pom-template.xml
@@ -22,7 +22,7 @@
9.4.44.v20210927
- 9.2
+ 9.6
diff --git a/requestfactory/build.xml b/requestfactory/build.xml
index c835c86da4e..8a78f446fb7 100755
--- a/requestfactory/build.xml
+++ b/requestfactory/build.xml
@@ -41,10 +41,14 @@
+
+
+
+
diff --git a/samples/validation/src/main/java/com/google/gwt/sample/validation/shared/Person.java b/samples/validation/src/main/java/com/google/gwt/sample/validation/shared/Person.java
index c24ef952c19..6724a112a5f 100644
--- a/samples/validation/src/main/java/com/google/gwt/sample/validation/shared/Person.java
+++ b/samples/validation/src/main/java/com/google/gwt/sample/validation/shared/Person.java
@@ -16,7 +16,6 @@
package com.google.gwt.sample.validation.shared;
import com.google.gwt.sample.validation.server.ServerConstraint;
-
import com.google.gwt.user.client.rpc.IsSerializable;
import java.util.Map;
diff --git a/servlet/build.xml b/servlet/build.xml
index 47d554892f1..9f23dfcdf5f 100644
--- a/servlet/build.xml
+++ b/servlet/build.xml
@@ -24,11 +24,11 @@
-
-
+
+
+
-
@@ -70,11 +70,11 @@
-
-
+
+
+
-
diff --git a/tools/api-checker/config/gwt211_212userapi.conf b/tools/api-checker/config/gwt211_212userapi.conf
new file mode 100644
index 00000000000..ecd503d03df
--- /dev/null
+++ b/tools/api-checker/config/gwt211_212userapi.conf
@@ -0,0 +1,156 @@
+#existing API
+
+# dirRoot_old is missing because refJars are being supplied
+name_old gwt211userApi
+#sourceFiles is specified as colon-separated list of files
+sourceFiles_old com/google/gwt\
+:com/google/web\
+:javax/validation\
+
+#excludedFiles is specified as colon-separated ant patterns
+# The entries for javax and org exclude the validation stuff.
+# Bug: http://code.google.com/p/google-web-toolkit/issues/detail?id=5566
+excludedFiles_old **/linker/**\
+:**/rebind/**\
+:**/server/**\
+:**/tools/**\
+:**/vm/**\
+:com/google/gwt/core/client/impl/JavaScriptExceptionBase.java\
+:com/google/gwt/core/client/impl/WeakMapping.java\
+:com/google/gwt/core/shared/impl/StringCase.java\
+:com/google/gwt/core/shared/impl/ThrowableTypeResolver.java\
+:com/google/gwt/core/ext/**\
+:com/google/gwt/dev/*.java\
+:com/google/gwt/dev/asm/**\
+:com/google/gwt/dev/cfg/**\
+:com/google/gwt/dev/codeserver/**\
+:com/google/gwt/dev/common/**\
+:com/google/gwt/dev/generator/**\
+:com/google/gwt/dev/javac/**\
+:com/google/gwt/dev/jdt/**\
+:com/google/gwt/dev/jjs/*.java\
+:com/google/gwt/dev/jjs/ast/**\
+:com/google/gwt/dev/jjs/impl/**\
+:com/google/gwt/dev/js/**\
+:com/google/gwt/dev/json/**\
+:com/google/gwt/dev/resource/**\
+:com/google/gwt/dev/shell/**\
+:com/google/gwt/dev/ui/**\
+:com/google/gwt/dev/url/**\
+:com/google/gwt/dev/util/**\
+:com/google/gwt/i18n/**/impl/cldr/**\
+:com/google/gwt/junit/*.java\
+:com/google/gwt/junit/client/GWTTestCase.java\
+:com/google/gwt/junit/client/impl/GWTRunner.java\
+:com/google/gwt/junit/client/impl/GWTTestAccessor.java\
+:com/google/gwt/junit/remote/**\
+:com/google/gwt/regexp/shared/**\
+:com/google/gwt/resources/css/**\
+:com/google/gwt/resources/gss/**\
+:com/google/gwt/resources/converter/**\
+:com/google/gwt/resources/ext/**\
+:com/google/gwt/resources/rg/**\
+:com/google/gwt/safecss/shared/SafeStylesHostedModeUtils.java\
+:com/google/gwt/safehtml/shared/SafeHtmlHostedModeUtils.java\
+:com/google/gwt/safehtml/shared/SafeUriHostedModeUtils.java\
+:com/google/gwt/soyc/**\
+:com/google/gwt/typedarrays/super/com/google/gwt/typedarrays/shared/TypedArraysFactory.java\
+:com/google/gwt/user/client/rpc/core/**\
+:com/google/gwt/user/client/rpc/impl/**\
+:com/google/gwt/uibinder/attributeparsers/**\
+:com/google/gwt/uibinder/client/impl/**\
+:com/google/gwt/uibinder/elementparsers/**\
+:com/google/gwt/uibinder/testing/**\
+:com/google/gwt/util/**\
+:com/google/gwt/validation/**\
+:com/google/web/bindery/autobean/shared/ValueCodexHelper.java\
+:com/google/web/bindery/autobean/**/impl/**\
+:com/google/web/bindery/requestfactory/apt/**\
+:com/google/web/bindery/requestfactory/gwt/client/RequestBatcher.java\
+:com/google/web/bindery/requestfactory/gwt/client/impl/**\
+:com/google/web/bindery/requestfactory/server/impl/**\
+:com/google/web/bindery/requestfactory/shared/impl/**\
+:com/google/web/bindery/requestfactory/vm/**\
+:javax/**\
+:org/**\
+
+##############################################
+#new Api
+
+dirRoot_new ./
+name_new gwt28userApi
+#sourceFiles is specified as colon-separated list of files
+sourceFiles_new dev/core/super\
+:user/src\
+:user/super\
+
+#excludedFiles is specified as colon-separated ant patterns
+# The entries for javax and org exclude the validation stuff.
+# Bug: http://code.google.com/p/google-web-toolkit/issues/detail?id=5566
+excludedFiles_new **/linker/**\
+:**/rebind/**\
+:**/server/**\
+:**/tools/**\
+:**/vm/**\
+:user/src/com/google/gwt/core/client/impl/JavaScriptExceptionBase.java\
+:user/src/com/google/gwt/core/client/impl/WeakMapping.java\
+:user/src/com/google/gwt/core/shared/impl/ThrowableTypeResolver.java\
+:user/src/com/google/gwt/i18n/**/impl/cldr/**\
+:user/src/com/google/gwt/junit/*.java\
+:user/src/com/google/gwt/junit/client/GWTTestCase.java\
+:user/src/com/google/gwt/junit/client/impl/GWTRunner.java\
+:user/src/com/google/gwt/junit/client/impl/GWTTestAccessor.java\
+:user/src/com/google/gwt/regexp/shared/**\
+:user/src/com/google/gwt/resources/css/**\
+:user/src/com/google/gwt/resources/gss/**\
+:user/src/com/google/gwt/resources/converter/**\
+:user/src/com/google/gwt/resources/ext/**\
+:user/src/com/google/gwt/resources/rg/**\
+:user/src/com/google/gwt/safecss/shared/SafeStylesHostedModeUtils.java\
+:user/src/com/google/gwt/safehtml/shared/SafeHtmlHostedModeUtils.java\
+:user/src/com/google/gwt/safehtml/shared/SafeUriHostedModeUtils.java\
+:user/src/com/google/gwt/user/client/rpc/core/**\
+:user/src/com/google/gwt/user/client/rpc/impl/**\
+:user/src/com/google/gwt/uibinder/attributeparsers/**\
+:user/src/com/google/gwt/uibinder/client/impl/**\
+:user/src/com/google/gwt/uibinder/elementparsers/**\
+:user/src/com/google/gwt/uibinder/testing/**\
+:user/src/com/google/gwt/util/**\
+:user/src/com/google/gwt/validation/**\
+:user/src/com/google/web/bindery/autobean/shared/ValueCodexHelper.java\
+:user/src/com/google/web/bindery/autobean/**/impl/**\
+:user/src/com/google/web/bindery/requestfactory/apt/**\
+:user/src/com/google/web/bindery/requestfactory/gwt/client/RequestBatcher.java\
+:user/src/com/google/web/bindery/requestfactory/gwt/client/impl/**\
+:user/src/com/google/web/bindery/requestfactory/server/impl/**\
+:user/src/com/google/web/bindery/requestfactory/shared/impl/**\
+:user/src/com/google/web/bindery/requestfactory/vm/**\
+:user/src/javax/**\
+:user/src/org/**\
+:user/super/com/google/gwt/typedarrays/super/com/google/gwt/typedarrays/shared/TypedArraysFactory.java\
+
+##############################################
+#excluded packages colon separated list
+excludedPackages com.google.gwt.core.client.impl\
+:com.google.gwt.core.shared.impl\
+:com.google.gwt.core.client.js.impl\
+:com.google.gwt.editor.client.impl\
+:com.google.gwt.i18n.client.impl\
+:com.google.gwt.junit.client.impl\
+:com.google.gwt.lang\
+:com.google.gwt.logging.impl\
+:com.google.gwt.resources.client.impl\
+:com.google.gwt.rpc.client.impl\
+:com.google.gwt.user.client.impl\
+:com.google.gwt.user.client.ui.impl\
+:com.google.gwt.xml.client.impl\
+:javaemul.internal\
+
+##############################################
+#Api whitelist
+# when adding to the white-list, include comments as to why the addition is
+# being made.
+
+# java.io.Reader missing IOException throws for read methods
+java.io.Reader::read([C) OVERRIDABLE_METHOD_EXCEPTION_TYPE_CHANGE new method has more exceptions: [Ljava/io/IOException;]
+java.io.Reader::read([CII) OVERRIDABLE_METHOD_EXCEPTION_TYPE_CHANGE new method has more exceptions: [Ljava/io/IOException;]
diff --git a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
index 313037c1aa8..2bfe463048f 100644
--- a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
+++ b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
@@ -24,12 +24,11 @@
import com.google.gwt.dev.util.arg.SourceLevel;
import com.google.gwt.dev.util.log.AbstractTreeLogger;
import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
+import com.google.gwt.thirdparty.apache.ant.types.ZipScanner;
import com.google.gwt.util.tools.ArgHandlerFlag;
import com.google.gwt.util.tools.ArgHandlerString;
import com.google.gwt.util.tools.ToolBase;
-import com.google.gwt.thirdparty.apache.ant.types.ZipScanner;
-
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
diff --git a/user/build.xml b/user/build.xml
index d627a8078cd..2af156012ff 100755
--- a/user/build.xml
+++ b/user/build.xml
@@ -14,27 +14,16 @@
-
-
-
-
+
+
-
-
-
-
-
-
+
+
-
-
-
+
@@ -59,7 +48,6 @@
-->
-
-
-
-
-
+
+ release="11">
+
+
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/user/src/com/google/gwt/cell/client/CheckboxCell.java b/user/src/com/google/gwt/cell/client/CheckboxCell.java
index 8e9c46200e2..77eda41a440 100644
--- a/user/src/com/google/gwt/cell/client/CheckboxCell.java
+++ b/user/src/com/google/gwt/cell/client/CheckboxCell.java
@@ -46,6 +46,7 @@ public class CheckboxCell extends AbstractEditableCell {
/**
* Construct a new {@link CheckboxCell}.
*/
+ @SuppressWarnings("BoxedPrimitiveEquality")
public CheckboxCell() {
this(false);
}
@@ -91,7 +92,8 @@ public boolean isEditing(Context context, Element parent, Boolean value) {
}
@Override
- public void onBrowserEvent(Context context, Element parent, Boolean value,
+ @SuppressWarnings("BoxedPrimitiveEquality")
+ public void onBrowserEvent(Context context, Element parent, Boolean value,
NativeEvent event, ValueUpdater valueUpdater) {
String type = event.getType();
diff --git a/user/src/com/google/gwt/core/CompilerParameters.gwt.xml b/user/src/com/google/gwt/core/CompilerParameters.gwt.xml
index df4aca4b873..fdeb60705fc 100644
--- a/user/src/com/google/gwt/core/CompilerParameters.gwt.xml
+++ b/user/src/com/google/gwt/core/CompilerParameters.gwt.xml
@@ -96,6 +96,12 @@
+
+
+
+
diff --git a/user/src/com/google/gwt/core/CoreWithUserAgent.gwt.xml b/user/src/com/google/gwt/core/CoreWithUserAgent.gwt.xml
index 48fa48ed1dd..38a9dbe1f55 100644
--- a/user/src/com/google/gwt/core/CoreWithUserAgent.gwt.xml
+++ b/user/src/com/google/gwt/core/CoreWithUserAgent.gwt.xml
@@ -15,20 +15,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/user/src/com/google/gwt/core/StackTrace.gwt.xml b/user/src/com/google/gwt/core/StackTrace.gwt.xml
index 879dbe42164..024183c50d2 100644
--- a/user/src/com/google/gwt/core/StackTrace.gwt.xml
+++ b/user/src/com/google/gwt/core/StackTrace.gwt.xml
@@ -45,9 +45,14 @@
-
+
+
+
+
+
+
diff --git a/user/src/com/google/gwt/core/server/StackTraceDeobfuscator.java b/user/src/com/google/gwt/core/server/StackTraceDeobfuscator.java
index 776e4cfd964..25d851c7c0c 100644
--- a/user/src/com/google/gwt/core/server/StackTraceDeobfuscator.java
+++ b/user/src/com/google/gwt/core/server/StackTraceDeobfuscator.java
@@ -15,9 +15,9 @@
*/
package com.google.gwt.core.server;
+import com.google.gwt.thirdparty.debugging.sourcemap.OriginalMapping;
import com.google.gwt.thirdparty.debugging.sourcemap.SourceMapConsumerFactory;
import com.google.gwt.thirdparty.debugging.sourcemap.SourceMapping;
-import com.google.gwt.thirdparty.debugging.sourcemap.proto.Mapping;
import java.io.BufferedReader;
import java.io.File;
@@ -26,6 +26,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -186,9 +187,9 @@ public final StackTraceElement[] resymbolize(StackTraceElement[] st, String stro
return null;
}
// Warm the symbol cache for all symbols in this stack trace.
- Set requiredSymbols = new HashSet();
+ Set requiredSymbols = new HashSet<>();
for (StackTraceElement ste : st) {
- requiredSymbols.add(ste.getMethodName());
+ requiredSymbols.add(normalizeSymbol(ste.getMethodName()));
}
loadSymbolMap(strongName, requiredSymbols);
@@ -199,6 +200,17 @@ public final StackTraceElement[] resymbolize(StackTraceElement[] st, String stro
return newSt;
}
+ /**
+ * Helper to clean up client-provided symbols.
+ */
+ private static String normalizeSymbol(String symbol) {
+ // Chrome prefixes "new " for constructor calls, eliminate the prefix
+ if (symbol.startsWith("new ")) {
+ symbol = symbol.substring(4);
+ }
+ return symbol;
+ }
+
/**
* Best effort resymbolization of a single stack trace element.
*
@@ -299,13 +311,19 @@ public final StackTraceElement resymbolize(StackTraceElement ste, String strongN
if (sourceMapCapable && fragmentId != -1 && column != -1) {
SourceMapping sourceMapping = loadSourceMap(strongName, fragmentId);
if (sourceMapping != null && ste.getLineNumber() > -1) {
- Mapping.OriginalMapping mappingForLine = sourceMapping
+ OriginalMapping mappingForLine = sourceMapping
.getMappingForLine(jsLineNumber, column);
if (mappingForLine != null) {
if (declaringClass == null || declaringClass.equals(ste.getClassName())) {
declaringClass = mappingForLine.getOriginalFile();
- methodName = mappingForLine.getIdentifier();
+ if (mappingForLine.getIdentifier().isPresent()) {
+ // Only overwrite the name if the sourcemap had an explicit identifier
+ methodName = mappingForLine.getIdentifier().get();
+ } else if (methodName == null) {
+ // No other name was provided by symbolMaps, fall back to JS name
+ methodName = ste.getMethodName();
+ }
}
fileName = mappingForLine.getOriginalFile();
lineNumber = mappingForLine.getLineNumber();
@@ -366,9 +384,8 @@ private String loadStreamAsString(InputStream stream) {
}
private String loadOneSymbol(String strongName, String symbol) {
- Set symbolSet = new HashSet();
- symbolSet.add(symbol);
- Map symbolMap = loadSymbolMap(strongName, symbolSet);
+ symbol = normalizeSymbol(symbol);
+ Map symbolMap = loadSymbolMap(strongName, Collections.singleton(symbol));
return symbolMap.get(symbol);
}
diff --git a/user/src/com/google/gwt/dom/client/BrowserEvents.java b/user/src/com/google/gwt/dom/client/BrowserEvents.java
index 18523a86385..c8be19c053b 100644
--- a/user/src/com/google/gwt/dom/client/BrowserEvents.java
+++ b/user/src/com/google/gwt/dom/client/BrowserEvents.java
@@ -53,7 +53,9 @@ public class BrowserEvents {
public static final String MOUSEOUT = "mouseout";
public static final String MOUSEOVER = "mouseover";
public static final String MOUSEUP = "mouseup";
+ @Deprecated
public static final String MOUSEWHEEL = "mousewheel";
+ public static final String WHEEL = "wheel";
public static final String PROGRESS = "progress";
public static final String SCROLL = "scroll";
public static final String TOUCHCANCEL = "touchcancel";
diff --git a/user/src/com/google/gwt/dom/client/DOMImpl.java b/user/src/com/google/gwt/dom/client/DOMImpl.java
index b6df16551da..a4d5a8d5717 100644
--- a/user/src/com/google/gwt/dom/client/DOMImpl.java
+++ b/user/src/com/google/gwt/dom/client/DOMImpl.java
@@ -138,7 +138,9 @@ public native boolean eventGetMetaKey(NativeEvent evt) /*-{
return !!evt.metaKey;
}-*/;
- public abstract int eventGetMouseWheelVelocityY(NativeEvent evt);
+ public int eventGetMouseWheelVelocityY(NativeEvent evt) {
+ return (int) Math.signum(evt.getDeltaY());
+ }
public abstract EventTarget eventGetRelatedTarget(NativeEvent nativeEvent);
diff --git a/user/src/com/google/gwt/dom/client/DOMImplMozilla.java b/user/src/com/google/gwt/dom/client/DOMImplMozilla.java
index 100d7d020b5..1c48b0b3b0e 100644
--- a/user/src/com/google/gwt/dom/client/DOMImplMozilla.java
+++ b/user/src/com/google/gwt/dom/client/DOMImplMozilla.java
@@ -124,11 +124,6 @@ public NativeEvent createKeyPressEvent(Document doc, boolean ctrlKey,
shiftKey, metaKey, 0, charCode);
}
- @Override
- public native int eventGetMouseWheelVelocityY(NativeEvent evt) /*-{
- return evt.detail || 0;
- }-*/;
-
@Override
public native EventTarget eventGetRelatedTarget(NativeEvent evt) /*-{
// Hack around Mozilla bug 497780 (relatedTarget sometimes returns XUL
diff --git a/user/src/com/google/gwt/dom/client/DOMImplStandardBase.java b/user/src/com/google/gwt/dom/client/DOMImplStandardBase.java
index 115cca81d7d..1ba6dd3357d 100644
--- a/user/src/com/google/gwt/dom/client/DOMImplStandardBase.java
+++ b/user/src/com/google/gwt/dom/client/DOMImplStandardBase.java
@@ -204,11 +204,6 @@ public native EventTarget eventGetCurrentTarget(NativeEvent event) /*-{
return event.currentTarget || $wnd;
}-*/;
- @Override
- public native int eventGetMouseWheelVelocityY(NativeEvent evt) /*-{
- return Math.round(-evt.wheelDelta / 40) || 0;
- }-*/;
-
@Override
public int getAbsoluteLeft(Element elem) {
ClientRect rect = getBoundingClientRect(elem);
diff --git a/user/src/com/google/gwt/dom/client/NativeEvent.java b/user/src/com/google/gwt/dom/client/NativeEvent.java
index d5a14e029e6..3d3b19fa0a8 100644
--- a/user/src/com/google/gwt/dom/client/NativeEvent.java
+++ b/user/src/com/google/gwt/dom/client/NativeEvent.java
@@ -158,23 +158,40 @@ public final boolean getMetaKey() {
}
/**
- * Gets the velocity of the mouse wheel associated with the event along the Y
+ * Gets the sign of the velocity of the mouse wheel associated with the event along the Y
* axis.
*
- * The velocity of the event is an artificial measurement for relative
- * comparisons of wheel activity. It is affected by some non-browser factors,
- * including choice of input hardware and mouse acceleration settings. The
- * sign of the velocity measurement agrees with the screen coordinate system;
- * negative values are towards the origin and positive values are away from
- * the origin. Standard scrolling speed is approximately ten units per event.
+ * In previous versions of GWT this returned the velocity normalized to a small integer.
+ * Unfortunately for some devices such normalization rounded non-trivial velocities to 0.
+ * To maintain compatibility with that implementation, this still returns an integer,
+ * but using the sign function
*
*
- * @return The velocity of the mouse wheel.
+ * @return The velocity of the mouse wheel: -1 for scrolling up, 1 for scrolling down,
+ * 0 if not scrolled at all
+ * @deprecated use getDeltaY() instead
*/
+ @Deprecated
public final int getMouseWheelVelocityY() {
return DOMImpl.impl.eventGetMouseWheelVelocityY(this);
}
+ /**
+ * Gets the native velocity of the mouse wheel in Y direction.
+ * @return The velocity of the mouse wheel
+ */
+ public final native double getDeltaY() /*-{
+ return this.deltaY;
+ }-*/;
+
+ /**
+ * Gets the native velocity of the mouse wheel in X direction.
+ * @return The velocity of the mouse wheel
+ */
+ public final native double getDeltaX() /*-{
+ return this.deltaX;
+ }-*/;
+
/**
* Gets the related target for this event.
*
diff --git a/user/src/com/google/gwt/event/dom/client/MouseWheelEvent.java b/user/src/com/google/gwt/event/dom/client/MouseWheelEvent.java
index 647c07f89be..7236357eb65 100644
--- a/user/src/com/google/gwt/event/dom/client/MouseWheelEvent.java
+++ b/user/src/com/google/gwt/event/dom/client/MouseWheelEvent.java
@@ -27,16 +27,7 @@ public class MouseWheelEvent extends MouseEvent {
* this event.
*/
private static final Type TYPE = new Type(
- BrowserEvents.MOUSEWHEEL, new MouseWheelEvent());
-
- static {
- /**
- * Hidden type used to ensure DOMMouseScroll gets registered in the type map.
- * This is the special name used on Mozilla browsers for what everyone else
- * calls 'mousewheel'.
- */
- new Type("DOMMouseScroll", new MouseWheelEvent());
- }
+ BrowserEvents.WHEEL, new MouseWheelEvent());
/**
* Gets the event type associated with mouse wheel events.
@@ -61,18 +52,30 @@ public final Type getAssociatedType() {
}
/**
- * Get the change in the mouse wheel position along the Y-axis; negative if
- * the mouse wheel is moving north (toward the top of the screen) or positive
+ * Get the sign of the change in the mouse wheel position along the Y-axis; -1 if
+ * the mouse wheel is moving north (toward the top of the screen) or 1
* if the mouse wheel is moving south (toward the bottom of the screen).
*
- * Note that delta values are not normalized across browsers or OSes.
- *
- * @return the delta of the mouse wheel along the y axis
+ * @return the sign of the delta of the mouse wheel along the y axis
+ * @deprecated use getNativeDeltaY() instead
*/
+ @Deprecated
public int getDeltaY() {
return getNativeEvent().getMouseWheelVelocityY();
}
+ /**
+ * Get the change in the mouse wheel position along the Y-axis; -1 if
+ * the mouse wheel is moving north (toward the top of the screen) or 1
+ * if the mouse wheel is moving south (toward the bottom of the screen).
+ * Note that the return values are not normalized for browsers and OSs.
+ *
+ * @return the sign of the delta of the mouse wheel along the y axis
+ */
+ public double getNativeDeltaY() {
+ return getNativeEvent().getDeltaY();
+ }
+
/**
* Convenience method that returns true if {@link #getDeltaY()}
* is a negative value (ie, the velocity is directed toward the top of the
@@ -81,7 +84,7 @@ public int getDeltaY() {
* @return true if the velocity is directed toward the top of the screen
*/
public boolean isNorth() {
- return getDeltaY() < 0;
+ return getNativeDeltaY() < 0;
}
/**
@@ -92,7 +95,7 @@ public boolean isNorth() {
* @return true if the velocity is directed toward the bottom of the screen
*/
public boolean isSouth() {
- return getDeltaY() > 0;
+ return getNativeDeltaY() > 0;
}
@Override
diff --git a/user/src/com/google/gwt/i18n/shared/DateTimeFormat.java b/user/src/com/google/gwt/i18n/shared/DateTimeFormat.java
index 59c8fdb125c..f66fe02cb25 100644
--- a/user/src/com/google/gwt/i18n/shared/DateTimeFormat.java
+++ b/user/src/com/google/gwt/i18n/shared/DateTimeFormat.java
@@ -1906,9 +1906,10 @@ private boolean subParse(String text, int[] pos, PatternPart part,
cal.setTzOffset(0);
return true;
}
- // $FALL-THROUGH$
+ // CHECKSTYLE_OFF: Fall through
case 'z': // time zone offset
case 'v': // time zone generic
+ // CHECKSTYLE_ON
return subParseTimeZoneInGMT(text, start, pos, cal);
default:
return false;
diff --git a/user/src/com/google/gwt/junit/JUnitShell.java b/user/src/com/google/gwt/junit/JUnitShell.java
index 277613cad0e..53f67a7cb2f 100644
--- a/user/src/com/google/gwt/junit/JUnitShell.java
+++ b/user/src/com/google/gwt/junit/JUnitShell.java
@@ -38,7 +38,6 @@
import com.google.gwt.dev.shell.jetty.JettyLauncher;
import com.google.gwt.dev.util.arg.ArgHandlerClosureFormattedOutput;
import com.google.gwt.dev.util.arg.ArgHandlerDeployDir;
-import com.google.gwt.dev.util.arg.ArgHandlerDeprecatedDisableUpdateCheck;
import com.google.gwt.dev.util.arg.ArgHandlerDeprecatedOptimizeDataflow;
import com.google.gwt.dev.util.arg.ArgHandlerDisableCastChecking;
import com.google.gwt.dev.util.arg.ArgHandlerDisableClassMetadata;
@@ -291,7 +290,6 @@ public int handle(String[] args, int tagIndex) {
registerHandler(new ArgHandlerDisableOrdinalizeEnums(options));
registerHandler(new ArgHandlerDisableRemoveDuplicateFunctions(options));
registerHandler(new ArgHandlerDisableRunAsync(options));
- registerHandler(new ArgHandlerDeprecatedDisableUpdateCheck());
registerHandler(new ArgHandlerDraftCompile(options));
registerHandler(new ArgHandlerLocalWorkers(options));
registerHandler(new ArgHandlerNamespace(options));
diff --git a/user/src/com/google/gwt/uibinder/elementparsers/BeanParser.java b/user/src/com/google/gwt/uibinder/elementparsers/BeanParser.java
index 730aa37e5ba..47e4f357a75 100644
--- a/user/src/com/google/gwt/uibinder/elementparsers/BeanParser.java
+++ b/user/src/com/google/gwt/uibinder/elementparsers/BeanParser.java
@@ -46,6 +46,7 @@ public class BeanParser implements ElementParser {
* methods that extend the normal bean naming pattern. So, that implementations of
* {@link IsWidget} behave like UIObjects, they have to be translated.
*/
+ @SuppressWarnings("DoubleBraceInitialization")
private static final Map ADD_PROPERTY_TO_SETTER_MAP =
new HashMap() { {
put("addStyleNames", "addStyleName");
diff --git a/user/src/com/google/gwt/user/client/Window.java b/user/src/com/google/gwt/user/client/Window.java
index 2fb2789f482..972f16d3107 100644
--- a/user/src/com/google/gwt/user/client/Window.java
+++ b/user/src/com/google/gwt/user/client/Window.java
@@ -506,6 +506,7 @@ public HandlerManager getHandlers() {
// Package protected for testing.
static WindowHandlers handlers;
private static boolean closeHandlersInitialized;
+ private static boolean beforeCloseHandlersInitialized;
private static boolean scrollHandlersInitialized;
private static boolean resizeHandlersInitialized;
private static int lastResizeWidth;
@@ -518,7 +519,10 @@ public HandlerManager getHandlers() {
*
* @param handler the handler
* @return returns the handler registration
+ * @deprecated This method requires the use of the {@code unload} browser event, which is
+ * deprecated in all browsers.
*/
+ @Deprecated
public static HandlerRegistration addCloseHandler(CloseHandler handler) {
maybeInitializeCloseHandlers();
return addHandler(CloseEvent.getType(), handler);
@@ -531,7 +535,6 @@ public static HandlerRegistration addCloseHandler(CloseHandler handler)
* @return returns the handler registration
*/
public static HandlerRegistration addResizeHandler(ResizeHandler handler) {
- maybeInitializeCloseHandlers();
maybeInitializeResizeHandlers();
return addHandler(ResizeEvent.getType(), handler);
}
@@ -556,7 +559,7 @@ public static void addWindowCloseListener(WindowCloseListener listener) {
*/
public static HandlerRegistration addWindowClosingHandler(
ClosingHandler handler) {
- maybeInitializeCloseHandlers();
+ maybeInitializeBeforeCloseHandlers();
return addHandler(Window.ClosingEvent.getType(), handler);
}
@@ -579,7 +582,6 @@ public static void addWindowResizeListener(WindowResizeListener listener) {
*/
public static HandlerRegistration addWindowScrollHandler(
Window.ScrollHandler handler) {
- maybeInitializeCloseHandlers();
maybeInitializeScrollHandlers();
return addHandler(Window.ScrollEvent.getType(), handler);
}
@@ -910,13 +912,21 @@ private static WindowHandlers getHandlers() {
return handlers;
}
+ @Deprecated
private static void maybeInitializeCloseHandlers() {
if (GWT.isClient() && !closeHandlersInitialized) {
- impl.initWindowCloseHandler();
+ impl.initWindowUnloadHandler();
closeHandlersInitialized = true;
}
}
+ private static void maybeInitializeBeforeCloseHandlers() {
+ if (GWT.isClient() && !beforeCloseHandlersInitialized) {
+ impl.initWindowBeforeUnloadHandler();
+ beforeCloseHandlersInitialized = true;
+ }
+ }
+
private static void maybeInitializeResizeHandlers() {
if (GWT.isClient() && !resizeHandlersInitialized) {
impl.initWindowResizeHandler();
diff --git a/user/src/com/google/gwt/user/client/impl/DOMImpl.java b/user/src/com/google/gwt/user/client/impl/DOMImpl.java
index b006c414f47..ebc584d865a 100644
--- a/user/src/com/google/gwt/user/client/impl/DOMImpl.java
+++ b/user/src/com/google/gwt/user/client/impl/DOMImpl.java
@@ -102,7 +102,7 @@ public native int eventGetTypeInt(String eventType) /*-{
case "scroll": return 0x04000;
case "error": return 0x10000;
case "mousewheel": return 0x20000;
- case "DOMMouseScroll": return 0x20000;
+ case "wheel": return 0x20000;
case "contextmenu": return 0x40000;
case "paste": return 0x80000;
case "touchstart": return 0x100000;
diff --git a/user/src/com/google/gwt/user/client/impl/DOMImplMozilla.java b/user/src/com/google/gwt/user/client/impl/DOMImplMozilla.java
index b5c51b10854..16bd41394f4 100644
--- a/user/src/com/google/gwt/user/client/impl/DOMImplMozilla.java
+++ b/user/src/com/google/gwt/user/client/impl/DOMImplMozilla.java
@@ -15,36 +15,11 @@
*/
package com.google.gwt.user.client.impl;
-import com.google.gwt.dom.client.Element;
-
/**
* Mozilla implementation of StandardBrowser.
*/
class DOMImplMozilla extends DOMImplStandard {
- static {
- addMozillaCaptureEventDispatchers();
- }
-
- @SuppressWarnings("deprecation")
- private static native void addMozillaCaptureEventDispatchers() /*-{
- @com.google.gwt.user.client.impl.DOMImplStandard::captureEventDispatchers['DOMMouseScroll'] =
- @com.google.gwt.user.client.impl.DOMImplStandard::dispatchCapturedMouseEvent(*);
- }-*/;
-
- @Override
- public void sinkEvents(Element elem, int bits) {
- super.sinkEvents(elem, bits);
- sinkEventsMozilla(elem, bits);
- }
-
- @SuppressWarnings("deprecation")
- public native void sinkEventsMozilla(Element elem, int bits) /*-{
- if (bits & 0x20000) {
- elem.addEventListener('DOMMouseScroll', @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent, false);
- }
- }-*/;
-
@Override
protected void initEventSystem() {
super.initEventSystem();
diff --git a/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java b/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
index d0176f4f127..ea7c9e8ae98 100644
--- a/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
+++ b/user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
@@ -292,7 +292,7 @@ protected native void sinkEventsImpl(Element elem, int bits) /*-{
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchUnhandledEvent : null;
if (chMask & 0x10000) elem.onerror = (bits & 0x10000) ?
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
- if (chMask & 0x20000) elem.onmousewheel = (bits & 0x20000) ?
+ if (chMask & 0x20000) elem.onwheel = (bits & 0x20000) ?
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
if (chMask & 0x40000) elem.oncontextmenu = (bits & 0x40000) ?
@com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : null;
diff --git a/user/src/com/google/gwt/user/client/impl/WindowImpl.java b/user/src/com/google/gwt/user/client/impl/WindowImpl.java
index 4854d617b83..fc7b78b3361 100644
--- a/user/src/com/google/gwt/user/client/impl/WindowImpl.java
+++ b/user/src/com/google/gwt/user/client/impl/WindowImpl.java
@@ -29,11 +29,30 @@ public native String getHash() /*-{
public native String getQueryString() /*-{
return $wnd.location.search;
}-*/;
-
- public native void initWindowCloseHandler() /*-{
+
+ @Deprecated
+ public void initWindowCloseHandler() {
+ initWindowUnloadHandler();
+ initWindowBeforeUnloadHandler();
+ }
+
+ @Deprecated
+ public native void initWindowUnloadHandler() /*-{
+ var oldOnUnload = $wnd.onunload;
+
+ $wnd.onunload = $entry(function(evt) {
+ try {
+ @com.google.gwt.user.client.Window::onClosed()();
+ } finally {
+ oldOnUnload && oldOnUnload(evt);
+ $wnd.onunload = null;
+ }
+ });
+ }-*/;
+
+ public native void initWindowBeforeUnloadHandler() /*-{
var oldOnBeforeUnload = $wnd.onbeforeunload;
- var oldOnUnload = $wnd.onunload;
-
+
// Old mozilla doesn't like $entry's explicit return statement and
// will always pop up a confirmation dialog. This is worked around by
// just wrapping the call to onClosing(), which still has the semantics
@@ -55,18 +74,6 @@ public native void initWindowCloseHandler() /*-{
}
// returns undefined.
};
-
- $wnd.onunload = $entry(function(evt) {
- try {
- @com.google.gwt.user.client.Window::onClosed()();
- } finally {
- oldOnUnload && oldOnUnload(evt);
- $wnd.onresize = null;
- $wnd.onscroll = null;
- $wnd.onbeforeunload = null;
- $wnd.onunload = null;
- }
- });
}-*/;
public native void initWindowResizeHandler() /*-{
diff --git a/user/src/com/google/gwt/user/client/ui/Anchor.java b/user/src/com/google/gwt/user/client/ui/Anchor.java
index 02ecaef6761..77d4a8b37f1 100644
--- a/user/src/com/google/gwt/user/client/ui/Anchor.java
+++ b/user/src/com/google/gwt/user/client/ui/Anchor.java
@@ -73,7 +73,7 @@ public class Anchor extends FocusWidget implements HasHorizontalAlignment,
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/Button.java b/user/src/com/google/gwt/user/client/ui/Button.java
index b1e5aec0585..d31f6e17869 100644
--- a/user/src/com/google/gwt/user/client/ui/Button.java
+++ b/user/src/com/google/gwt/user/client/ui/Button.java
@@ -47,7 +47,7 @@ public class Button extends ButtonBase {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/FileUpload.java b/user/src/com/google/gwt/user/client/ui/FileUpload.java
index 228fae0a4dd..53b205e620d 100644
--- a/user/src/com/google/gwt/user/client/ui/FileUpload.java
+++ b/user/src/com/google/gwt/user/client/ui/FileUpload.java
@@ -54,7 +54,7 @@ public class FileUpload extends FocusWidget implements HasName, HasChangeHandler
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/FormPanel.java b/user/src/com/google/gwt/user/client/ui/FormPanel.java
index 396f8d609bf..a64f85e3315 100644
--- a/user/src/com/google/gwt/user/client/ui/FormPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/FormPanel.java
@@ -253,7 +253,7 @@ interface IFrameTemplate extends SafeHtmlTemplates {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
*
* The specified form element's target attribute will not be set, and the
@@ -280,7 +280,7 @@ public static FormPanel wrap(Element element) {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
*
* If the createIFrame parameter is set to true, then the wrapped
diff --git a/user/src/com/google/gwt/user/client/ui/Frame.java b/user/src/com/google/gwt/user/client/ui/Frame.java
index 1d0f7bca9bd..4cdf92eb9a8 100644
--- a/user/src/com/google/gwt/user/client/ui/Frame.java
+++ b/user/src/com/google/gwt/user/client/ui/Frame.java
@@ -52,7 +52,7 @@ public class Frame extends Widget implements HasLoadHandlers {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/HTML.java b/user/src/com/google/gwt/user/client/ui/HTML.java
index 25dc24a6954..b6704a35201 100644
--- a/user/src/com/google/gwt/user/client/ui/HTML.java
+++ b/user/src/com/google/gwt/user/client/ui/HTML.java
@@ -61,7 +61,7 @@ public class HTML extends Label
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/HTMLPanel.java b/user/src/com/google/gwt/user/client/ui/HTMLPanel.java
index 580f0815a1c..926424e7416 100644
--- a/user/src/com/google/gwt/user/client/ui/HTMLPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/HTMLPanel.java
@@ -50,7 +50,7 @@ public static String createUniqueId() {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/Hidden.java b/user/src/com/google/gwt/user/client/ui/Hidden.java
index d9f1466f8fa..e8807f49d77 100644
--- a/user/src/com/google/gwt/user/client/ui/Hidden.java
+++ b/user/src/com/google/gwt/user/client/ui/Hidden.java
@@ -34,7 +34,7 @@ public class Hidden extends Widget implements HasName, TakesValue, IsEdi
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/Image.java b/user/src/com/google/gwt/user/client/ui/Image.java
index 2c7587941a9..c00cfecda02 100644
--- a/user/src/com/google/gwt/user/client/ui/Image.java
+++ b/user/src/com/google/gwt/user/client/ui/Image.java
@@ -484,7 +484,7 @@ public static void prefetch(SafeUri url) {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/InlineHTML.java b/user/src/com/google/gwt/user/client/ui/InlineHTML.java
index 625f274d47b..9b0cf234e52 100644
--- a/user/src/com/google/gwt/user/client/ui/InlineHTML.java
+++ b/user/src/com/google/gwt/user/client/ui/InlineHTML.java
@@ -55,7 +55,7 @@ public class InlineHTML extends HTML {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/InlineLabel.java b/user/src/com/google/gwt/user/client/ui/InlineLabel.java
index d84123630e1..f1ac5544727 100644
--- a/user/src/com/google/gwt/user/client/ui/InlineLabel.java
+++ b/user/src/com/google/gwt/user/client/ui/InlineLabel.java
@@ -46,7 +46,7 @@ public class InlineLabel extends Label {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/Label.java b/user/src/com/google/gwt/user/client/ui/Label.java
index a5910a64671..3759a39382c 100644
--- a/user/src/com/google/gwt/user/client/ui/Label.java
+++ b/user/src/com/google/gwt/user/client/ui/Label.java
@@ -115,7 +115,7 @@ public class Label extends LabelBase implements HasDirectionalText,
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/ListBox.java b/user/src/com/google/gwt/user/client/ui/ListBox.java
index fb9f97861c8..78cfd105f2a 100644
--- a/user/src/com/google/gwt/user/client/ui/ListBox.java
+++ b/user/src/com/google/gwt/user/client/ui/ListBox.java
@@ -99,7 +99,7 @@ public class ListBox extends FocusWidget implements SourcesChangeEvents,
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
* @return list box
diff --git a/user/src/com/google/gwt/user/client/ui/PasswordTextBox.java b/user/src/com/google/gwt/user/client/ui/PasswordTextBox.java
index 646e44e63df..d1060a33eea 100644
--- a/user/src/com/google/gwt/user/client/ui/PasswordTextBox.java
+++ b/user/src/com/google/gwt/user/client/ui/PasswordTextBox.java
@@ -46,7 +46,7 @@ public class PasswordTextBox extends TextBox {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/ResetButton.java b/user/src/com/google/gwt/user/client/ui/ResetButton.java
index 59ef767d406..75c5a99fe78 100644
--- a/user/src/com/google/gwt/user/client/ui/ResetButton.java
+++ b/user/src/com/google/gwt/user/client/ui/ResetButton.java
@@ -38,7 +38,7 @@ public class ResetButton extends Button {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/RootPanel.java b/user/src/com/google/gwt/user/client/ui/RootPanel.java
index cc571e07c61..7397544b394 100644
--- a/user/src/com/google/gwt/user/client/ui/RootPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/RootPanel.java
@@ -18,13 +18,10 @@
import com.google.gwt.dom.client.BodyElement;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
-import com.google.gwt.event.logical.shared.CloseEvent;
-import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.i18n.client.BidiUtils;
import com.google.gwt.i18n.client.HasDirection;
import com.google.gwt.i18n.client.LocaleInfo;
import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.Window;
import java.util.HashMap;
import java.util.HashSet;
@@ -92,11 +89,13 @@ public void execute(Widget w) {
* This method may only be called per widget, and only for widgets that were
* originally passed to {@link #detachOnWindowClose(Widget)}.
*
- *
+ *
* @param widget the widget that no longer needs to be cleaned up when the
* page closes
* @see #detachOnWindowClose(Widget)
+ * @deprecated Instead, use {@link Widget#removeFromParent()}.
*/
+ @Deprecated
public static void detachNow(Widget widget) {
assert widgetsToDetach.contains(widget) : "detachNow() called on a widget "
+ "not currently in the detach list";
@@ -111,25 +110,30 @@ public static void detachNow(Widget widget) {
/**
* Adds a widget to the detach list. This is the list of widgets to be
* detached when the page unloads.
- *
+ *
*
* This method must be called for all widgets that have no parent widgets.
* These are most commonly {@link RootPanel RootPanels}, but can also be any
* widget used to wrap an existing element on the page. Failing to do this may
* cause these widgets to leak memory. This method is called automatically by
* widgets' wrap methods (e.g.
- * {@link Button#wrap(com.google.gwt.dom.client.Element)}).
+ * {@link Button#wrap(Element)}).
*
- *
+ *
*
* This method may not be called on any widget whose element is
* contained in another widget. This is to ensure that the DOM and Widget
* hierarchies cannot get into an inconsistent state.
*
- *
+ *
* @param widget the widget to be cleaned up when the page closes
* @see #detachNow(Widget)
+ * @deprecated While originally introduced to combat memory leaks in old browsers, this is no
+ * longer necessary, and the unload event used by this method is being removed from browsers.
+ * Additionally, it is unreliable as a means to ensure calls to {@link Widget#onUnload()}. See
+ * Issue 9908 for more information.
*/
+ @Deprecated
public static void detachOnWindowClose(Widget widget) {
assert !widgetsToDetach.contains(widget) : "detachOnUnload() called twice "
+ "for the same widget";
@@ -188,8 +192,6 @@ public static RootPanel get(String id) {
// on the first RootPanel.get(String) or RootPanel.get()
// call.
if (rootPanels.size() == 0) {
- hookWindowClosing();
-
// If we're in a RTL locale, set the RTL directionality
// on the entire document.
if (LocaleInfo.getCurrentLocale().isRTL()) {
@@ -223,16 +225,37 @@ public static native com.google.gwt.user.client.Element getBodyElement() /*-{
/**
* Determines whether the given widget is in the detach list.
- *
+ *
+ * Note that modern browsers do not have the memory leaks that originally required use of this
+ * feature - it is retained only to support application-specific detach events.
+ *
+ *
* @param widget the widget to be checked
* @return true if the widget is in the detach list
+ * @deprecated Use of the detach list requires the unload event, which is planned to be removed
+ * in future browser updates. See notice on {@link #detachOnWindowClose(Widget)} and
+ * Issue 9908 for more information.
*/
+ @Deprecated
public static boolean isInDetachList(Widget widget) {
return widgetsToDetach.contains(widget);
}
- // Package-protected for use by unit tests. Do not call this method directly.
- static void detachWidgets() {
+ /**
+ * Detaches all widgets that were set to be detached on window close by a call to
+ * {@link #detachOnWindowClose}. Formerly was package-protected, now can be called by projects
+ * that required the old behavior and are willing to set up their own onclose handler on the
+ * window.
+ *
+ * Note that modern browsers do not have the memory leaks that originally required use of this
+ * feature - it is retained only to support application-specific detach events.
+ *
+ *
+ * @deprecated See notice on {@link #detachOnWindowClose(Widget)} and
+ * Issue 9908 for more information.
+ */
+ @Deprecated
+ public static void detachWidgets() {
// When the window is closing, detach all widgets that need to be
// cleaned up. This will cause all of their event listeners
// to be unhooked, which will avoid potential memory leaks.
@@ -258,15 +281,6 @@ private static native Element getRootElement() /*-{
return $doc;
}-*/;
- private static void hookWindowClosing() {
- // Catch the window closing event.
- Window.addCloseHandler(new CloseHandler() {
- public void onClose(CloseEvent closeEvent) {
- detachWidgets();
- }
- });
- }
-
/*
* Checks to see whether the given element has any parent element that
* belongs to a widget. This is not terribly efficient, and is thus only used
diff --git a/user/src/com/google/gwt/user/client/ui/SimpleCheckBox.java b/user/src/com/google/gwt/user/client/ui/SimpleCheckBox.java
index 2e493ba2f3f..0e71670717a 100644
--- a/user/src/com/google/gwt/user/client/ui/SimpleCheckBox.java
+++ b/user/src/com/google/gwt/user/client/ui/SimpleCheckBox.java
@@ -45,7 +45,7 @@ public class SimpleCheckBox extends FocusWidget implements HasName,
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/SimpleRadioButton.java b/user/src/com/google/gwt/user/client/ui/SimpleRadioButton.java
index 5d415fef058..4a7b8982420 100644
--- a/user/src/com/google/gwt/user/client/ui/SimpleRadioButton.java
+++ b/user/src/com/google/gwt/user/client/ui/SimpleRadioButton.java
@@ -36,7 +36,7 @@ public class SimpleRadioButton extends SimpleCheckBox {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/SubmitButton.java b/user/src/com/google/gwt/user/client/ui/SubmitButton.java
index 82a770e358e..199c3808eb2 100644
--- a/user/src/com/google/gwt/user/client/ui/SubmitButton.java
+++ b/user/src/com/google/gwt/user/client/ui/SubmitButton.java
@@ -39,7 +39,7 @@ public class SubmitButton extends Button {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/SuggestBox.java b/user/src/com/google/gwt/user/client/ui/SuggestBox.java
index c366ab79378..55fa3383290 100644
--- a/user/src/com/google/gwt/user/client/ui/SuggestBox.java
+++ b/user/src/com/google/gwt/user/client/ui/SuggestBox.java
@@ -635,7 +635,7 @@ public void setSuggestion(Suggestion suggestion) {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param oracle the suggest box oracle to use
* @param element the element to be wrapped
diff --git a/user/src/com/google/gwt/user/client/ui/TextArea.java b/user/src/com/google/gwt/user/client/ui/TextArea.java
index 0efdb67e7dc..e2f9e404502 100644
--- a/user/src/com/google/gwt/user/client/ui/TextArea.java
+++ b/user/src/com/google/gwt/user/client/ui/TextArea.java
@@ -52,7 +52,7 @@ public class TextArea extends TextBoxBase {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/TextBox.java b/user/src/com/google/gwt/user/client/ui/TextBox.java
index 0143c88666b..97d2dcbabf9 100644
--- a/user/src/com/google/gwt/user/client/ui/TextBox.java
+++ b/user/src/com/google/gwt/user/client/ui/TextBox.java
@@ -54,7 +54,7 @@ public class TextBox extends TextBoxBase {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/ValueBox.java b/user/src/com/google/gwt/user/client/ui/ValueBox.java
index 33b75e86017..08e1741858f 100644
--- a/user/src/com/google/gwt/user/client/ui/ValueBox.java
+++ b/user/src/com/google/gwt/user/client/ui/ValueBox.java
@@ -35,7 +35,7 @@ public class ValueBox extends ValueBoxBase {
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
*/
diff --git a/user/src/com/google/gwt/user/client/ui/ValueLabel.java b/user/src/com/google/gwt/user/client/ui/ValueLabel.java
index 9607da3c0d3..d5f4fe56f08 100644
--- a/user/src/com/google/gwt/user/client/ui/ValueLabel.java
+++ b/user/src/com/google/gwt/user/client/ui/ValueLabel.java
@@ -45,7 +45,7 @@ public class ValueLabel extends LabelBase implements TakesValue,
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
* @param renderer the renderer used to render values into the element
@@ -72,7 +72,7 @@ public static ValueLabel wrap(Element element,
*
* This element must already be attached to the document. If the element is
* removed from the document, you must call
- * {@link RootPanel#detachNow(Widget)}.
+ * {@link Widget#removeFromParent()}.
*
* @param element the element to be wrapped
* @param renderer the renderer used to render values into the element
diff --git a/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java b/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java
index febcb1a863e..be870671058 100644
--- a/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java
+++ b/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java
@@ -915,6 +915,19 @@ private static void generateSerializationSignature(Class> instanceType, CRC32
for (Enum> constant : constants) {
crc.update(constant.name().getBytes(StandardCharsets.UTF_8));
}
+ } else if (Enum.class.equals(instanceType)) {
+ // Edge case around Java 21 where a new non-final field was added to Enum. While the Enum
+ // class is rarely serialized itself (see the block above to deal with enum types), it can
+ // happen - this code ensures that the server always treats the Enum type the same way,
+ // regardless of JRE changes.
+ // See https://github.com/gwtproject/gwt/issues/9912
+ if (policy.shouldSerializeFinalFields()) {
+ crc.update("name".getBytes(StandardCharsets.UTF_8));
+ crc.update(getSerializedTypeName(String.class).getBytes(StandardCharsets.UTF_8));
+ crc.update("ordinal".getBytes(StandardCharsets.UTF_8));
+ crc.update(getSerializedTypeName(int.class).getBytes(StandardCharsets.UTF_8));
+ }
+ generateSerializationSignature(Object.class, crc, policy);
} else if (!instanceType.isPrimitive()) {
Field[] fields = applyFieldSerializationPolicy(instanceType, policy);
Set clientFieldNames = policy.getClientFieldNamesForEnhancedClass(instanceType);
diff --git a/user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java b/user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java
index 5e29935e368..bc9e5286842 100644
--- a/user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java
+++ b/user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java
@@ -48,11 +48,13 @@ public final class ServerSerializationStreamWriter extends
* array literals.
*/
public static class LengthConstrainedArray {
- public static final int MAXIMUM_ARRAY_LENGTH = 1 << 15;
+ public static final int MAXIMUM_ARRAY_LENGTH_DEFAULT = 1 << 15;
private static final String POSTLUDE = "])";
private static final String PRELUDE = "].concat([";
private final StringBuffer buffer;
+ private final int maximumArrayLength = Integer.getInteger("gwt.rpc.maxPayloadChunkSize",
+ MAXIMUM_ARRAY_LENGTH_DEFAULT);
private int count = 0;
private boolean needsComma = false;
private int total = 0;
@@ -68,8 +70,8 @@ public LengthConstrainedArray(int capacityGuess) {
public void addToken(CharSequence token) {
total++;
- if (count++ == MAXIMUM_ARRAY_LENGTH) {
- if (total == MAXIMUM_ARRAY_LENGTH + 1) {
+ if (count++ == maximumArrayLength) {
+ if (total == maximumArrayLength + 1) {
buffer.append(PRELUDE);
javascript = true;
} else {
@@ -106,7 +108,7 @@ public void setJavaScript(boolean javascript) {
@Override
public String toString() {
- if (total > MAXIMUM_ARRAY_LENGTH) {
+ if (total > maximumArrayLength) {
return "[" + buffer.toString() + POSTLUDE;
} else {
return "[" + buffer.toString() + "]";
@@ -343,7 +345,8 @@ abstract void write(ServerSerializationStreamWriter stream, Object instance)
* This exists to work around a Rhino parser bug in the hosted mode client
* that limits string node lengths to 64KB.
*/
- private static final int MAX_STRING_NODE_LENGTH = 0xFFFF;
+ private static final int MAX_STRING_NODE_LENGTH =
+ Integer.getInteger("gwt.rpc.maxStringNodeLength", 0xFFFF);
static {
/*
diff --git a/user/src/com/google/gwt/user/tools/WebAppCreator.java b/user/src/com/google/gwt/user/tools/WebAppCreator.java
index b787baaf97f..72126560b0d 100644
--- a/user/src/com/google/gwt/user/tools/WebAppCreator.java
+++ b/user/src/com/google/gwt/user/tools/WebAppCreator.java
@@ -24,7 +24,6 @@
import com.google.gwt.dev.util.collect.HashSet;
import com.google.gwt.user.tools.util.ArgHandlerIgnore;
import com.google.gwt.user.tools.util.ArgHandlerOverwrite;
-import com.google.gwt.user.tools.util.CreatorUtilities;
import com.google.gwt.util.tools.ArgHandlerExtra;
import com.google.gwt.util.tools.ArgHandlerFlag;
import com.google.gwt.util.tools.ArgHandlerOutDir;
@@ -180,7 +179,7 @@ public boolean addExtraArg(String arg) {
return false;
}
- if (!CreatorUtilities.isValidModuleName(arg)) {
+ if (!isValidModuleName(arg)) {
System.err.println("'"
+ arg
+ "' does not appear to be a valid fully-qualified Java class name.");
@@ -665,16 +664,8 @@ public Map getReplacements(String installPath, String theModuleN
return replacements;
}
- /**
- * Create the sample app.
- *
- * @throws IOException if any disk write fails
- * @throws WebAppCreatorException if any tag expansion of template processing fails
- * @deprecated as of GWT 2.1, replaced by {@link #doRun(String)}
- */
- @Deprecated
- protected void doRun() throws IOException, WebAppCreatorException {
- doRun(Utility.getInstallPath());
+ private static boolean isValidModuleName(String moduleName) {
+ return moduleName.matches("[\\w]+(\\.[\\w]+)+");
}
/**
diff --git a/user/src/com/google/gwt/user/tools/util/ArgHandlerAddToClassPath.java b/user/src/com/google/gwt/user/tools/util/ArgHandlerAddToClassPath.java
deleted file mode 100644
index 38331154f61..00000000000
--- a/user/src/com/google/gwt/user/tools/util/ArgHandlerAddToClassPath.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.user.tools.util;
-
-import com.google.gwt.util.tools.ArgHandlerString;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-/**
- * Parse the -addToClassPath argument. Appends a .jar or classpath to the
- * generated launch scripts.
- */
-public class ArgHandlerAddToClassPath extends ArgHandlerString {
- private List extraClassPathList = new ArrayList();
-
- public List getExtraClassPathList() {
- return extraClassPathList;
- }
-
- @Override
- public String getPurpose() {
- return "Adds extra elements to the class path.";
- }
-
- @Override
- public String getTag() {
- return "-addToClassPath";
- }
-
- @Override
- public String[] getTagArgs() {
- return new String[] {"classPathEntry"};
- }
-
- @Override
- public boolean setString(String str) {
-
- StringTokenizer st = new StringTokenizer(str, ",");
- while (st.hasMoreTokens()) {
- extraClassPathList.add(st.nextToken().trim());
- }
- return true;
- }
-}
diff --git a/user/src/com/google/gwt/user/tools/util/CreatorUtilities.java b/user/src/com/google/gwt/user/tools/util/CreatorUtilities.java
deleted file mode 100644
index 39d567bb7fd..00000000000
--- a/user/src/com/google/gwt/user/tools/util/CreatorUtilities.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.user.tools.util;
-
-import com.google.gwt.dev.cfg.ModuleDefLoader;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-/**
- * Utility methods used by ApplicationCreator.
- *
- */
-public class CreatorUtilities {
-
- /**
- * Create a PATH style string separated by the specified delimiter (';' for
- * windows, ':' for UNIX) Note that this method prepends the delimiter to the
- * front of the string. There is an existing path we want to append to.
- *
- * @param delimiter The delimiter string to place between variables.
- * @param paths The list of paths to concatenate together.
- * @return the concatenated list of paths as a single string.
- */
- public static String appendPaths(String delimiter, List paths) {
- if (paths == null) {
- return "";
- }
- StringBuilder buf = new StringBuilder();
- for (String value : paths) {
- buf.append(delimiter);
- buf.append(value);
- }
- return buf.toString();
- }
-
- /**
- * Create the extra path entries for an Eclipse '.launch' file in XML format.
- *
- * @param extraClassPaths a list of paths/.jar files to add to the class path
- * @return A string formatted to include in the .launch file
- */
- public static String createEclipseExtraLaunchPaths(
- List extraClassPaths) throws FileNotFoundException {
-
- if (extraClassPaths == null) {
- return "";
- }
-
- // Create an entry for an Eclipse launch file additional classpath entry.
- StringBuilder buf = new StringBuilder();
- for (String path : extraClassPaths) {
- File f = new File(path);
-
- if (!f.exists()) {
- throw new FileNotFoundException("extraClassPath: " + path
- + "Must be present before .launch file can be created");
- }
-
- String lcPath = path.toLowerCase(Locale.ROOT);
-
- if (f.isDirectory()) {
- // For a directory, we assume it contains compiled class files
- buf.append("");
- buf.append("\n");
- } else if (lcPath.endsWith(".jar") || lcPath.endsWith(".zip")) {
- // Any plain file we assume is an external library (e.g. a .jar file)
- buf.append("");
- buf.append("\n");
- } else {
- throw new RuntimeException("Don't know how to handle path: " + path
- + ". It doesn't appear to be a directory or a .jar/.zip file");
- }
- }
- return buf.toString();
- }
-
- /**
- * Returns true if moduleName is a valid module
- * name.
- */
- public static boolean isValidModuleName(String moduleName) {
- return moduleName.matches("[\\w]+(\\.[\\w]+)+");
- }
-
- /**
- * Check to see that the userJar and pathList files all exist, and that the
- * moduleList entries can be found within the jars.
- *
- * @param userJar The full path to gwt-user.jar
- * @param pathList A list of jar files to add to the class path.
- * @param moduleList A list of GWT module names to add as 'inherits' tags
- * @return true if all validations pass.
- */
- public static boolean validatePathsAndModules(String userJar,
- List pathList, List moduleList) {
- List urlList = new ArrayList();
-
- if (!addURL(urlList, userJar)) {
- return false;
- }
- if (pathList != null) {
- for (String path : pathList) {
- if (!addURL(urlList, path)) {
- return false;
- }
- }
- }
-
- /*
- * Create a class loader from the extra class paths and the current class
- * loader. The assumption is that if the userJar isn't available right now,
- * that the current class loader will contain the same gwt.xml module def
- * files.
- */
- final URL urlArray[] = urlList.toArray(new URL[urlList.size()]);
- URLClassLoader classLoader = AccessController.doPrivileged(
- new PrivilegedAction() {
- public URLClassLoader run() {
- return new URLClassLoader(urlArray,
- CreatorUtilities.class.getClassLoader());
- }
- });
- if (moduleList != null) {
- for (String module : moduleList) {
- String modulePath = module.replace(".", "/")
- + ModuleDefLoader.GWT_MODULE_XML_SUFFIX;
- URL found = classLoader.getResource(modulePath);
- if (found == null) {
- System.err.println("Couldn't find module definition file "
- + modulePath + " in class path.");
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * Append a path to a list of URLs.
- *
- * @param urls list to append to
- * @param pathToAdd string to append as the last entry in the URL list.
- * @return true on success. false if an error
- * occurs (malformed URL or missing file.)
- */
- private static boolean addURL(List urls, String pathToAdd) {
- File f = new File(pathToAdd);
-
- // Ignore gwt-user.jar in the validation. This helps the build process
- // get by when overriding the location of the .jar with -Dgwt.devjar
- if (!pathToAdd.matches(".*gwt-user.jar") && !f.exists()) {
- System.err.println("Couldn't find library file or path " + pathToAdd);
- return false;
- }
- try {
- urls.add(f.toURI().toURL());
- } catch (MalformedURLException urlEx) {
- urlEx.printStackTrace();
- return false;
- }
- return true;
- }
-}
diff --git a/user/src/com/google/gwt/view/client/DefaultSelectionModel.java b/user/src/com/google/gwt/view/client/DefaultSelectionModel.java
index 588d1c71dcf..f7ac705102f 100644
--- a/user/src/com/google/gwt/view/client/DefaultSelectionModel.java
+++ b/user/src/com/google/gwt/view/client/DefaultSelectionModel.java
@@ -123,6 +123,7 @@ protected Map