Cherry picking bug fixes from trunk into release branch: 982801, 986802, 990801, 971801, 976802.
git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/2.1@9051 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/core/ext/linker/SymbolData.java b/dev/core/src/com/google/gwt/core/ext/linker/SymbolData.java
index a3d0f90..368acec 100644
--- a/dev/core/src/com/google/gwt/core/ext/linker/SymbolData.java
+++ b/dev/core/src/com/google/gwt/core/ext/linker/SymbolData.java
@@ -81,7 +81,7 @@
}
/**
- * Returns a JSON map of castableTypes
+ * Returns a JSON map of castableTypes.
*/
CastableTypeMap getCastableTypeMap();
diff --git a/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java b/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java
index b0cca42..c701dfb 100644
--- a/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java
+++ b/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java
@@ -494,7 +494,7 @@
}
/**
- * @Deprecated This method will always return 0 because a TypeOracle never
+ * @deprecated This method will always return 0 because a TypeOracle never
* gets reloaded anymore. Callers should not rely on this value to
* manage static state.
*/
diff --git a/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java b/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java
index 861091c..eeea37e 100644
--- a/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java
+++ b/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java
@@ -66,7 +66,7 @@
protected byte[] generatePrimaryFragment(TreeLogger logger,
LinkerContext context, CompilationResult result, String[] js) {
TextOutput script = new DefaultTextOutput(context.isOutputCompact());
- script.print(getModulePrefix(context, result.getStrongName(), js.length > 1));
+ script.print(getModulePrefix(context, result.getStrongName()));
script.print(js[0]);
script.print(getModuleSuffix(logger, context));
StringBuffer out = new StringBuffer();
@@ -194,8 +194,7 @@
return "com/google/gwt/core/linker/CrossSiteIframeTemplate.js";
}
- private String getModulePrefix(LinkerContext context, String strongName,
- boolean supportRunAsync) {
+ private String getModulePrefix(LinkerContext context, String strongName) {
TextOutput out = new DefaultTextOutput(context.isOutputCompact());
out.print("var __gwtModuleFunction = $wnd." + context.getModuleFunctionName() + ";");
out.newlineOpt();
diff --git a/dev/core/src/com/google/gwt/dev/Precompile.java b/dev/core/src/com/google/gwt/dev/Precompile.java
index 5b11870..2febeac 100644
--- a/dev/core/src/com/google/gwt/dev/Precompile.java
+++ b/dev/core/src/com/google/gwt/dev/Precompile.java
@@ -388,6 +388,7 @@
setDaemon(true);
}
+ @Override
public void run() {
SpeedTracerLogger.Event createGraphicsEvent = SpeedTracerLogger.start(
CompilerEventType.GRAPHICS_INIT, "java.awt.headless",
diff --git a/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java b/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java
index 34f2223..572f539 100644
--- a/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java
+++ b/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java
@@ -638,22 +638,28 @@
}
}
- @SuppressWarnings("unused")
- // overrider may use unused parameter
+ /**
+ * @param logger a {@link TreeLogger}
+ * @param cud a {@link CompilationUnitDeclaration}
+ */
protected String[] doFindAdditionalTypesUsingArtificialRescues(
TreeLogger logger, CompilationUnitDeclaration cud) {
return Empty.STRINGS;
}
- @SuppressWarnings("unused")
- // overrider may use unused parameter
+ /**
+ * @param logger a {@link TreeLogger}
+ * @param cud a {@link CompilationUnitDeclaration}
+ */
protected String[] doFindAdditionalTypesUsingJsni(TreeLogger logger,
CompilationUnitDeclaration cud) {
return Empty.STRINGS;
}
- @SuppressWarnings("unused")
- // overrider may use unused parameter
+ /**
+ * @param logger a {@link TreeLogger}
+ * @param cud a {@link CompilationUnitDeclaration}
+ */
protected String[] doFindAdditionalTypesUsingRebinds(TreeLogger logger,
CompilationUnitDeclaration cud) {
return Empty.STRINGS;
diff --git a/dev/core/src/com/google/gwt/dev/jdt/TypeRefVisitor.java b/dev/core/src/com/google/gwt/dev/jdt/TypeRefVisitor.java
index 3894777..b1c3a88 100644
--- a/dev/core/src/com/google/gwt/dev/jdt/TypeRefVisitor.java
+++ b/dev/core/src/com/google/gwt/dev/jdt/TypeRefVisitor.java
@@ -153,7 +153,11 @@
return true;
}
- @SuppressWarnings("unused")
+ /**
+ * @param referencedType
+ * @param unitOfReferrer
+ * @param expression
+ */
protected void onBinaryTypeRef(BinaryTypeBinding referencedType,
CompilationUnitDeclaration unitOfReferrer, Expression expression) {
}
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
index e324a30..923734f 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
@@ -248,6 +248,7 @@
this.childClass = childClass;
}
+ @Override
public boolean equals(Object obj) {
if (obj instanceof MethodKey) {
MethodKey otherKey = (MethodKey) obj;
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/OptimizerStats.java b/dev/core/src/com/google/gwt/dev/jjs/impl/OptimizerStats.java
index 9cf7e6b..60611f2 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/OptimizerStats.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/OptimizerStats.java
@@ -88,7 +88,7 @@
}
/**
- * Return a human readable string representing the values of all statistics
+ * Return a human-readable string representing the values of all statistics.
*/
public String prettyPrint() {
StringBuilder builder = new StringBuilder();
diff --git a/dev/core/src/com/google/gwt/dev/json/JsonObject.java b/dev/core/src/com/google/gwt/dev/json/JsonObject.java
index a5b9fe5..34a01ce 100644
--- a/dev/core/src/com/google/gwt/dev/json/JsonObject.java
+++ b/dev/core/src/com/google/gwt/dev/json/JsonObject.java
@@ -75,7 +75,7 @@
int c = tokenizer.nextNonWhitespace();
if (c != '{') {
throw new JsonException("Payload does not begin with '{'. Got " + c + "("
- + Character.valueOf((char)c) + ")");
+ + Character.valueOf((char) c) + ")");
}
while (true) {
diff --git a/dev/core/src/com/google/gwt/dev/json/JsonValue.java b/dev/core/src/com/google/gwt/dev/json/JsonValue.java
index 9d37d7b..a6f827b 100644
--- a/dev/core/src/com/google/gwt/dev/json/JsonValue.java
+++ b/dev/core/src/com/google/gwt/dev/json/JsonValue.java
@@ -25,7 +25,7 @@
/**
* JSON placeholder for null.
*/
- final JsonValue NULL = new JsonValue() {
+ JsonValue NULL = new JsonValue() {
public JsonArray asArray() {
return null;
diff --git a/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java b/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java
index b746913..e899f0e 100644
--- a/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java
+++ b/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java
@@ -49,7 +49,9 @@
@Override
public String getLocation() {
+ // CHECKSTYLE_OFF
return "jar:" + classPathEntry.getLocation() + "!/" + path;
+ // CHECKSTYLE_ON
}
@Override
diff --git a/dev/core/src/com/google/gwt/dev/shell/ModuleSpace.java b/dev/core/src/com/google/gwt/dev/shell/ModuleSpace.java
index 4987dc2..2246977 100644
--- a/dev/core/src/com/google/gwt/dev/shell/ModuleSpace.java
+++ b/dev/core/src/com/google/gwt/dev/shell/ModuleSpace.java
@@ -361,7 +361,6 @@
// Try to initialize EntryPoint, else throw up glass panel
try {
Class<?> clazz = loadClassFromSourceName(entryPointTypeName);
- onModuleLoad = null;
try {
onModuleLoad = clazz.getMethod("onModuleLoad");
if (!Modifier.isStatic(onModuleLoad.getModifiers())) {
diff --git a/dev/core/src/com/google/gwt/dev/util/editdistance/CharIndex.java b/dev/core/src/com/google/gwt/dev/util/editdistance/CharIndex.java
index 097ccb5..3e76d4d 100644
--- a/dev/core/src/com/google/gwt/dev/util/editdistance/CharIndex.java
+++ b/dev/core/src/com/google/gwt/dev/util/editdistance/CharIndex.java
@@ -47,13 +47,13 @@
*/
public static class FullHash extends CharIndex {
/**
- * Mutable holder for a character
+ * Mutable holder for a character.
*/
static class Char {
char c;
@Override
public boolean equals(Object x) {
- return (x != null) && (((Char)x).c == this.c);
+ return (x != null) && (((Char) x).c == this.c);
}
@Override
public int hashCode() {
@@ -68,12 +68,12 @@
static final int NULL_ELEMENT = 0;
protected int lastUsed = NULL_ELEMENT;
/**
- * Mapping from pattern characters to their integer index values
+ * Mapping from pattern characters to their integer index values.
*/
final java.util.HashMap<Char,Integer> map;
/**
- * Constructs a full hash-based mapping
+ * Constructs a full hash-based mapping.
*/
FullHash(CharSequence s) {
/* Choose a hash size larger at least twice the string length */
@@ -148,21 +148,20 @@
*/
public static class Masked extends CharIndex {
/**
- * Hash table size
+ * Hash table size.
*/
static final int SIZE = 0x100;
/**
- * Mask used for hashing
+ * Mask used for hashing.
*/
static final int MASK = (SIZE - 1);
/**
- * Where we may invalid characters: beyond the hash table
+ * Where we may invalid characters: beyond the hash table.
*/
static final int NULL_ELEMENT = SIZE;
-
/**
* Generates an instance of this implementation if possible.
* @param s pattern string
@@ -177,7 +176,7 @@
char [] contains = new char[SIZE];
/* Ensure that for all x, hash(contains[x]) != x initially. */
- contains[0] = (char)1;
+ contains[0] = (char) 1;
/* Hash characters, recording values seen, rejecting collisions */
for (int i = 0; i < s.length(); i++) {
@@ -200,7 +199,7 @@
final char[] contains;
/**
- * Constructor based on hash table built by generate()
+ * Constructor based on hash table built by generate().
*/
private Masked(char [] contains) {
this.contains = contains;
@@ -215,7 +214,9 @@
@Override
public int[] map(CharSequence s, int[] mapped) {
int len = s.length();
- if (mapped.length < len) mapped = new int[len];
+ if (mapped.length < len) {
+ mapped = new int[len];
+ }
for (int i = 0; i < len; i++) {
char c = s.charAt(i);
int index = c & MASK;
@@ -238,21 +239,20 @@
*/
public static class Straight extends CharIndex {
/**
- * The largest character we will map (directly)
+ * The largest character we will map (directly).
*/
static final int MAX = 0x80;
/**
- * A mask used to find characters that fall outside
+ * A mask used to find characters that fall outside.
*/
static final int MASK = ~(MAX - 1);
/**
- * A map result we never generate for valid characters
+ * A map result we never generate for valid characters.
*/
static final int NULL_ELEMENT = MAX;
-
/**
* Generates an instance of this implementation if possible.
* @param s pattern string
@@ -271,7 +271,7 @@
}
/**
- * Simple private constructor, no state required
+ * Simple private constructor, no state required.
*/
private Straight() { }
@@ -283,7 +283,9 @@
@Override
public int[] map(CharSequence s, int[] mapped) {
int len = s.length();
- if (mapped.length < len) mapped = new int[len];
+ if (mapped.length < len) {
+ mapped = new int[len];
+ }
for (int i = 0; i < len; i++) {
char c = s.charAt(i);
mapped[i] = ((c & MASK) == 0) ? c : NULL_ELEMENT;
diff --git a/dev/core/src/com/google/gwt/dev/util/editdistance/GeneralEditDistances.java b/dev/core/src/com/google/gwt/dev/util/editdistance/GeneralEditDistances.java
index 32ebde2..2dcfae5 100644
--- a/dev/core/src/com/google/gwt/dev/util/editdistance/GeneralEditDistances.java
+++ b/dev/core/src/com/google/gwt/dev/util/editdistance/GeneralEditDistances.java
@@ -58,22 +58,22 @@
*/
private static class Levenshtein implements GeneralEditDistance {
/**
- * Long+bounded implementation class: distance-only Berghel-Roach
+ * Long+bounded implementation class: distance-only Berghel-Roach.
*/
private ModifiedBerghelRoachEditDistance berghel;
/**
- * Short/unbounded implementation class: Myers bit-parallel
+ * Short/unbounded implementation class: Myers bit-parallel.
*/
private MyersBitParallelEditDistance myers;
/**
- * Saved pattern, for specialized comparisons
+ * Saved pattern, for specialized comparisons.
*/
private final CharSequence pattern;
/**
- * Length of saved pattern
+ * Length of saved pattern.
*/
private final int patternLength;
diff --git a/dev/core/src/com/google/gwt/dev/util/editdistance/ModifiedBerghelRoachEditDistance.java b/dev/core/src/com/google/gwt/dev/util/editdistance/ModifiedBerghelRoachEditDistance.java
index de61af5..b305b30 100644
--- a/dev/core/src/com/google/gwt/dev/util/editdistance/ModifiedBerghelRoachEditDistance.java
+++ b/dev/core/src/com/google/gwt/dev/util/editdistance/ModifiedBerghelRoachEditDistance.java
@@ -209,7 +209,7 @@
private int[] lastRight = EMPTY_INT_ARRAY;
/**
- * The "pattern" string against which others are compared
+ * The "pattern" string against which others are compared.
*/
private final char[] pattern;
@@ -320,7 +320,6 @@
immediateRight);
}
-
/*
* Lower-numbered diagonals
*/
diff --git a/dev/core/src/com/google/gwt/dev/util/editdistance/MyersBitParallelEditDistance.java b/dev/core/src/com/google/gwt/dev/util/editdistance/MyersBitParallelEditDistance.java
index 9e02ebd..febd160 100644
--- a/dev/core/src/com/google/gwt/dev/util/editdistance/MyersBitParallelEditDistance.java
+++ b/dev/core/src/com/google/gwt/dev/util/editdistance/MyersBitParallelEditDistance.java
@@ -15,7 +15,6 @@
*/
package com.google.gwt.dev.util.editdistance;
-
/**
* Computes Levenshtein string-edit distance using the
* algorithm of Eugene Myers (see "A fast bit-vector algorithm for
@@ -136,7 +135,7 @@
*/
/**
- * A trivial implementation for the zero-length string
+ * A trivial implementation for the zero-length string.
*/
static class Empty extends MyersBitParallelEditDistance {
Empty(CharSequence s) {
@@ -166,12 +165,12 @@
int count;
/**
- * Where the last-row bit lives -- only in the last array slot, though
+ * Where the last-row bit lives -- only in the last array slot, though.
*/
final int lastBitPosition;
/**
- * Bitmaps for pattern string: [pattern_index][column_index]
+ * Bitmaps for pattern string: [pattern_index][column_index].
*/
final int[][] positions;
@@ -180,17 +179,17 @@
int[] verticalPositivesReusable;
/**
- * A mask with those bits set
+ * A mask with those bits set.
*/
final int wordMask = (-1 >>> 1);
/**
- * How many bits we use per word
+ * How many bits we use per word.
*/
final int wordSize = Integer.SIZE - 1;
/**
- * Constructs a multi-word engine
+ * Constructs a multi-word engine.
*/
Multi(CharSequence s) {
super(s);
@@ -223,7 +222,9 @@
/* We can only miss the distance-- below this many times: */
int maxMisses = k + len - m;
- if (maxMisses < 0) maxMisses = Integer.MAX_VALUE;
+ if (maxMisses < 0) {
+ maxMisses = Integer.MAX_VALUE;
+ }
outer:
for (int j = 0; j < len; j++) {
@@ -311,7 +312,7 @@
/* Precompute bitmaps for this pattern */
map = PatternBitmap.map(s, idx, new int/*WORD*/[idx.size()]);
/* Compute the bit that represents a change in the last row */
- lastBitPosition = (((int/*WORD*/)1) << (m - 1));
+ lastBitPosition = (((int/*WORD*/) 1) << (m - 1));
}
@Override
@@ -319,8 +320,9 @@
int len = s.length();
/* Quick check based on length */
- if (((len - m) > k) || ((m - len) > k))
+ if (((len - m) > k) || ((m - len) > k)) {
return k + 1;
+ }
/* Map characters to their integer positions in the bitmap array */
indices = idx.map(s, indices);
@@ -332,7 +334,9 @@
/* We can only miss the "distance--" below this many times: */
int maxMisses = k + len - m;
- if (maxMisses < 0) maxMisses = Integer.MAX_VALUE;
+ if (maxMisses < 0) {
+ maxMisses = Integer.MAX_VALUE;
+ }
for (int j = 0; j < len; j++) {
/* Where is diagonal zero: matches, or prior VN; plus recursion */
@@ -376,13 +380,12 @@
final long/*WORD*/ lastBitPosition;
final long/*WORD*/[] map;
- @SuppressWarnings("cast")
TYPElong/*WORD*/(CharSequence s) {
super(s);
/* Precompute bitmaps for this pattern */
map = PatternBitmap.map(s, idx, new long/*WORD*/[idx.size()]);
/* Compute the bit that represents a change in the last row */
- lastBitPosition = (((long/*WORD*/)1) << (m - 1));
+ lastBitPosition = (((long/*WORD*/) 1) << (m - 1));
}
@Override
@@ -390,8 +393,9 @@
int len = s.length();
/* Quick check based on length */
- if (((len - m) > k) || ((m - len) > k))
+ if (((len - m) > k) || ((m - len) > k)) {
return k + 1;
+ }
/* Map characters to their integer positions in the bitmap array */
indices = idx.map(s, indices);
@@ -403,7 +407,9 @@
/* We can only miss the "distance--" below this many times: */
int maxMisses = k + len - m;
- if (maxMisses < 0) maxMisses = Integer.MAX_VALUE;
+ if (maxMisses < 0) {
+ maxMisses = Integer.MAX_VALUE;
+ }
for (int j = 0; j < len; j++) {
/* Where is diagonal zero: matches, or prior VN; plus recursion */
@@ -453,7 +459,7 @@
}
/**
- * Tests a computation manually
+ * Tests a computation manually.
*/
public static void main(String[] args) {
MyersBitParallelEditDistance b = getInstance(args[0]);
@@ -462,22 +468,22 @@
}
/**
- * Index mapping for pattern string
+ * Index mapping for pattern string.
*/
final CharIndex idx;
/**
- * Reusable array of indices for target strings
+ * Reusable array of indices for target strings.
*/
int[] indices = new int[0];
/**
- * Length of pattern
+ * Length of pattern.
*/
final int m;
/**
- * Constructs a distance calculator for a given string
+ * Constructs a distance calculator for a given string.
*/
protected MyersBitParallelEditDistance(CharSequence s) {
m = s.length();
@@ -486,7 +492,7 @@
public GeneralEditDistance duplicate() {
try {
- return (MyersBitParallelEditDistance)clone();
+ return (MyersBitParallelEditDistance) clone();
} catch (CloneNotSupportedException x) { /*IMPOSSIBLE */
throw new IllegalStateException("Cloneable object would not clone");
}
@@ -494,7 +500,7 @@
/**
* Computes distance from the pattern to a given string, bounded by
- * a limiting distance @see(GeneralEditDistance.getDistance(CharSequence,int))
+ * a limiting distance @see(GeneralEditDistance.getDistance(CharSequence,int)).
*/
public abstract int getDistance(CharSequence s, int k);
@@ -503,13 +509,13 @@
Object obj = super.clone();
/* Re-initialize any non-thread-safe parts */
- ((MyersBitParallelEditDistance)obj).perThreadInit();
+ ((MyersBitParallelEditDistance) obj).perThreadInit();
return obj;
}
/**
- * Initializes items that cannot be shared among threads
+ * Initializes items that cannot be shared among threads.
*/
protected void perThreadInit() {
indices = new int[0];
diff --git a/dev/core/src/com/google/gwt/dev/util/editdistance/PatternBitmap.java b/dev/core/src/com/google/gwt/dev/util/editdistance/PatternBitmap.java
index 5ee1733..9ee8454 100644
--- a/dev/core/src/com/google/gwt/dev/util/editdistance/PatternBitmap.java
+++ b/dev/core/src/com/google/gwt/dev/util/editdistance/PatternBitmap.java
@@ -15,7 +15,6 @@
*/
package com.google.gwt.dev.util.editdistance;
-
/**
* A bitmap array generator for the positions that a given character
* appears within a pattern. The array of bitmaps is indexed by a
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java
index d7a7718..6e36f94 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java
@@ -100,12 +100,12 @@
}
@UiHandler("cancel")
- void onCancel(ClickEvent e) {
+ void onCancel(@SuppressWarnings("unused") ClickEvent event) {
dialog.hide();
}
@UiHandler("save")
- void onSave(ClickEvent e) {
+ void onSave(@SuppressWarnings("unused") ClickEvent event) {
// MOVE TO ACTIVITY END
RequestContext context = editorDriver.flush();
if (editorDriver.hasErrors()) {
@@ -127,7 +127,7 @@
}
@UiHandler("favorite")
- void onValueChanged(ValueChangeEvent<Boolean> event) {
+ void onValueChanged(@SuppressWarnings("unused") ValueChangeEvent<Boolean> event) {
manager.setFavorite(person, favorite.getValue());
}
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/MentorSelector.java b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/MentorSelector.java
index b48101f..7925ceb 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/MentorSelector.java
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/MentorSelector.java
@@ -74,7 +74,7 @@
}
@UiHandler("choose")
- void onChoose(ClickEvent event) {
+ void onChoose(@SuppressWarnings("unused") ClickEvent event) {
setEnabled(false);
factory.schoolCalendarRequest().getRandomPerson().to(
new Receiver<PersonProxy>() {
@@ -87,7 +87,7 @@
}
@UiHandler("clear")
- void onClear(ClickEvent event) {
+ void onClear(@SuppressWarnings("unused") ClickEvent event) {
setValue(null);
}
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
index a71dc9b..348d2f2 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
@@ -162,8 +162,8 @@
fetch(0);
}
- @UiHandler("create")
- void onCreate(ClickEvent event) {
+ @UiHandler("create")
+ void onCreate(@SuppressWarnings("unused") ClickEvent event) {
PersonRequest context = requestFactory.personRequest();
AddressProxy address = context.create(AddressProxy.class);
PersonProxy person = context.edit(context.create(PersonProxy.class));
diff --git a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.ui.xml b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.ui.xml
index f7e7269..77398a0 100644
--- a/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.ui.xml
+++ b/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.ui.xml
@@ -9,6 +9,10 @@
.thirty {
width: 30%
}
+
+ .table {
+ width: 100%;
+ }
</ui:style>
<g:DockLayoutPanel ui:field="dock" unit="EX">
<g:north size="6">
@@ -29,7 +33,7 @@
</g:DockLayoutPanel>
</g:north>
<g:center>
- <cv:CellTable ui:field="table" />
+ <cv:CellTable ui:field="table" stylePrimaryName="{style.table}" />
</g:center>
</g:DockLayoutPanel>
</ui:UiBinder>
\ No newline at end of file
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseDetails.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseDetails.java
index 0cff56c..a37c2fc 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseDetails.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseDetails.java
@@ -43,7 +43,6 @@
import com.google.gwt.requestfactory.shared.EntityProxyChange;
import com.google.gwt.requestfactory.shared.EntityProxyId;
import com.google.gwt.requestfactory.shared.Receiver;
-import com.google.gwt.requestfactory.shared.Request;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobileShell.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobileShell.java
index cd848fc..f436c50 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobileShell.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpensesMobileShell.java
@@ -76,26 +76,22 @@
}
@UiHandler("addButton")
- @SuppressWarnings("unused")
- void onAdd(ClickEvent evt) {
+ void onAdd(@SuppressWarnings("unused") ClickEvent evt) {
topPage().onAdd();
}
@UiHandler("backButton")
- @SuppressWarnings("unused")
- void onBack(ClickEvent evt) {
+ void onBack(@SuppressWarnings("unused") ClickEvent evt) {
popPage();
}
@UiHandler("customButton")
- @SuppressWarnings("unused")
- void onCustom(ClickEvent evt) {
+ void onCustom(@SuppressWarnings("unused") ClickEvent evt) {
topPage().onCustom();
}
@UiHandler("refreshButton")
- @SuppressWarnings("unused")
- void onRefresh(ClickEvent evt) {
+ void onRefresh(@SuppressWarnings("unused") ClickEvent evt) {
topPage().onRefresh(true);
}
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseEntry.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseEntry.java
index 20721a1..5aeddba 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseEntry.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileExpenseEntry.java
@@ -52,6 +52,7 @@
private ExpenseProxy expense;
private final ExpensesRequestFactory requestFactory;
+ @SuppressWarnings("unused")
private final Listener listener;
private ExpenseRequest request;
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportEntry.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportEntry.java
index 80e562f..96194e5 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportEntry.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/MobileReportEntry.java
@@ -57,6 +57,7 @@
private ReportProxy report;
private final ExpensesRequestFactory requestFactory;
+ @SuppressWarnings("unused")
private final Listener listener;
private ReportRequest request;
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Employee.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Employee.java
index bc57930..de7b073 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Employee.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Employee.java
@@ -141,6 +141,7 @@
private Integer version;
@Transient
+ @SuppressWarnings("unused")
private Employee supervisor;
public String getDepartment() {
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Expense.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Expense.java
index 553c25d..f9ee1e2 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Expense.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Expense.java
@@ -110,6 +110,7 @@
private String reasonDenied;
@Transient
+ @SuppressWarnings("unused")
private Report report;
// @JoinColumn
diff --git a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Report.java b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Report.java
index 5f28680..2975080 100644
--- a/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Report.java
+++ b/samples/expenses/src/main/java/com/google/gwt/sample/expenses/server/domain/Report.java
@@ -338,9 +338,11 @@
}
@Transient
+ @SuppressWarnings("unused")
private Employee approvedSupervisor;
@Transient
+ @SuppressWarnings("unused")
private Employee reporter;
// @JoinColumn
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellList.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellList.java
index 6df55c7..956e31d 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellList.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellList.java
@@ -33,6 +33,7 @@
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.cellview.client.CellList;
import com.google.gwt.user.cellview.client.HasKeyboardPagingPolicy.KeyboardPagingPolicy;
+import com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy.KeyboardSelectionPolicy;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Button;
@@ -174,6 +175,7 @@
ContactDatabase.ContactInfo.KEY_PROVIDER);
cellList.setPageSize(30);
cellList.setKeyboardPagingPolicy(KeyboardPagingPolicy.INCREASE_RANGE);
+ cellList.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.BOUND_TO_SELECTION);
// Add a selection model so we can select cells.
final SingleSelectionModel<ContactInfo> selectionModel = new SingleSelectionModel<ContactInfo>(
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.ui.xml b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.ui.xml
index 6dded2d..c8b9518 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.ui.xml
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellTable.ui.xml
@@ -6,7 +6,6 @@
<ui:style>
.cellTable {
- height: 400px;
width: 600px;
border: 1px solid #ccc;
text-align: left;
diff --git a/user/src/com/google/gwt/activity/shared/Activity.java b/user/src/com/google/gwt/activity/shared/Activity.java
index e092e3f..a197523 100644
--- a/user/src/com/google/gwt/activity/shared/Activity.java
+++ b/user/src/com/google/gwt/activity/shared/Activity.java
@@ -53,7 +53,7 @@
/**
* Called when the Activity should ready its widget for the user. When the
* widget is ready (typically after an RPC response has been received),
- * receiver should present it by calling {@link AcceptsOneWidget#setWidget()}
+ * receiver should present it by calling {@link AcceptsOneWidget#setWidget}
* on the given panel.
* <p>
* Any handlers attached to the provided event bus will be de-registered when
diff --git a/user/src/com/google/gwt/animation/client/Animation.java b/user/src/com/google/gwt/animation/client/Animation.java
index 40bae9a..bb3da8b 100644
--- a/user/src/com/google/gwt/animation/client/Animation.java
+++ b/user/src/com/google/gwt/animation/client/Animation.java
@@ -138,7 +138,7 @@
// Add to the list of animations
// We use a static list of animations and a single timer, and create them
- // only if we are the only active animation. This is safe since JS is
+ // only if we are the only active animation. This is safe since JS is
// single-threaded.
if (animations == null) {
animations = new ArrayList<Animation>();
diff --git a/user/src/com/google/gwt/cell/client/ImageLoadingCell.java b/user/src/com/google/gwt/cell/client/ImageLoadingCell.java
index a22763f..10c1a24 100644
--- a/user/src/com/google/gwt/cell/client/ImageLoadingCell.java
+++ b/user/src/com/google/gwt/cell/client/ImageLoadingCell.java
@@ -81,7 +81,7 @@
private static Template template;
/**
- * The default {@link Renderers}.
+ * The default {@link SafeHtmlRenderer SafeHtmlRenderers}.
*/
public static class DefaultRenderers implements Renderers {
@@ -149,7 +149,7 @@
/**
* Construct an {@link ImageResourceCell} using the specified
- * {@link Renderers}.
+ * {@link SafeHtmlRenderer SafeHtmlRenderers}.
*
*/
public ImageLoadingCell(Renderers renderers) {
diff --git a/user/src/com/google/gwt/core/client/Scheduler.java b/user/src/com/google/gwt/core/client/Scheduler.java
index ef6a090..7fceb6f 100644
--- a/user/src/com/google/gwt/core/client/Scheduler.java
+++ b/user/src/com/google/gwt/core/client/Scheduler.java
@@ -21,6 +21,8 @@
* This class provides low-level task scheduling primitives. Any exceptions
* thrown by the command objects executed by the scheduler will be passed to the
* {@link GWT.UncaughtExceptionHandler} if one is installed.
+ *
+ * @see com.google.gwt.core.client.testing.StubScheduler
*/
public abstract class Scheduler {
diff --git a/user/src/com/google/gwt/core/client/testing/StubScheduler.java b/user/src/com/google/gwt/core/client/testing/StubScheduler.java
new file mode 100644
index 0000000..c59fc1a
--- /dev/null
+++ b/user/src/com/google/gwt/core/client/testing/StubScheduler.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2010 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.core.client.testing;
+
+import com.google.gwt.core.client.Scheduler;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A no-op implementation of Scheduler that simply records its arguments.
+ */
+public class StubScheduler extends Scheduler {
+ private final List<RepeatingCommand> repeatingCommands = new ArrayList<RepeatingCommand>();
+
+ private final List<ScheduledCommand> scheduledCommands = new ArrayList<ScheduledCommand>();
+
+ /**
+ * Returns the RepeatingCommands that have been passed into the MockScheduler.
+ */
+ public List<RepeatingCommand> getRepeatingCommands() {
+ return repeatingCommands;
+ }
+
+ /**
+ * Returns the ScheduledCommands that have been passed into the MockScheduler.
+ */
+ public List<ScheduledCommand> getScheduledCommands() {
+ return scheduledCommands;
+ }
+
+ @Override
+ public void scheduleDeferred(ScheduledCommand cmd) {
+ scheduledCommands.add(cmd);
+ }
+
+ @Override
+ public void scheduleEntry(RepeatingCommand cmd) {
+ repeatingCommands.add(cmd);
+ }
+
+ @Override
+ public void scheduleEntry(ScheduledCommand cmd) {
+ scheduledCommands.add(cmd);
+ }
+
+ @Override
+ public void scheduleFinally(RepeatingCommand cmd) {
+ repeatingCommands.add(cmd);
+ }
+
+ @Override
+ public void scheduleFinally(ScheduledCommand cmd) {
+ scheduledCommands.add(cmd);
+ }
+
+ @Override
+ public void scheduleFixedDelay(RepeatingCommand cmd, int delayMs) {
+ repeatingCommands.add(cmd);
+ }
+
+ @Override
+ public void scheduleFixedPeriod(RepeatingCommand cmd, int delayMs) {
+ repeatingCommands.add(cmd);
+ }
+
+ @Override
+ public void scheduleIncremental(RepeatingCommand cmd) {
+ repeatingCommands.add(cmd);
+ }
+}
diff --git a/user/src/com/google/gwt/editor/client/AutoBean.java b/user/src/com/google/gwt/editor/client/AutoBean.java
index 58ed87d..8e20ef4 100644
--- a/user/src/com/google/gwt/editor/client/AutoBean.java
+++ b/user/src/com/google/gwt/editor/client/AutoBean.java
@@ -51,7 +51,8 @@
<Q> Q getTag(String tagName);
/**
- * Returns <code>true</code> if {@link #freeze()} has been called.
+ * Returns the value most recently passed to {@link #setFrozen}, or false
+ * if it has never been called.
*/
boolean isFrozen();
diff --git a/user/src/com/google/gwt/editor/client/AutoBeanVisitor.java b/user/src/com/google/gwt/editor/client/AutoBeanVisitor.java
index bfc5fc1..305d481 100644
--- a/user/src/com/google/gwt/editor/client/AutoBeanVisitor.java
+++ b/user/src/com/google/gwt/editor/client/AutoBeanVisitor.java
@@ -48,17 +48,43 @@
void set(Object value);
}
+ /**
+ * TODO: document.
+ *
+ * @param bean
+ * @param ctx a Context
+ */
public void endVisit(AutoBean<?> bean, Context ctx) {
}
+ /**
+ * TODO: document.
+ *
+ * @param propertyName
+ * @param value
+ * @param ctx a PropertyContext
+ */
public void endVisitReferenceProperty(String propertyName, AutoBean<?> value,
PropertyContext ctx) {
}
+ /**
+ * TODO: document.
+ *
+ * @param propertyName
+ * @param value
+ * @param ctx a PropertyContext
+ */
public void endVisitValueProperty(String propertyName, Object value,
PropertyContext ctx) {
}
+ /**
+ * TODO: document.
+ *
+ * @param bean
+ * @param ctx a Context
+ */
public boolean visit(AutoBean<?> bean, Context ctx) {
return true;
}
@@ -66,12 +92,23 @@
/**
* Called every time, but {@link #visit(AutoBean, Context)} will be called for
* the value only the first time it is encountered.
+ *
+ * @param propertyName
+ * @param value
+ * @param ctx a PropertyContext
*/
public boolean visitReferenceProperty(String propertyName, AutoBean<?> value,
PropertyContext ctx) {
return true;
}
+ /**
+ * TODO: document.
+ *
+ * @param propertyName
+ * @param value
+ * @param ctx a PropertyContext
+ */
public boolean visitValueProperty(String propertyName, Object value,
PropertyContext ctx) {
return true;
diff --git a/user/src/com/google/gwt/editor/client/EditorError.java b/user/src/com/google/gwt/editor/client/EditorError.java
index 51b464a..1a9c0f3 100644
--- a/user/src/com/google/gwt/editor/client/EditorError.java
+++ b/user/src/com/google/gwt/editor/client/EditorError.java
@@ -18,7 +18,7 @@
/**
* Allows invalid Editor state to be propagated through an Editor hierarchy.
* Instances of EditorError are typically created as a side effect of calling
- * {@link EditorDelegate#recordError()}.
+ * {@link EditorDelegate#recordError}.
*
* @see com.google.gwt.editor.client.testing.MockEditorError
*/
@@ -47,7 +47,7 @@
String getPath();
/**
- * Returns the object passed into {@link EditorDelegate#recordError()}.
+ * Returns the object passed into {@link EditorDelegate#recordError}.
*/
Object getUserData();
diff --git a/user/src/com/google/gwt/editor/client/impl/AbstractAutoBean.java b/user/src/com/google/gwt/editor/client/impl/AbstractAutoBean.java
index 9361cc5..a043a8c 100644
--- a/user/src/com/google/gwt/editor/client/impl/AbstractAutoBean.java
+++ b/user/src/com/google/gwt/editor/client/impl/AbstractAutoBean.java
@@ -163,6 +163,10 @@
/**
* No-op. Used as a debugger hook point for generated code.
+ *
+ * @param method the method name
+ * @param returned the returned object
+ * @param parameters the parameter list
*/
protected void call(String method, Object returned, Object... parameters) {
}
@@ -185,6 +189,9 @@
/**
* No-op. Used as a debugger hook point for generated code.
+ *
+ * @param method the method name
+ * @param toReturn the value to return
*/
protected <V> V get(String method, V toReturn) {
return toReturn;
@@ -205,6 +212,9 @@
/**
* No-op. Used as a debugger hook point for generated code.
+ *
+ * @param method the method name
+ * @param value the Object value to be set
*/
protected void set(String method, Object value) {
}
diff --git a/user/src/com/google/gwt/editor/client/testing/MockEditorChain.java b/user/src/com/google/gwt/editor/client/testing/MockEditorChain.java
index ee5c0dc..c4d1b39 100644
--- a/user/src/com/google/gwt/editor/client/testing/MockEditorChain.java
+++ b/user/src/com/google/gwt/editor/client/testing/MockEditorChain.java
@@ -21,7 +21,9 @@
import java.util.Map;
/**
- * A Mock implementation of {@link CompositeEditor.EditorChain}.
+ * A Mock implementation of
+ * {@link com.google.gwt.editor.client.CompositeEditor.EditorChain
+ * CompositeEditor.EditorChain}.
*
* @param <C> the type being edited
*/
diff --git a/user/src/com/google/gwt/editor/rebind/model/EditorData.java b/user/src/com/google/gwt/editor/rebind/model/EditorData.java
index 5d17f36..29dcb44 100644
--- a/user/src/com/google/gwt/editor/rebind/model/EditorData.java
+++ b/user/src/com/google/gwt/editor/rebind/model/EditorData.java
@@ -25,7 +25,6 @@
import com.google.gwt.editor.client.LeafValueEditor;
import com.google.gwt.editor.client.ValueAwareEditor;
-
/**
* Describes how an Editor is related to bean properties. This type contains
* answers to questions asked by the generator code.
diff --git a/user/src/com/google/gwt/event/logical/shared/AttachEvent.java b/user/src/com/google/gwt/event/logical/shared/AttachEvent.java
index af13e8b..2c1ef1b 100644
--- a/user/src/com/google/gwt/event/logical/shared/AttachEvent.java
+++ b/user/src/com/google/gwt/event/logical/shared/AttachEvent.java
@@ -69,11 +69,10 @@
/**
* Construct a new {@link AttachEvent}.
*
- * @param width the new width
- * @param height the new height
+ * @param attached true if the source has been attached
*/
- protected AttachEvent(boolean loaded) {
- this.attached = loaded;
+ protected AttachEvent(boolean attached) {
+ this.attached = attached;
}
@Override
diff --git a/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java b/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java
index 3fe1144..4d0c6d4 100644
--- a/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java
+++ b/user/src/com/google/gwt/event/logical/shared/BeforeSelectionEvent.java
@@ -20,10 +20,10 @@
/**
* Represents a before selection event.
*
- * @param <I> the type about to be selected
+ * @param <T> the type about to be selected
*/
-public class BeforeSelectionEvent<I> extends
- GwtEvent<BeforeSelectionHandler<I>> {
+public class BeforeSelectionEvent<T> extends
+ GwtEvent<BeforeSelectionHandler<T>> {
/**
* Handler type.
@@ -34,17 +34,17 @@
* Fires a before selection event on all registered handlers in the handler
* manager. If no such handlers exist, this method will do nothing.
*
- * @param <I> the item type
+ * @param <T> the item type
* @param source the source of the handlers
* @param item the item
* @return the event so that the caller can check if it was canceled, or null
* if no handlers of this event type have been registered
*/
- public static <I> BeforeSelectionEvent<I> fire(
- HasBeforeSelectionHandlers<I> source, I item) {
+ public static <T> BeforeSelectionEvent<T> fire(
+ HasBeforeSelectionHandlers<T> source, T item) {
// If no handlers exist, then type can be null.
if (TYPE != null) {
- BeforeSelectionEvent<I> event = new BeforeSelectionEvent<I>();
+ BeforeSelectionEvent<T> event = new BeforeSelectionEvent<T>();
event.setItem(item);
source.fireEvent(event);
return event;
@@ -64,7 +64,7 @@
return TYPE;
}
- private I item;
+ private T item;
private boolean canceled;
@@ -87,7 +87,7 @@
// field itself does not, so we have to do an unsafe cast here.
@SuppressWarnings("unchecked")
@Override
- public final Type<BeforeSelectionHandler<I>> getAssociatedType() {
+ public final Type<BeforeSelectionHandler<T>> getAssociatedType() {
return (Type) TYPE;
}
@@ -96,7 +96,7 @@
*
* @return the item
*/
- public I getItem() {
+ public T getItem() {
return item;
}
@@ -110,7 +110,7 @@
}
@Override
- protected void dispatch(BeforeSelectionHandler<I> handler) {
+ protected void dispatch(BeforeSelectionHandler<T> handler) {
handler.onBeforeSelection(this);
}
@@ -119,7 +119,7 @@
*
* @param item the item
*/
- protected final void setItem(I item) {
+ protected final void setItem(T item) {
this.item = item;
}
}
diff --git a/user/src/com/google/gwt/event/logical/shared/BeforeSelectionHandler.java b/user/src/com/google/gwt/event/logical/shared/BeforeSelectionHandler.java
index 8671139..9ccb0a3 100644
--- a/user/src/com/google/gwt/event/logical/shared/BeforeSelectionHandler.java
+++ b/user/src/com/google/gwt/event/logical/shared/BeforeSelectionHandler.java
@@ -20,14 +20,14 @@
/**
* Handler interface for {@link BeforeSelectionEvent} events.
*
- * @param <I> the type about to be selected
+ * @param <T> the type about to be selected
*/
-public interface BeforeSelectionHandler<I> extends EventHandler {
+public interface BeforeSelectionHandler<T> extends EventHandler {
/**
* Called when {@link BeforeSelectionEvent} is fired.
*
* @param event the {@link BeforeSelectionEvent} that was fired
*/
- void onBeforeSelection(BeforeSelectionEvent<I> event);
+ void onBeforeSelection(BeforeSelectionEvent<T> event);
}
diff --git a/user/src/com/google/gwt/event/logical/shared/HasBeforeSelectionHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasBeforeSelectionHandlers.java
index f88119d..41d6d88 100644
--- a/user/src/com/google/gwt/event/logical/shared/HasBeforeSelectionHandlers.java
+++ b/user/src/com/google/gwt/event/logical/shared/HasBeforeSelectionHandlers.java
@@ -22,9 +22,9 @@
* A widget that implements this interface is a public source of
* {@link BeforeSelectionEvent} events.
*
- * @param <I> the type about to be selected
+ * @param <T> the type about to be selected
*/
-public interface HasBeforeSelectionHandlers<I> extends HasHandlers {
+public interface HasBeforeSelectionHandlers<T> extends HasHandlers {
/**
* Adds a {@link BeforeSelectionEvent} handler.
*
@@ -32,5 +32,5 @@
* @return the registration for the event
*/
HandlerRegistration addBeforeSelectionHandler(
- BeforeSelectionHandler<I> handler);
+ BeforeSelectionHandler<T> handler);
}
diff --git a/user/src/com/google/gwt/event/logical/shared/HasSelectionHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasSelectionHandlers.java
index e3404da..cd3fa56 100644
--- a/user/src/com/google/gwt/event/logical/shared/HasSelectionHandlers.java
+++ b/user/src/com/google/gwt/event/logical/shared/HasSelectionHandlers.java
@@ -22,14 +22,14 @@
* A widget that implements this interface is a public source of
* {@link SelectionEvent} events.
*
- * @param <I> the type being selected
+ * @param <T> the type being selected
*/
-public interface HasSelectionHandlers<I> extends HasHandlers {
+public interface HasSelectionHandlers<T> extends HasHandlers {
/**
* Adds a {@link SelectionEvent} handler.
*
* @param handler the handler
* @return the registration for the event
*/
- HandlerRegistration addSelectionHandler(SelectionHandler<I> handler);
+ HandlerRegistration addSelectionHandler(SelectionHandler<T> handler);
}
diff --git a/user/src/com/google/gwt/event/logical/shared/HasValueChangeHandlers.java b/user/src/com/google/gwt/event/logical/shared/HasValueChangeHandlers.java
index 187a1d2..5742d65 100644
--- a/user/src/com/google/gwt/event/logical/shared/HasValueChangeHandlers.java
+++ b/user/src/com/google/gwt/event/logical/shared/HasValueChangeHandlers.java
@@ -22,14 +22,14 @@
* A widget that implements this interface is a public source of
* {@link ValueChangeEvent} events.
*
- * @param <I> the value about to be changed
+ * @param <T> the value about to be changed
*/
-public interface HasValueChangeHandlers<I> extends HasHandlers {
+public interface HasValueChangeHandlers<T> extends HasHandlers {
/**
* Adds a {@link ValueChangeEvent} handler.
*
* @param handler the handler
* @return the registration for the event
*/
- HandlerRegistration addValueChangeHandler(ValueChangeHandler<I> handler);
+ HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler);
}
diff --git a/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java b/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java
index abe083d..d10b29d 100644
--- a/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java
+++ b/user/src/com/google/gwt/event/logical/shared/SelectionEvent.java
@@ -20,9 +20,9 @@
/**
* Represents a selection event.
*
- * @param <I> the type being selected
+ * @param <T> the type being selected
*/
-public class SelectionEvent<I> extends GwtEvent<SelectionHandler<I>> {
+public class SelectionEvent<T> extends GwtEvent<SelectionHandler<T>> {
/**
* Handler type.
@@ -33,13 +33,13 @@
* Fires a selection event on all registered handlers in the handler
* manager.If no such handlers exist, this method will do nothing.
*
- * @param <I> the selected item type
+ * @param <T> the selected item type
* @param source the source of the handlers
* @param selectedItem the selected item
*/
- public static <I> void fire(HasSelectionHandlers<I> source, I selectedItem) {
+ public static <T> void fire(HasSelectionHandlers<T> source, T selectedItem) {
if (TYPE != null) {
- SelectionEvent<I> event = new SelectionEvent<I>(selectedItem);
+ SelectionEvent<T> event = new SelectionEvent<T>(selectedItem);
source.fireEvent(event);
}
}
@@ -56,14 +56,14 @@
return TYPE;
}
- private final I selectedItem;
+ private final T selectedItem;
/**
* Creates a new selection event.
*
* @param selectedItem selected item
*/
- protected SelectionEvent(I selectedItem) {
+ protected SelectionEvent(T selectedItem) {
this.selectedItem = selectedItem;
}
@@ -71,7 +71,7 @@
// field itself does not, so we have to do an unsafe cast here.
@SuppressWarnings("unchecked")
@Override
- public final Type<SelectionHandler<I>> getAssociatedType() {
+ public final Type<SelectionHandler<T>> getAssociatedType() {
return (Type) TYPE;
}
@@ -80,12 +80,12 @@
*
* @return the selected item
*/
- public I getSelectedItem() {
+ public T getSelectedItem() {
return selectedItem;
}
@Override
- protected void dispatch(SelectionHandler<I> handler) {
+ protected void dispatch(SelectionHandler<T> handler) {
handler.onSelection(this);
}
}
diff --git a/user/src/com/google/gwt/event/logical/shared/SelectionHandler.java b/user/src/com/google/gwt/event/logical/shared/SelectionHandler.java
index f9f2e07..1370092 100644
--- a/user/src/com/google/gwt/event/logical/shared/SelectionHandler.java
+++ b/user/src/com/google/gwt/event/logical/shared/SelectionHandler.java
@@ -20,14 +20,14 @@
/**
* Handler interface for {@link SelectionEvent} events.
*
- * @param <I> the type being selected
+ * @param <T> the type being selected
*/
-public interface SelectionHandler<I> extends EventHandler {
+public interface SelectionHandler<T> extends EventHandler {
/**
* Called when {@link SelectionEvent} is fired.
*
* @param event the {@link SelectionEvent} that was fired
*/
- void onSelection(SelectionEvent<I> event);
+ void onSelection(SelectionEvent<T> event);
}
diff --git a/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java b/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java
index bf71cf2..551063d 100644
--- a/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java
+++ b/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java
@@ -20,9 +20,9 @@
/**
* Represents a value change event.
*
- * @param <I> the value about to be changed
+ * @param <T> the value about to be changed
*/
-public class ValueChangeEvent<I> extends GwtEvent<ValueChangeHandler<I>> {
+public class ValueChangeEvent<T> extends GwtEvent<ValueChangeHandler<T>> {
/**
* Handler type.
@@ -37,9 +37,9 @@
* @param source the source of the handlers
* @param value the value
*/
- public static <I> void fire(HasValueChangeHandlers<I> source, I value) {
+ public static <T> void fire(HasValueChangeHandlers<T> source, T value) {
if (TYPE != null) {
- ValueChangeEvent<I> event = new ValueChangeEvent<I>(value);
+ ValueChangeEvent<T> event = new ValueChangeEvent<T>(value);
source.fireEvent(event);
}
}
@@ -49,15 +49,15 @@
* Use this call rather than making the decision to short circuit yourself for
* safe handling of null.
*
- * @param <I> the old value type
+ * @param <T> the old value type
* @param source the source of the handlers
* @param oldValue the oldValue, may be null
* @param newValue the newValue, may be null
*/
- public static <I> void fireIfNotEqual(HasValueChangeHandlers<I> source,
- I oldValue, I newValue) {
+ public static <T> void fireIfNotEqual(HasValueChangeHandlers<T> source,
+ T oldValue, T newValue) {
if (shouldFire(source, oldValue, newValue)) {
- ValueChangeEvent<I> event = new ValueChangeEvent<I>(newValue);
+ ValueChangeEvent<T> event = new ValueChangeEvent<T>(newValue);
source.fireEvent(event);
}
}
@@ -78,26 +78,26 @@
* Convenience method to allow subtypes to know when they should fire a value
* change event in a null-safe manner.
*
- * @param <I> value type
+ * @param <T> value type
* @param source the source
* @param oldValue the old value
* @param newValue the new value
* @return whether the event should be fired
*/
- protected static <I> boolean shouldFire(HasValueChangeHandlers<I> source,
- I oldValue, I newValue) {
+ protected static <T> boolean shouldFire(HasValueChangeHandlers<T> source,
+ T oldValue, T newValue) {
return TYPE != null && oldValue != newValue
&& (oldValue == null || !oldValue.equals(newValue));
}
- private final I value;
+ private final T value;
/**
* Creates a value change event.
*
* @param value the value
*/
- protected ValueChangeEvent(I value) {
+ protected ValueChangeEvent(T value) {
this.value = value;
}
@@ -105,7 +105,7 @@
// field itself does not, so we have to do an unsafe cast here.
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
- public final Type<ValueChangeHandler<I>> getAssociatedType() {
+ public final Type<ValueChangeHandler<T>> getAssociatedType() {
return (Type) TYPE;
}
@@ -114,7 +114,7 @@
*
* @return the value
*/
- public I getValue() {
+ public T getValue() {
return value;
}
@@ -124,7 +124,7 @@
}
@Override
- protected void dispatch(ValueChangeHandler<I> handler) {
+ protected void dispatch(ValueChangeHandler<T> handler) {
handler.onValueChange(this);
}
}
diff --git a/user/src/com/google/gwt/event/logical/shared/ValueChangeHandler.java b/user/src/com/google/gwt/event/logical/shared/ValueChangeHandler.java
index 9fb4772..0d38342 100644
--- a/user/src/com/google/gwt/event/logical/shared/ValueChangeHandler.java
+++ b/user/src/com/google/gwt/event/logical/shared/ValueChangeHandler.java
@@ -20,14 +20,14 @@
/**
* Handler interface for {@link ValueChangeEvent} events.
*
- * @param <I> the value about to be changed
+ * @param <T> the value about to be changed
*/
-public interface ValueChangeHandler<I> extends EventHandler {
+public interface ValueChangeHandler<T> extends EventHandler {
/**
* Called when {@link ValueChangeEvent} is fired.
*
* @param event the {@link ValueChangeEvent} that was fired
*/
- void onValueChange(ValueChangeEvent<I> event);
+ void onValueChange(ValueChangeEvent<T> event);
}
diff --git a/user/src/com/google/gwt/event/shared/DefaultHandlerRegistration.java b/user/src/com/google/gwt/event/shared/DefaultHandlerRegistration.java
index e19b557..0cc9070 100644
--- a/user/src/com/google/gwt/event/shared/DefaultHandlerRegistration.java
+++ b/user/src/com/google/gwt/event/shared/DefaultHandlerRegistration.java
@@ -25,7 +25,6 @@
@Deprecated
public class DefaultHandlerRegistration implements HandlerRegistration {
- @SuppressWarnings("deprecation")
private final HandlerManager manager;
private final EventHandler handler;
private final Type<?> type;
@@ -40,7 +39,7 @@
* @param handler the handler
*/
protected <H extends EventHandler> DefaultHandlerRegistration(
- @SuppressWarnings("deprecation") HandlerManager manager, Type<H> type,
+ HandlerManager manager, Type<H> type,
H handler) {
this.manager = manager;
this.handler = handler;
@@ -50,7 +49,7 @@
/**
* Removes the given handler from its manager.
*/
- @SuppressWarnings({"unchecked", "deprecation"})
+ @SuppressWarnings({"unchecked"})
// This is safe because when the elements were passed in they conformed to
// Type<H>,H.
public void removeHandler() {
diff --git a/user/src/com/google/gwt/event/shared/HandlerManager.java b/user/src/com/google/gwt/event/shared/HandlerManager.java
index 9a8776d..4621491 100644
--- a/user/src/com/google/gwt/event/shared/HandlerManager.java
+++ b/user/src/com/google/gwt/event/shared/HandlerManager.java
@@ -50,7 +50,6 @@
* @param source the event source
* @param fireInReverseOrder true to fire handlers in reverse order
*/
- @SuppressWarnings("deprecation")
public HandlerManager(Object source, boolean fireInReverseOrder) {
eventBus = new SimpleEventBus(fireInReverseOrder);
this.source = source;
@@ -115,7 +114,6 @@
* @param type the handler's event type
* @return the given handler
*/
- @SuppressWarnings("deprecation")
public <H extends EventHandler> H getHandler(GwtEvent.Type<H> type, int index) {
return eventBus.getHandler(type, index);
}
@@ -126,7 +124,6 @@
* @param type the event type
* @return the number of registered handlers
*/
- @SuppressWarnings("deprecation")
public int getHandlerCount(Type<?> type) {
return eventBus.getHandlerCount(type);
}
@@ -137,7 +134,6 @@
* @param e the event type
* @return whether the given event type is handled
*/
- @SuppressWarnings("deprecation")
public boolean isEventHandled(Type<?> e) {
return eventBus.isEventHandled(e);
}
diff --git a/user/src/com/google/gwt/i18n/client/CurrencyList.java b/user/src/com/google/gwt/i18n/client/CurrencyList.java
index 932dac7..0dbf144 100644
--- a/user/src/com/google/gwt/i18n/client/CurrencyList.java
+++ b/user/src/com/google/gwt/i18n/client/CurrencyList.java
@@ -106,7 +106,7 @@
/**
* Map of currency codes to localized currency names. This is kept separate
- * from {@link #dataMap} above so that the names can be completely removed by
+ * from {@link #dataMapJava} above so that the names can be completely removed by
* the compiler if they are not used.
*/
protected HashMap<String, String> namesMapJava;
diff --git a/user/src/com/google/gwt/i18n/client/Messages.java b/user/src/com/google/gwt/i18n/client/Messages.java
index 6889ec7..7ddc537 100644
--- a/user/src/com/google/gwt/i18n/client/Messages.java
+++ b/user/src/com/google/gwt/i18n/client/Messages.java
@@ -206,7 +206,6 @@
String value();
}
-
/**
* Ignored except on parameters also tagged with {@link PluralCount}, and
* provides an offset to be subtracted from the value before a plural rule
diff --git a/user/src/com/google/gwt/i18n/client/impl/CurrencyDataImpl.java b/user/src/com/google/gwt/i18n/client/impl/CurrencyDataImpl.java
index caf50fa..92ec8ab 100644
--- a/user/src/com/google/gwt/i18n/client/impl/CurrencyDataImpl.java
+++ b/user/src/com/google/gwt/i18n/client/impl/CurrencyDataImpl.java
@@ -92,30 +92,37 @@
this.portableCurrencySymbol = portableCurrencySymbol;
}
+ @Override
public int getDefaultFractionDigits() {
return getDefaultFractionDigits(flagsAndPrecision);
}
+ @Override
public String getPortableCurrencySymbol() {
return portableCurrencySymbol;
}
+ @Override
public boolean isDeprecated() {
return isDeprecated(flagsAndPrecision);
}
+ @Override
public boolean isSpaceForced() {
return isSpaceForced(flagsAndPrecision);
}
+ @Override
public boolean isSpacingFixed() {
return isSpacingFixed(flagsAndPrecision);
}
+ @Override
public boolean isSymbolPositionFixed() {
return isSymbolPositionFixed(flagsAndPrecision);
}
+ @Override
public boolean isSymbolPrefix() {
return isSymbolPrefix(flagsAndPrecision);
}
diff --git a/user/src/com/google/gwt/layout/client/Layout.java b/user/src/com/google/gwt/layout/client/Layout.java
index 2bd46bf..f1f214a 100644
--- a/user/src/com/google/gwt/layout/client/Layout.java
+++ b/user/src/com/google/gwt/layout/client/Layout.java
@@ -128,12 +128,12 @@
* system will be over- or under-contrained. For this reason, the following
* methods are provided for setting these values:
* <ul>
- * <li>{@link #setLeftRight(double, Unit, double, Unit)}</li>
- * <li>{@link #setLeftWidth(double, Unit, double, Unit)}</li>
- * <li>{@link #setRightWidth(double, Unit, double, Unit)}</li>
- * <li>{@link #setTopBottom(double, Unit, double, Unit)}</li>
- * <li>{@link #setTopHeight(double, Unit, double, Unit)}</li>
- * <li>{@link #setBottomHeight(double, Unit, double, Unit)}</li>
+ * <li>{@link Layout.Layer#setLeftRight}</li>
+ * <li>{@link Layout.Layer#setLeftWidth}</li>
+ * <li>{@link Layout.Layer#setRightWidth}</li>
+ * <li>{@link Layout.Layer#setTopBottom}</li>
+ * <li>{@link Layout.Layer#setTopHeight}</li>
+ * <li>{@link Layout.Layer#setBottomHeight}</li>
* </ul>
* </p>
*
diff --git a/user/src/com/google/gwt/layout/client/LayoutImplIE8.java b/user/src/com/google/gwt/layout/client/LayoutImplIE8.java
index 63d487b..ecfd916 100644
--- a/user/src/com/google/gwt/layout/client/LayoutImplIE8.java
+++ b/user/src/com/google/gwt/layout/client/LayoutImplIE8.java
@@ -24,7 +24,7 @@
import com.google.gwt.layout.client.Layout.Layer;
/**
- * This implementation is used on IE8. Unlike {@link LayoutImpl}, it converts
+ * This implementation is used on IE8. Unlike {@code LayoutImpl}, it converts
* all values to pixels before setting them. This is necessary because this
* browser incorrectly calculates the relative sizes and positions of CSS
* properties specified in certain units (e.g., when the value of an 'em' is
diff --git a/user/src/com/google/gwt/logging/client/HtmlLogFormatter.java b/user/src/com/google/gwt/logging/client/HtmlLogFormatter.java
index 62f222f..ad1dd73 100644
--- a/user/src/com/google/gwt/logging/client/HtmlLogFormatter.java
+++ b/user/src/com/google/gwt/logging/client/HtmlLogFormatter.java
@@ -18,7 +18,6 @@
import com.google.gwt.logging.impl.FormatterImpl;
-import java.util.Date;
import java.util.logging.Level;
import java.util.logging.LogRecord;
@@ -51,7 +50,6 @@
}
protected String getHtmlPrefix(LogRecord event) {
- Date date = new Date(event.getMillis());
StringBuilder prefix = new StringBuilder();
prefix.append("<span style='color:");
prefix.append(getColor(event.getLevel().intValue()));
@@ -60,6 +58,9 @@
return prefix.toString();
}
+ /**
+ * @param event
+ */
protected String getHtmlSuffix(LogRecord event) {
return "</code></span>";
}
diff --git a/user/src/com/google/gwt/logging/impl/FormatterImpl.java b/user/src/com/google/gwt/logging/impl/FormatterImpl.java
index 051f6f7..df9b153 100644
--- a/user/src/com/google/gwt/logging/impl/FormatterImpl.java
+++ b/user/src/com/google/gwt/logging/impl/FormatterImpl.java
@@ -22,7 +22,7 @@
import java.util.logging.LogRecord;
/**
- * Base class for Formatters - provides common functionality
+ * Base class for Formatters - provides common functionality.
*/
public abstract class FormatterImpl extends Formatter {
diff --git a/user/src/com/google/gwt/logging/server/JsonLogRecordServerUtil.java b/user/src/com/google/gwt/logging/server/JsonLogRecordServerUtil.java
index e32590d..b8f7dfd 100644
--- a/user/src/com/google/gwt/logging/server/JsonLogRecordServerUtil.java
+++ b/user/src/com/google/gwt/logging/server/JsonLogRecordServerUtil.java
@@ -24,7 +24,6 @@
import java.util.logging.LogRecord;
import java.util.logging.Logger;
-
/**
* A set of functions to convert standard JSON strings into
* LogRecords. The corresponding functions to create the JSON
@@ -51,7 +50,7 @@
lr.setMillis(timestamp);
return lr;
}
-
+
private static StackTraceElement stackTraceElementFromJson(
String jsonString) throws JSONException {
JSONObject ste = new JSONObject(jsonString);
@@ -61,7 +60,7 @@
int lineNumber = Integer.parseInt(ste.getString("lineNumber"));
return new StackTraceElement(className, methodName, fileName, lineNumber);
}
-
+
private static Throwable throwableFromJson(String jsonString)
throws JSONException {
if (jsonString.equals("{}")) {
diff --git a/user/src/com/google/gwt/logging/server/RemoteLoggingServiceUtil.java b/user/src/com/google/gwt/logging/server/RemoteLoggingServiceUtil.java
index d096885..d3c1904 100644
--- a/user/src/com/google/gwt/logging/server/RemoteLoggingServiceUtil.java
+++ b/user/src/com/google/gwt/logging/server/RemoteLoggingServiceUtil.java
@@ -20,24 +20,26 @@
import java.util.logging.Logger;
/**
- * Utilities for classes that accept Remote Logging requests
+ * Utilities for classes that accept Remote Logging requests.
*/
public class RemoteLoggingServiceUtil {
+
/**
- * Exceptions that occur during remote logging
+ * Exceptions that occur during remote logging.
*/
- public static class RemoteLoggingException extends Exception {
+ public static class RemoteLoggingException extends Exception {
public RemoteLoggingException(String message) {
super(message);
}
-
+
public RemoteLoggingException(String message, Throwable t) {
super(message, t);
}
}
/**
- * Logs a message on the server
+ * Logs a message on the server.
+ *
* @param lr LogRecord to be logged
* @param strongName Permutation name (used for deobfuscation and may be null,
* which will only cause deobfuscation to fail)
@@ -46,11 +48,9 @@
* @param loggerNameOverride logger name for messages logged on server. May be
* null, in which case, messages will be logged to a logger
* corresponding to the client side logger which triggered them.
- *
- * @return Empty string when successful, or an error string in case of failure.
*/
public static void logOnServer(LogRecord lr, String strongName,
- StackTraceDeobfuscator deobfuscator, String loggerNameOverride) throws
+ StackTraceDeobfuscator deobfuscator, String loggerNameOverride) throws
RemoteLoggingException {
if (deobfuscator != null) {
lr = deobfuscator.deobfuscateLogRecord(lr, strongName);
@@ -60,7 +60,7 @@
Logger logger = Logger.getLogger(loggerName);
logger.log(lr);
}
-
+
public static void logOnServer(String serializedLogRecordJson,
String strongName, StackTraceDeobfuscator deobfuscator,
String loggerNameOverride) throws RemoteLoggingException {
diff --git a/user/src/com/google/gwt/logging/server/StackTraceDeobfuscator.java b/user/src/com/google/gwt/logging/server/StackTraceDeobfuscator.java
index df05c97..40787fd 100644
--- a/user/src/com/google/gwt/logging/server/StackTraceDeobfuscator.java
+++ b/user/src/com/google/gwt/logging/server/StackTraceDeobfuscator.java
@@ -82,12 +82,15 @@
return newSt;
}
- private Throwable deobfuscateThrowable(Throwable t, String strongName) {
- if (t.getStackTrace() != null) {
- t.setStackTrace(deobfuscateStackTrace(t.getStackTrace(), strongName));
+ private Throwable deobfuscateThrowable(Throwable old, String strongName) {
+ Throwable t = new Throwable(old.getMessage());
+ if (old.getStackTrace() != null) {
+ t.setStackTrace(deobfuscateStackTrace(old.getStackTrace(), strongName));
+ } else {
+ t.setStackTrace(new StackTraceElement[0]);
}
- if (t.getCause() != null) {
- t.initCause(deobfuscateThrowable(t.getCause(), strongName));
+ if (old.getCause() != null) {
+ t.initCause(deobfuscateThrowable(old.getCause(), strongName));
}
return t;
}
diff --git a/user/src/com/google/gwt/requestfactory/client/DefaultRequestTransport.java b/user/src/com/google/gwt/requestfactory/client/DefaultRequestTransport.java
index 75cc541..93fac74 100644
--- a/user/src/com/google/gwt/requestfactory/client/DefaultRequestTransport.java
+++ b/user/src/com/google/gwt/requestfactory/client/DefaultRequestTransport.java
@@ -61,7 +61,9 @@
/**
* Construct a DefaultRequestTransport.
*
- * @param eventBus the same EventBus passed into {@link RequestFactory#init}.
+ * @param eventBus the same EventBus passed into
+ * {@link RequestFactory#initialize(EventBus)
+ * RequestFactory.initialize}.
*/
public DefaultRequestTransport(EventBus eventBus) {
if (eventBus == null) {
@@ -120,7 +122,8 @@
/**
* Creates a RequestCallback that maps the HTTP response onto the
- * {@link TransportReceiver} interface.
+ * {@link com.google.gwt.requestfactory.shared.RequestTransport.TransportReceiver
+ * TransportReceiver} interface.
*/
protected RequestCallback createRequestCallback(
final TransportReceiver receiver) {
diff --git a/user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java b/user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java
index 78341d8..a98e6eb 100644
--- a/user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java
+++ b/user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java
@@ -36,16 +36,17 @@
* instance.initialize(.....);
* myRequest.with(instance.getPaths());
*
- * // Fire the request, in the callback
+ * // Fire the request, in the callback
* instance.edit(retrievedRecord);
* // Control when the request is sent
* instance.flush().fire(new Receiver {...});
* }
* </pre>
+ *
+ * <p> See {@code com.google.gwt.requestfactory.client.testing.MockRequestFactoryEditorDriver}
*
* @param <P> the type of Proxy being edited
* @param <E> the type of Editor that will edit the Record
- * @see com.google.gwt.requestfactory.client.testing.MockRequestFactoryEditorDriver
*/
public interface RequestFactoryEditorDriver<P, E extends Editor<? super P>> {
/**
@@ -57,7 +58,7 @@
/**
* Start driving the Editor and its sub-editors with data. A
* {@link RequestContext} is required to provide context for the changes to
- * the proxy (see {@link RequestContext#edit()}. Note that this driver will
+ * the proxy (see {@link RequestContext#edit}. Note that this driver will
* not fire the request.
*
* @param proxy the proxy to be edited
@@ -97,7 +98,7 @@
* {@link EventBus} to be monitored for subscription services.
*
* @see com.google.gwt.editor.client.EditorDelegate#subscribe
- * @see {@link com.google.gwt.event.shared.ResettableEventBus}
+ * @see com.google.gwt.event.shared.ResettableEventBus
*/
void initialize(EventBus eventBus, RequestFactory requestFactory, E editor);
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequestFactory.java b/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequestFactory.java
index f1787a5..bcd026c 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequestFactory.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/AbstractRequestFactory.java
@@ -110,6 +110,7 @@
requestContext.addInvocation(this);
}
+ @Override
protected void handleResult(Object result) {
succeed(decodeReturnObject(proxyId.getProxyClass(), result));
}
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/FindRequest.java b/user/src/com/google/gwt/requestfactory/client/impl/FindRequest.java
index d29a77d..7bbee53 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/FindRequest.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/FindRequest.java
@@ -30,5 +30,5 @@
/**
* Use the implicit lookup in passing EntityProxy types to service methods.
*/
- Request<EntityProxy> find(EntityProxyId proxy);
+ Request<EntityProxy> find(EntityProxyId<?> proxy);
}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/requestfactory/client/impl/SimpleEntityProxyId.java b/user/src/com/google/gwt/requestfactory/client/impl/SimpleEntityProxyId.java
index 91d21a8..fd24028 100644
--- a/user/src/com/google/gwt/requestfactory/client/impl/SimpleEntityProxyId.java
+++ b/user/src/com/google/gwt/requestfactory/client/impl/SimpleEntityProxyId.java
@@ -75,6 +75,7 @@
hashCode = clientId;
}
+ @Override
public boolean equals(Object o) {
if (this == o) {
return true;
@@ -113,6 +114,7 @@
return serverId;
}
+ @Override
public int hashCode() {
return hashCode;
}
diff --git a/user/src/com/google/gwt/requestfactory/server/DeadEntityException.java b/user/src/com/google/gwt/requestfactory/server/DeadEntityException.java
new file mode 100644
index 0000000..008fe4c
--- /dev/null
+++ b/user/src/com/google/gwt/requestfactory/server/DeadEntityException.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2010 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.requestfactory.server;
+
+/**
+ * Indicates the user attempted to perform an operation on an irretrievable
+ * entity
+ */
+public class DeadEntityException extends RuntimeException {
+ public DeadEntityException() {
+ }
+
+ public DeadEntityException(String message) {
+ super(message);
+ }
+}
diff --git a/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java b/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
index f59a87d..5257e62 100644
--- a/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
+++ b/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
@@ -237,6 +237,9 @@
JSONObject exceptionResponse = buildExceptionResponse(e.getCause());
throw new RequestProcessingException("Unexpected exception", e,
exceptionResponse.toString());
+ } catch (DeadEntityException e) {
+ // This is a normal, if exceptional, condition
+ return buildExceptionResponse(e).toString();
} catch (Exception e) {
JSONObject exceptionResponse = buildExceptionResponse(e);
throw new RequestProcessingException("Unexpected exception", e,
@@ -464,6 +467,10 @@
Class<?> idType = getIdMethodForEntity(entityType).getReturnType();
Object entityInstance = getEntityInstance(writeOperation, entityType,
entityKey.decodedId(idType), idType);
+ if (entityInstance == null) {
+ throw new DeadEntityException(
+ "The requested entity is not available on the server");
+ }
cachedEntityLookup.put(entityKey, entityInstance);
Iterator<?> keys = recordObject.keys();
diff --git a/user/src/com/google/gwt/requestfactory/server/Logging.java b/user/src/com/google/gwt/requestfactory/server/Logging.java
index 2d6973b..d9d806f 100644
--- a/user/src/com/google/gwt/requestfactory/server/Logging.java
+++ b/user/src/com/google/gwt/requestfactory/server/Logging.java
@@ -23,13 +23,13 @@
/**
* Server side object that handles log messages sent by
- * {@link RequestFactoryLogHandler}.
+ * {@link com.google.gwt.requestfactory.client.RequestFactoryLogHandler}.
*/
public class Logging {
private static StackTraceDeobfuscator deobfuscator =
new StackTraceDeobfuscator("");
-
+
public static void logMessage(String logRecordJson) throws
RemoteLoggingException {
// if the header does not exist, we pass null, which is handled gracefully
@@ -40,7 +40,7 @@
RemoteLoggingServiceUtil.logOnServer(logRecordJson,
strongName, deobfuscator, null);
}
-
+
/**
* This function is only for server side use which is why it's not in the
* LoggingRequest interface.
@@ -48,15 +48,15 @@
public static void setSymbolMapsDirectory(String dir) {
deobfuscator.setSymbolMapsDirectory(dir);
}
-
+
private String id = "";
-
- private Integer version = 0;
-
+
+ private Integer version = 0;
+
public String getId() {
return this.id;
}
-
+
public Integer getVersion() {
return this.version;
}
@@ -64,9 +64,8 @@
public void setId(String id) {
this.id = id;
}
-
+
public void setVersion(Integer version) {
this.version = version;
}
}
-
diff --git a/user/src/com/google/gwt/requestfactory/server/SampleDataPopulator.java b/user/src/com/google/gwt/requestfactory/server/SampleDataPopulator.java
index dea5f7b..1162a9d 100644
--- a/user/src/com/google/gwt/requestfactory/server/SampleDataPopulator.java
+++ b/user/src/com/google/gwt/requestfactory/server/SampleDataPopulator.java
@@ -84,7 +84,6 @@
postJsonFile(jsonObject);
}
- @SuppressWarnings("deprecation")
private void postJsonFile(JSONObject contentData) throws IOException,
JSONException {
HttpPost post = new HttpPost(url);
diff --git a/user/src/com/google/gwt/requestfactory/shared/EntityProxy.java b/user/src/com/google/gwt/requestfactory/shared/EntityProxy.java
index c3fc688..ec92a32 100644
--- a/user/src/com/google/gwt/requestfactory/shared/EntityProxy.java
+++ b/user/src/com/google/gwt/requestfactory/shared/EntityProxy.java
@@ -28,9 +28,9 @@
* Returns the {@link EntityProxyId} that identifies a particular instance of
* the type proxied by the receiver.
* <p>
- * An id returned by a proxy newly created by {@link RequestFactory#create}
- * {@link #equals(Object)} those returned later by a proxies to the persisted
- * object.
+ * An id returned by a proxy newly created by {@link RequestContext#create}
+ * {@link Object#equals(Object) equals} those returned later by proxies to the
+ * persisted object.
* <p>
* Subtypes should override to declare they return a stable id of their own
* type, to allow type safe use of the request objects returned by
diff --git a/user/src/com/google/gwt/requestfactory/shared/RequestContext.java b/user/src/com/google/gwt/requestfactory/shared/RequestContext.java
index a7b88ba..78279e1 100644
--- a/user/src/com/google/gwt/requestfactory/shared/RequestContext.java
+++ b/user/src/com/google/gwt/requestfactory/shared/RequestContext.java
@@ -44,8 +44,7 @@
void fire();
/**
- * For receiving errors or validation failures only. Request return values are
- * received via {@link Request#receive}.
+ * For receiving errors or validation failures only.
*
* @throws IllegalArgumentException if <code>receiver</code> is
* <code>null</code>
diff --git a/user/src/com/google/gwt/requestfactory/shared/RequestFactory.java b/user/src/com/google/gwt/requestfactory/shared/RequestFactory.java
index 943efdd..dce35e2 100644
--- a/user/src/com/google/gwt/requestfactory/shared/RequestFactory.java
+++ b/user/src/com/google/gwt/requestfactory/shared/RequestFactory.java
@@ -68,9 +68,9 @@
/**
* Return the class object which may be used to create new instances of the
- * type of this token, via {@link #create}. The token may represent either a
- * proxy instance (see {@link #getHistoryToken()}) or a proxy class (see
- * {@link #getToken()}).
+ * type of this token, via {@link RequestContext#create}. The token may
+ * represent either a proxy instance (see {@link #getHistoryToken}) or a proxy
+ * class (see {@link #getProxyClass}).
*/
Class<? extends EntityProxy> getProxyClass(String historyToken);
diff --git a/user/src/com/google/gwt/resources/css/ast/CssSprite.java b/user/src/com/google/gwt/resources/css/ast/CssSprite.java
index 685c56f..3210b79 100644
--- a/user/src/com/google/gwt/resources/css/ast/CssSprite.java
+++ b/user/src/com/google/gwt/resources/css/ast/CssSprite.java
@@ -27,7 +27,7 @@
/**
* Represents a sprited image. This is basically a normal CssRule, except for
- * one well-known property {@value CssSprite#IMAGE_PROPERTY_NAME}, which
+ * one well-known property {@value IMAGE_PROPERTY_NAME}, which
* specifies the name of an ImageResource accessor.
*/
public class CssSprite extends CssRule {
@@ -37,7 +37,7 @@
/**
* A facade for the underlying CssProperty list maintained by CssRule. We
* override the add and set methods to intercept the
- * {@value CssSprite#IMAGE_PROPERTY_NAME} property.
+ * {@value IMAGE_PROPERTY_NAME} property.
*/
private class SpritePropertyList implements List<CssProperty> {
private final List<CssProperty> source;
diff --git a/user/src/com/google/gwt/resources/css/ast/CssVisitor.java b/user/src/com/google/gwt/resources/css/ast/CssVisitor.java
index a8520fc..5e69566 100644
--- a/user/src/com/google/gwt/resources/css/ast/CssVisitor.java
+++ b/user/src/com/google/gwt/resources/css/ast/CssVisitor.java
@@ -164,7 +164,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssDef x, Context ctx) {
return true;
@@ -173,7 +172,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssEval x, Context ctx) {
return true;
@@ -182,7 +180,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssExternalSelectors x, Context ctx) {
return true;
@@ -191,7 +188,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssIf x, Context ctx) {
return true;
@@ -200,7 +196,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssMediaRule x, Context ctx) {
return true;
@@ -209,7 +204,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssNoFlip x, Context ctx) {
return true;
@@ -218,7 +212,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssPageRule x, Context ctx) {
return true;
@@ -227,7 +220,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssProperty x, Context ctx) {
return true;
@@ -236,7 +228,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssRule x, Context ctx) {
return true;
@@ -245,7 +236,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssSelector x, Context ctx) {
return true;
@@ -254,7 +244,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssSprite x, Context ctx) {
return true;
@@ -263,7 +252,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssStylesheet x, Context ctx) {
return true;
@@ -272,7 +260,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssUrl x, Context ctx) {
return true;
@@ -281,7 +268,6 @@
/**
* @param x the node being visited
* @param ctx the context for the visit
- * @return
*/
public boolean visit(CssUnknownAtRule x, Context ctx) {
return true;
diff --git a/user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java b/user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java
index 858d0b1..7b969a9 100644
--- a/user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java
+++ b/user/src/com/google/gwt/safehtml/client/SafeHtmlTemplates.java
@@ -28,7 +28,7 @@
* <p>Example usage:
* <pre>
* public interface MyTemplate extends SafeHtmlTemplates {
- * @Template("<span class=\"{3}\">{0}: <a href=\"{1}\">{2}</a></span>")
+ * @Template("<span class=\"{3}\">{0}: <a href=\"{1}\">{2}</a></span>")
* SafeHtml messageWithLink(SafeHtml message, String url, String linkText,
* String style);
* }
diff --git a/user/src/com/google/gwt/safehtml/shared/SimpleHtmlSanitizer.java b/user/src/com/google/gwt/safehtml/shared/SimpleHtmlSanitizer.java
index 0e25278..101d032 100644
--- a/user/src/com/google/gwt/safehtml/shared/SimpleHtmlSanitizer.java
+++ b/user/src/com/google/gwt/safehtml/shared/SimpleHtmlSanitizer.java
@@ -29,7 +29,7 @@
* in a whitelist (including {@code <b>, <em>, <i>}, etc; for the exact list
* consult the source), as well as numeric HTML entities and HTML entity
* references. Any HTML metacharacters that do not appear as part of markup in
- * this subset will be HTML-esacped.
+ * this subset will be HTML-escaped.
*/
public final class SimpleHtmlSanitizer implements HtmlSanitizer {
diff --git a/user/src/com/google/gwt/text/shared/SimpleSafeHtmlRenderer.java b/user/src/com/google/gwt/text/shared/SimpleSafeHtmlRenderer.java
index 343e23b..5921022 100644
--- a/user/src/com/google/gwt/text/shared/SimpleSafeHtmlRenderer.java
+++ b/user/src/com/google/gwt/text/shared/SimpleSafeHtmlRenderer.java
@@ -21,7 +21,7 @@
/**
* A simple {@link SafeHtmlRenderer} implementation that calls
- * {@link SafeHtmlUtils#fromString(String)) to escape its arguments.
+ * {@link SafeHtmlUtils#fromString(String)} to escape its arguments.
*/
public class SimpleSafeHtmlRenderer implements SafeHtmlRenderer<String> {
diff --git a/user/src/com/google/gwt/uibinder/attributeparsers/FieldReferenceConverter.java b/user/src/com/google/gwt/uibinder/attributeparsers/FieldReferenceConverter.java
index 6c0c4a2..85cbb45 100644
--- a/user/src/com/google/gwt/uibinder/attributeparsers/FieldReferenceConverter.java
+++ b/user/src/com/google/gwt/uibinder/attributeparsers/FieldReferenceConverter.java
@@ -24,7 +24,8 @@
/**
* Deals with field references, e.g. the bits in braces here: <code><div
* class="{style.enabled} fancy {style.impressive}" /></code>, by converting
- * them to java expressions (with the help of a {@link #Delegate}).
+ * them to java expressions (with the help of a
+ * {@link FieldReferenceConverter.Delegate}).
* <p>
* A field reference is one or more segments separated by dots. The first
* segment is considered to be a reference to a ui field, and succeeding
@@ -44,7 +45,8 @@
*/
public class FieldReferenceConverter {
/**
- * May be thrown by the {@link #Delegate} for badly formatted input.
+ * May be thrown by the {@link FieldReferenceConverter.Delegate} for badly
+ * formatted input.
*/
@SuppressWarnings("serial")
public static class IllegalFieldReferenceException extends RuntimeException {
diff --git a/user/src/com/google/gwt/uibinder/client/UiChild.java b/user/src/com/google/gwt/uibinder/client/UiChild.java
index db992c6..3f11958 100644
--- a/user/src/com/google/gwt/uibinder/client/UiChild.java
+++ b/user/src/com/google/gwt/uibinder/client/UiChild.java
@@ -40,7 +40,7 @@
* <p>
* For example, <code>
*
- * @UiChild MyWidget#addCustomChild(Widget w) </code> and
+ * @UiChild MyWidget#addCustomChild(Widget w) </code> and
*
* <pre>
* <p:MyWidget>
diff --git a/user/src/com/google/gwt/uibinder/client/UiHandler.java b/user/src/com/google/gwt/uibinder/client/UiHandler.java
index d793954..4fdfe5f 100644
--- a/user/src/com/google/gwt/uibinder/client/UiHandler.java
+++ b/user/src/com/google/gwt/uibinder/client/UiHandler.java
@@ -23,7 +23,7 @@
/**
* Marks a method to be automatically bound as an event handler. See examples
- * in {@link com.google.gwt.uibinder.test.client.HandlerDemo}.
+ * in {@code com.google.gwt.uibinder.test.client.HandlerDemo}.
*
* <p>The annotation values must be declared in the "ui:field"
* template attribute.
diff --git a/user/src/com/google/gwt/uibinder/elementparsers/AttributeMessageParser.java b/user/src/com/google/gwt/uibinder/elementparsers/AttributeMessageParser.java
index 265f010..7a70e73 100644
--- a/user/src/com/google/gwt/uibinder/elementparsers/AttributeMessageParser.java
+++ b/user/src/com/google/gwt/uibinder/elementparsers/AttributeMessageParser.java
@@ -24,7 +24,7 @@
* This parser is not tied to a particular class of element, but rather is run
* as the first parser in any parser stack. It looks for attribute values that
* are set as calls to the template's generated Messages interface, by calling
- * {@link com.google.gwt.uibinder.rebind.messages.MessagesWriter.MessagesWriter#consumeAndStoreMessageAttributesFor
+ * {@link com.google.gwt.uibinder.rebind.messages.MessagesWriter#consumeAndStoreMessageAttributesFor(XMLElement)
* MessagesWriter.consumeAndStoreMessageAttributesFor}
*/
public class AttributeMessageParser implements ElementParser {
diff --git a/user/src/com/google/gwt/uibinder/elementparsers/ImageParser.java b/user/src/com/google/gwt/uibinder/elementparsers/ImageParser.java
index 8c122ea..55d27fc 100644
--- a/user/src/com/google/gwt/uibinder/elementparsers/ImageParser.java
+++ b/user/src/com/google/gwt/uibinder/elementparsers/ImageParser.java
@@ -25,7 +25,8 @@
/**
* Custom parsing of Image widgets. Sets ImageResource via constructor, because
- * {@link Image#setResource} clobbers most setter values.
+ * {@link com.google.gwt.user.client.ui.Image#setResource Image.setResource}
+ * clobbers most setter values.
*/
public class ImageParser implements ElementParser {
diff --git a/user/src/com/google/gwt/uibinder/elementparsers/UiChildParser.java b/user/src/com/google/gwt/uibinder/elementparsers/UiChildParser.java
index 69e9ff5..0c20025 100644
--- a/user/src/com/google/gwt/uibinder/elementparsers/UiChildParser.java
+++ b/user/src/com/google/gwt/uibinder/elementparsers/UiChildParser.java
@@ -32,7 +32,8 @@
import java.util.Map;
/**
- * Parses any children of widgets that use the {@link UiChild} annotation.
+ * Parses any children of widgets that use the
+ * {@link com.google.gwt.uibinder.client.UiChild UIChild} annotation.
*/
public class UiChildParser implements ElementParser {
diff --git a/user/src/com/google/gwt/user/cellview/client/CellTable.java b/user/src/com/google/gwt/user/cellview/client/CellTable.java
index 43208af..17fc161 100644
--- a/user/src/com/google/gwt/user/cellview/client/CellTable.java
+++ b/user/src/com/google/gwt/user/cellview/client/CellTable.java
@@ -52,7 +52,25 @@
/**
* A tabular view that supports paging and columns.
- *
+ *
+ * <p>
+ * <h3>Columns</h3>
+ * The {@link Column} class defines the {@link Cell} used to render a column.
+ * Implement {@link Column#getValue(Object)} to retrieve the field value from
+ * the row object that will be rendered in the {@link Cell}.
+ * </p>
+ *
+ * <p>
+ * <h3>Headers and Footers</h3>
+ * A {@link Header} can be placed at the top (header) or bottom (footer) of the
+ * {@link CellTable}. You can specify a header as text using
+ * {@link #addColumn(Column, String)}, or you can create a custom {@link Header}
+ * that can change with the value of the cells, such as a column total. The
+ * {@link Header} will be rendered every time the row data changes or the table
+ * is redrawn. If you pass the same header instance (==) into adjacent columns,
+ * the header will span the columns.
+ * </p>
+ *
* <p>
* <h3>Examples</h3>
* <dl>
@@ -269,8 +287,8 @@
@Template("<table><tfoot>{0}</tfoot></table>")
SafeHtml tfoot(SafeHtml rowHtml);
- @Template("<th class=\"{0}\">{1}</th>")
- SafeHtml th(String classes, SafeHtml contents);
+ @Template("<th colspan=\"{0}\" class=\"{1}\">{2}</th>")
+ SafeHtml th(int colspan, String classes, SafeHtml contents);
@Template("<table><thead>{0}</thead></table>")
SafeHtml thead(SafeHtml rowHtml);
@@ -432,11 +450,6 @@
private final List<Header<?>> headers = new ArrayList<Header<?>>();
- /**
- * Set to true when the footer is stale.
- */
- private boolean headersStale;
-
private TableRowElement hoveringRow;
/**
@@ -631,7 +644,6 @@
}
CellBasedWidgetImpl.get().sinkEvents(this, consumedEvents);
- headersStale = true;
scheduleRedraw();
}
@@ -750,7 +762,6 @@
headers.remove(index);
footers.remove(index);
updateDependsOnSelection();
- headersStale = true;
// Find an interactive column. Stick with 0 if no column is interactive.
if (index <= keyboardSelectedColumn) {
@@ -1119,7 +1130,7 @@
/**
* Render the header or footer.
- *
+ *
* @param isFooter true if this is the footer table, false if the header table
*/
private void createHeaders(boolean isFooter) {
@@ -1132,30 +1143,52 @@
SafeHtmlBuilder sb = new SafeHtmlBuilder();
sb.appendHtmlConstant("<tr>");
int columnCount = columns.size();
- int curColumn = 0;
- for (Header<?> header : theHeaders) {
+ if (columnCount > 0) {
+ // Setup the first column.
+ Header<?> prevHeader = theHeaders.get(0);
+ int prevColspan = 1;
StringBuilder classesBuilder = new StringBuilder(className);
- if (curColumn == 0) {
- classesBuilder.append(" ");
- classesBuilder.append(isFooter ? style.cellTableFirstColumnFooter()
- : style.cellTableFirstColumnHeader());
- }
- // The first and last columns could be the same column.
- if (curColumn == columnCount - 1) {
- classesBuilder.append(" ");
- classesBuilder.append(isFooter ? style.cellTableLastColumnFooter()
- : style.cellTableLastColumnHeader());
+ classesBuilder.append(" ");
+ classesBuilder.append(isFooter ? style.cellTableFirstColumnFooter()
+ : style.cellTableFirstColumnHeader());
+
+ // Loop through all column headers.
+ for (int curColumn = 1; curColumn < columnCount; curColumn++) {
+ Header<?> header = theHeaders.get(curColumn);
+
+ if (header != prevHeader) {
+ // The header has changed, so append the previous one.
+ SafeHtmlBuilder headerBuilder = new SafeHtmlBuilder();
+ if (prevHeader != null) {
+ hasHeader = true;
+ prevHeader.render(headerBuilder);
+ }
+ sb.append(template.th(prevColspan, classesBuilder.toString(),
+ headerBuilder.toSafeHtml()));
+
+ // Reset the previous header.
+ prevHeader = header;
+ prevColspan = 1;
+ classesBuilder = new StringBuilder(className);
+ } else {
+ // Increment the colspan if the headers == each other.
+ prevColspan++;
+ }
}
+ // Append the last header.
SafeHtmlBuilder headerBuilder = new SafeHtmlBuilder();
- if (header != null) {
+ if (prevHeader != null) {
hasHeader = true;
- header.render(headerBuilder);
+ prevHeader.render(headerBuilder);
}
- sb.append(template.th(classesBuilder.toString(),
+ // The first and last columns could be the same column.
+ classesBuilder.append(" ");
+ classesBuilder.append(isFooter ? style.cellTableLastColumnFooter()
+ : style.cellTableLastColumnHeader());
+ sb.append(template.th(prevColspan, classesBuilder.toString(),
headerBuilder.toSafeHtml()));
- curColumn++;
}
sb.appendHtmlConstant("</tr>");
@@ -1167,11 +1200,8 @@
}
private void createHeadersAndFooters() {
- if (headersStale) {
- headersStale = false;
- createHeaders(false);
- createHeaders(true);
- }
+ createHeaders(false);
+ createHeaders(true);
}
private void deselectKeyboardRow(int row) {
diff --git a/user/src/com/google/gwt/user/cellview/client/RowStyles.java b/user/src/com/google/gwt/user/cellview/client/RowStyles.java
index 4004665..f501d2b 100644
--- a/user/src/com/google/gwt/user/cellview/client/RowStyles.java
+++ b/user/src/com/google/gwt/user/cellview/client/RowStyles.java
@@ -31,5 +31,5 @@
* @return the extra styles of the given row in a space-separated list, or
* {@code null} if there are no extra styles for this row.
*/
- public String getStyleNames(T row, int rowIndex);
+ String getStyleNames(T row, int rowIndex);
}
diff --git a/user/src/com/google/gwt/user/client/Command.java b/user/src/com/google/gwt/user/client/Command.java
index 90b9bde..e664e31 100644
--- a/user/src/com/google/gwt/user/client/Command.java
+++ b/user/src/com/google/gwt/user/client/Command.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.user.client;
+import com.google.gwt.core.client.Scheduler;
+
/**
* Encapsulates an action for later execution, often from a different context.
*
@@ -22,14 +24,16 @@
* The Command interface provides a layer of separation between the code
* specifying some behavior and the code invoking that behavior. This separation
* aids in creating reusable code. For example, a
- * {@link com.google.gwt.user.client.ui.MenuItem} can have a Command
- * associated with it that it executes when the menu item is chosen by the user.
+ * {@link com.google.gwt.user.client.ui.MenuItem} can have a Command associated
+ * with it that it executes when the menu item is chosen by the user.
* Importantly, the code that constructed the Command to be executed when the
* menu item is invoked knows nothing about the internals of the MenuItem class
- * and vice-versa.</p>
+ * and vice-versa.
+ * </p>
*
- * <p> The Command interface is often implemented with an anonymous inner class.
- * For example,
+ * <p>
+ * The Command interface is often implemented with an anonymous inner class. For
+ * example,
*
* <pre>
* Command sayHello = new Command() {
@@ -41,9 +45,9 @@
* </pre>
*
* </p>
+ * This type extends ScheduledCommand to help migrate from DeferredCommand API.
*/
-public interface Command {
-
+public interface Command extends Scheduler.ScheduledCommand {
/**
* Causes the Command to perform its encapsulated behavior.
*/
diff --git a/user/src/com/google/gwt/user/client/DeferredCommand.java b/user/src/com/google/gwt/user/client/DeferredCommand.java
index 9fe21d4..3601913 100644
--- a/user/src/com/google/gwt/user/client/DeferredCommand.java
+++ b/user/src/com/google/gwt/user/client/DeferredCommand.java
@@ -20,7 +20,13 @@
* handlers have completed, using the {@link #addCommand(Command)} or
* {@link #addCommand(IncrementalCommand)} methods. This is useful when you need
* to execute code outside of the context of the current stack.
+ *
+ * @deprecated Replaced by
+ * {@link com.google.gwt.core.client.Scheduler#scheduleDeferred
+ * Scheduler.scheduleDeferred()} because the static nature of this
+ * API prevents effective mocking for JRE-only tests.
*/
+@Deprecated
public class DeferredCommand {
private static final CommandExecutor commandExecutor = new CommandExecutor();
@@ -80,6 +86,9 @@
* {@link DeferredCommand}s or pauses that are added after this pause will
* wait for an additional cycle through the system event loop before
* executing.
+ *
+ * @deprecated with no replacement because the presence of this method causes
+ * arbitrary scheduling decisions
*/
public static void addPause() {
commandExecutor.submit((Command) null);
diff --git a/user/src/com/google/gwt/user/client/History.java b/user/src/com/google/gwt/user/client/History.java
index ea62acd..8076f11 100644
--- a/user/src/com/google/gwt/user/client/History.java
+++ b/user/src/com/google/gwt/user/client/History.java
@@ -79,7 +79,6 @@
* @param listener the listener to be added
* @deprecated use {@link History#addValueChangeHandler(ValueChangeHandler)} instead
*/
- @SuppressWarnings("deprecation")
@Deprecated
public static void addHistoryListener(HistoryListener listener) {
if (impl != null) {
@@ -194,7 +193,6 @@
*
* @param listener the listener to be removed
*/
- @SuppressWarnings("deprecation")
@Deprecated
public static void removeHistoryListener(HistoryListener listener) {
if (impl != null) {
diff --git a/user/src/com/google/gwt/user/client/IncrementalCommand.java b/user/src/com/google/gwt/user/client/IncrementalCommand.java
index d2f9739..dd53bd3 100644
--- a/user/src/com/google/gwt/user/client/IncrementalCommand.java
+++ b/user/src/com/google/gwt/user/client/IncrementalCommand.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.user.client;
+import com.google.gwt.core.client.Scheduler.RepeatingCommand;
+
/**
* An <code>IncrementalCommand</code> is a command that is broken into one or
* more substeps, each substep brings the whole command nearer to completion.
@@ -22,8 +24,13 @@
* <code>false</code>.
*
* {@example com.google.gwt.examples.IncrementalCommandExample}
+ *
+ * @deprecated Replaced by {@link RepeatingCommand} and
+ * {@link com.google.gwt.core.client.Scheduler#scheduleIncremental
+ * Scheduler.scheduleIncremental()}
*/
-public interface IncrementalCommand {
+@Deprecated
+public interface IncrementalCommand extends RepeatingCommand {
/**
* Causes the <code>IncrementalCommand</code> to execute its encapsulated
* behavior.
diff --git a/user/src/com/google/gwt/user/client/ResponseTextHandler.java b/user/src/com/google/gwt/user/client/ResponseTextHandler.java
index 7e608c6..bd0458e 100644
--- a/user/src/com/google/gwt/user/client/ResponseTextHandler.java
+++ b/user/src/com/google/gwt/user/client/ResponseTextHandler.java
@@ -15,9 +15,10 @@
*/
package com.google.gwt.user.client;
+// TODO - is this class still used anywhere?
+
/**
- * Implement this interface to receive HTTP completion events. This event is
- * fired by {@link com.google.gwt.user.client.HTTPRequest}.
+ * Implement this interface to receive HTTP completion events.
*/
public interface ResponseTextHandler {
diff --git a/user/src/com/google/gwt/user/client/Window.java b/user/src/com/google/gwt/user/client/Window.java
index d768a31..9c7339b 100644
--- a/user/src/com/google/gwt/user/client/Window.java
+++ b/user/src/com/google/gwt/user/client/Window.java
@@ -27,7 +27,6 @@
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
import com.google.gwt.http.client.URL;
import com.google.gwt.http.client.UrlBuilder;
import com.google.gwt.user.client.impl.WindowImpl;
@@ -479,7 +478,7 @@
}
private static class WindowHandlers extends HandlerManager implements
- HasCloseHandlers<Window>, HasResizeHandlers, HasHandlers {
+ HasCloseHandlers<Window>, HasResizeHandlers {
public WindowHandlers() {
super(null);
diff --git a/user/src/com/google/gwt/user/client/rpc/core/java/util/logging/Level_CustomFieldSerializer.java b/user/src/com/google/gwt/user/client/rpc/core/java/util/logging/Level_CustomFieldSerializer.java
index 07f5335..dbd0416 100644
--- a/user/src/com/google/gwt/user/client/rpc/core/java/util/logging/Level_CustomFieldSerializer.java
+++ b/user/src/com/google/gwt/user/client/rpc/core/java/util/logging/Level_CustomFieldSerializer.java
@@ -23,9 +23,10 @@
import java.util.logging.Level;
/**
- * Custom serializer for Level class
+ * Custom serializer for Level class.
*/
public class Level_CustomFieldSerializer {
+ @SuppressWarnings("unused")
public static void deserialize(SerializationStreamReader reader,
Level instance) throws SerializationException {
// Nothing needed
diff --git a/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java b/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java
index d00658c..849ffe6 100644
--- a/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java
+++ b/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java
@@ -273,9 +273,10 @@
ex);
callback.onFailure(iex);
} finally {
- boolean toss = statsContext.isStatsAvailable() &&
- statsContext.stats(statsContext.bytesStat(methodName, requestData.length(),
- "requestSent"));
+ if (statsContext.isStatsAvailable()) {
+ statsContext.stats(statsContext.bytesStat(methodName,
+ requestData.length(), "requestSent"));
+ }
}
return null;
}
diff --git a/user/src/com/google/gwt/user/client/ui/CustomButton.java b/user/src/com/google/gwt/user/client/ui/CustomButton.java
index f07b08a..7cbe936 100644
--- a/user/src/com/google/gwt/user/client/ui/CustomButton.java
+++ b/user/src/com/google/gwt/user/client/ui/CustomButton.java
@@ -757,6 +757,7 @@
}
}
+ @Override
public void setHTML(SafeHtml html) {
setHTML(html.asString());
}
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 65b1b39..6fe54bf 100644
--- a/user/src/com/google/gwt/user/client/ui/HTML.java
+++ b/user/src/com/google/gwt/user/client/ui/HTML.java
@@ -161,12 +161,13 @@
/**
* Sets the label's content to the given HTML, applying the given direction.
- * See {@link #setText(String, Direction)} for details on potential effects on
- * alignment.
- *
+ * See
+ * {@link #setText(String, com.google.gwt.i18n.client.HasDirection.Direction)
+ * setText(String, Direction)} for details on potential effects on alignment.
+ *
* @param html the new widget's HTML content
* @param dir the content's direction. Note: {@code Direction.DEFAULT} means
- * direction should be inherited from the widget's parent element.
+ * direction should be inherited from the widget's parent element.
*/
public void setHTML(String html, Direction dir) {
setTextOrHtml(html, dir, true);
@@ -175,13 +176,15 @@
/**
* Sets this object's contents via known-safe HTML.
*
- * @see com.google.gwt.safehtml.client.HasSafeHtml#setSafeHtml
+ * @see com.google.gwt.safehtml.client.HasSafeHtml#setHTML(SafeHtml)
* @param html the html to set.
*/
+ @Override
public void setHTML(SafeHtml html) {
setHTML(html.asString());
}
+ @Override
public void setHTML(SafeHtml html, Direction dir) {
setHTML(html.asString(), dir);
}
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 e624fbe..a1a0bc1 100644
--- a/user/src/com/google/gwt/user/client/ui/InlineHTML.java
+++ b/user/src/com/google/gwt/user/client/ui/InlineHTML.java
@@ -17,7 +17,6 @@
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
-import com.google.gwt.i18n.client.HasDirection.Direction;
import com.google.gwt.safehtml.shared.SafeHtml;
/**
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 f9c18f8..75bafab 100644
--- a/user/src/com/google/gwt/user/client/ui/InlineLabel.java
+++ b/user/src/com/google/gwt/user/client/ui/InlineLabel.java
@@ -17,7 +17,6 @@
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
-import com.google.gwt.i18n.client.HasDirection.Direction;
/**
* A widget that contains arbitrary text, <i>not</i> interpreted as HTML.
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 7c81449..9811f76 100644
--- a/user/src/com/google/gwt/user/client/ui/Label.java
+++ b/user/src/com/google/gwt/user/client/ui/Label.java
@@ -402,11 +402,12 @@
/**
* Sets the label's content to the given text.
* <p>
- * Doesn't change the widget's direction or horizontal alignment if
- * {@code directionEstimator} is null. Otherwise, the widget's direction is
- * set using the estimator, and its alignment may therefore change as
- * described in {@link #setText(String, Direction)}.
- *
+ * Doesn't change the widget's direction or horizontal alignment if {@code
+ * directionEstimator} is null. Otherwise, the widget's direction is set using
+ * the estimator, and its alignment may therefore change as described in
+ * {@link #setText(String, com.google.gwt.i18n.client.HasDirection.Direction)
+ * setText(String, Direction)}.
+ *
* @param text the widget's new text
*/
public void setText(String text) {
@@ -500,15 +501,15 @@
/**
* Sets the label's content to the given value (either plain text or HTML),
- * applying the given direction.
- * See {@link #setText(String, Direction)} for details on potential effects on
- * alignment.
+ * applying the given direction. See
+ * {@link #setText(String, com.google.gwt.i18n.client.HasDirection.Direction)
+ * setText(String, Direction)} for details on potential effects on alignment.
* <p>
* Implementation details:
* <ul>
- * <li> If the widget's element is a <div>, sets its dir attribute
+ * <li>If the widget's element is a <div>, sets its dir attribute
* according to the given direction.
- * <li> Otherwise (i.e. the widget's element is a <span>), the direction
+ * <li>Otherwise (i.e. the widget's element is a <span>), the direction
* is set using a nested <span dir=...> element which holds the content
* of the widget. This nested span may be followed by a zero-width Unicode
* direction character (LRM or RLM). This manipulation is necessary to prevent
@@ -516,7 +517,7 @@
* of its context. See {@link com.google.gwt.i18n.shared.BidiFormatter} for
* more details.
* </ul>
- *
+ *
* @param content the widget's new content
* @param dir the content's direction
* @param isHtml whether the content is HTML
@@ -572,5 +573,3 @@
}
}
}
-
-
diff --git a/user/src/com/google/gwt/user/client/ui/PopupPanel.java b/user/src/com/google/gwt/user/client/ui/PopupPanel.java
index 15b39c6..9d1cd74 100644
--- a/user/src/com/google/gwt/user/client/ui/PopupPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/PopupPanel.java
@@ -719,7 +719,6 @@
* @return <code>false</code> to suppress the event
* @deprecated Use {@link #onPreviewNativeEvent} instead
*/
- @SuppressWarnings("unused")
@Deprecated
public boolean onKeyDownPreview(char key, int modifiers) {
return true;
@@ -735,7 +734,6 @@
* @return <code>false</code> to suppress the event
* @deprecated Use {@link #onPreviewNativeEvent} instead
*/
- @SuppressWarnings("unused")
@Deprecated
public boolean onKeyPressPreview(char key, int modifiers) {
return true;
@@ -751,7 +749,6 @@
* @return <code>false</code> to suppress the event
* @deprecated Use {@link #onPreviewNativeEvent} instead
*/
- @SuppressWarnings("unused")
@Deprecated
public boolean onKeyUpPreview(char key, int modifiers) {
return true;
diff --git a/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java b/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java
index 908e992..9ea1e6a 100644
--- a/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java
@@ -416,7 +416,7 @@
*
* Use care when setting an object's HTML; it is an easy way to expose
* script-based security problems. Consider using
- * {@link #setHeaderSafeHtml(int, SafeHtml)} or
+ * {@link #setHeaderHTML(int, SafeHtml)} or
* {@link #setHeaderText(int, String)} whenever possible.
*
* @param index the index of the header whose HTML is to be set
diff --git a/user/src/com/google/gwt/user/client/ui/SuggestOracle.java b/user/src/com/google/gwt/user/client/ui/SuggestOracle.java
index 2941353..447bd1c 100644
--- a/user/src/com/google/gwt/user/client/ui/SuggestOracle.java
+++ b/user/src/com/google/gwt/user/client/ui/SuggestOracle.java
@@ -182,7 +182,7 @@
/**
* Gets whether or not the suggestion list was truncated due to the
- * {@Request#getLimit}.
+ * {@link Request#getLimit}.
*/
public boolean hasMoreSuggestions() {
return this.moreSuggestions;
@@ -190,7 +190,7 @@
/**
* Sets whether or not the suggestion list was truncated due to the
- * {@Request#getLimit}.
+ * {@link Request#getLimit}.
*/
public void setMoreSuggestions(boolean moreSuggestions) {
this.moreSuggestions = moreSuggestions;
@@ -198,12 +198,12 @@
/**
* Sets whether or not the suggestion list was truncated due to the
- * {@Request#getLimit}, by providing an exact count of remaining
+ * {@link Request#getLimit}, by providing an exact count of remaining
* suggestions.
*
* @param count number of truncated suggestions. Pass 0 to indicate there
- * are no other suggestions, which is equivlent to
- * {@link #setMoreSuggestions(false)}.
+ * are no other suggestions, which is equivalent to
+ * {@link #setMoreSuggestions(boolean) setMoreSuggestions(false)}.
*/
public void setMoreSuggestionsCount(int count) {
this.numMoreSuggestions = count;
diff --git a/user/src/com/google/gwt/user/client/ui/TabBar.java b/user/src/com/google/gwt/user/client/ui/TabBar.java
index 97ff54a..19367ea 100644
--- a/user/src/com/google/gwt/user/client/ui/TabBar.java
+++ b/user/src/com/google/gwt/user/client/ui/TabBar.java
@@ -259,8 +259,8 @@
}
/**
- * @deprecated Use {@link #addBeforeSelectionHandler} and {#link
- * #addSelectionHandler} instead
+ * @deprecated Use {@link #addBeforeSelectionHandler(BeforeSelectionHandler)}
+ * and {@link #addSelectionHandler(SelectionHandler)} instead
*/
@Deprecated
public void addTabListener(TabListener listener) {
@@ -522,7 +522,7 @@
*
* Use care when setting an object's HTML; it is an easy way to expose
* script-based security problems. Consider using
- * {@link #setTabText(int, String)} or {@link setTabHTML(int, SafeHtml)}
+ * {@link #setTabText(int, String)} or {@link #setTabHTML(int, SafeHtml)}
* whenever possible.
*
* @param index the index of the tab whose HTML is to be set
diff --git a/user/src/com/google/gwt/user/client/ui/TabLayoutPanel.java b/user/src/com/google/gwt/user/client/ui/TabLayoutPanel.java
index 5b907d3..378a93b 100644
--- a/user/src/com/google/gwt/user/client/ui/TabLayoutPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/TabLayoutPanel.java
@@ -557,7 +557,7 @@
*
* Use care when setting an object's HTML; it is an easy way to expose
* script-based security problems. Consider using
- * {@link #setTabSafeHtml(int, SafeHtml)} or
+ * {@link #setTabHTML(int, SafeHtml)} or
* {@link #setTabText(int, String)} whenever possible.
*
* @param index the index of the tab whose HTML is to be set
diff --git a/user/src/com/google/gwt/user/client/ui/TabPanel.java b/user/src/com/google/gwt/user/client/ui/TabPanel.java
index e2c5ea6..1253cdf 100644
--- a/user/src/com/google/gwt/user/client/ui/TabPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/TabPanel.java
@@ -67,8 +67,8 @@
* @see TabLayoutPanel
*/
-@SuppressWarnings("deprecation")
-//Cannot do anything about tab panel implementing TabListener until next release.
+// Cannot do anything about tab panel implementing TabListener until next
+// release
@Deprecated
public class TabPanel extends Composite implements TabListener,
SourcesTabEvents, HasWidgets, HasAnimation, IndexedPanel.ForIsWidget,
diff --git a/user/src/com/google/gwt/user/client/ui/ValueListBox.java b/user/src/com/google/gwt/user/client/ui/ValueListBox.java
index 1fc235d..24b8b93 100644
--- a/user/src/com/google/gwt/user/client/ui/ValueListBox.java
+++ b/user/src/com/google/gwt/user/client/ui/ValueListBox.java
@@ -36,8 +36,8 @@
* Implementation of {@link HasConstrainedValue} based on a
* {@link com.google.gwt.dom.client.SelectElement}.
* <p>
- * A {@link Renderer<T>} is used to get user presentable strings to display in
- * the select element.
+ * A {@link Renderer Renderer<T>} is used to get user-presentable strings to
+ * display in the select element.
*
* @param <T> the value type
*/
diff --git a/user/src/com/google/gwt/user/client/ui/Widget.java b/user/src/com/google/gwt/user/client/ui/Widget.java
index 43191cd..c80a25a 100644
--- a/user/src/com/google/gwt/user/client/ui/Widget.java
+++ b/user/src/com/google/gwt/user/client/ui/Widget.java
@@ -22,8 +22,8 @@
import com.google.gwt.event.logical.shared.HasAttachHandlers;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.GwtEvent.Type;
import com.google.gwt.event.shared.HandlerManager;
+import com.google.gwt.event.shared.GwtEvent.Type;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
@@ -378,7 +378,8 @@
/**
* This method is called immediately after a widget becomes attached to the
* browser's document. This default implementation notifies the widgets
- * {@link AttachEvent.Handler}s.
+ * {@link com.google.gwt.event.logical.shared.AttachEvent.Handler
+ * AttachEvent.Handler}s.
*/
protected void onLoad() {
AttachEvent.fire(this, true);
@@ -386,8 +387,9 @@
/**
* This method is called immediately before a widget will be detached from the
- * browser's document. This default implementation notifies the widgets
- * {@link AttachEvent.Handler}s.
+ * browser's document. This default implementation notifies the widget's
+ * {@link com.google.gwt.event.logical.shared.AttachEvent.Handler
+ * AttachEvent.Handler}s.
*/
protected void onUnload() {
AttachEvent.fire(this, false);
diff --git a/user/src/com/google/gwt/user/datepicker/client/DateChangeEvent.java b/user/src/com/google/gwt/user/datepicker/client/DateChangeEvent.java
index c08c8cc..3734073 100644
--- a/user/src/com/google/gwt/user/datepicker/client/DateChangeEvent.java
+++ b/user/src/com/google/gwt/user/datepicker/client/DateChangeEvent.java
@@ -32,7 +32,6 @@
* Use this call rather than making the decision to short circuit yourself for
* safe handling of null.
*
- * @param <I> the old value type
* @param <S> The event source
* @param source the source of the handlers
* @param oldValue the oldValue, may be null
diff --git a/user/src/com/google/gwt/user/server/rpc/RPCServletUtils.java b/user/src/com/google/gwt/user/server/rpc/RPCServletUtils.java
index b417680..8e1d36e 100644
--- a/user/src/com/google/gwt/user/server/rpc/RPCServletUtils.java
+++ b/user/src/com/google/gwt/user/server/rpc/RPCServletUtils.java
@@ -217,7 +217,7 @@
* @throws ServletException if the content length of the request is not
* specified of if the request's content type is not
* 'text/x-gwt-rpc' and 'charset=utf-8'
- * @deprecated Use {@link readContent} instead.
+ * @deprecated Use {@link #readContent} instead.
*/
@Deprecated
public static String readContentAsUtf8(HttpServletRequest request)
@@ -241,7 +241,7 @@
* @throws ServletException if the content length of the request is not
* specified of if the request's content type is not
* 'text/x-gwt-rpc' and 'charset=utf-8'
- * @deprecated Use {@link readContent} instead.
+ * @deprecated Use {@link #readContent} instead.
*/
@Deprecated
public static String readContentAsUtf8(HttpServletRequest request,
diff --git a/user/src/com/google/gwt/user/tools/.classpathsrc b/user/src/com/google/gwt/user/tools/.classpathsrc
index 8533fe3..562628a 100644
--- a/user/src/com/google/gwt/user/tools/.classpathsrc
+++ b/user/src/com/google/gwt/user/tools/.classpathsrc
@@ -6,4 +6,5 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="output" path="@warFolder/WEB-INF/classes"/>
+@serverClasspathLibs
</classpath>
diff --git a/user/src/com/google/gwt/user/tools/WebAppCreator.java b/user/src/com/google/gwt/user/tools/WebAppCreator.java
index a3cdf60..8c5f373 100644
--- a/user/src/com/google/gwt/user/tools/WebAppCreator.java
+++ b/user/src/com/google/gwt/user/tools/WebAppCreator.java
@@ -338,6 +338,7 @@
File srcDir = Utility.getDirectory(outDir, srcFolder, true);
File warDir = Utility.getDirectory(outDir, warFolder, true);
File webInfDir = Utility.getDirectory(warDir, "WEB-INF", true);
+ File libDir = Utility.getDirectory(webInfDir, "lib", true);
File moduleDir = Utility.getDirectory(srcDir, modulePackageName.replace(
'.', '/'), true);
File clientDir = Utility.getDirectory(moduleDir, "client", true);
@@ -370,6 +371,19 @@
replacements.put("@testFolder", testFolder);
replacements.put("@warFolder", warFolder);
+ // Collect the list of server libs to include on the eclipse classpath.
+ StringBuilder serverLibs = new StringBuilder();
+ if (libDir.exists()) {
+ for (File file : libDir.listFiles()) {
+ if (file.getName().toLowerCase().endsWith(".jar")) {
+ serverLibs.append(" <classpathentry kind=\"lib\" path=\"war/WEB-INF/lib/");
+ serverLibs.append(file.getName());
+ serverLibs.append("\"/>\n");
+ }
+ }
+ }
+ replacements.put("@serverClasspathLibs", serverLibs.toString());
+
String antEclipseRule = "";
if (noEclipse) {
/*
diff --git a/user/src/com/google/gwt/view/client/RangeChangeEvent.java b/user/src/com/google/gwt/view/client/RangeChangeEvent.java
index eaf0219..4a58b66 100644
--- a/user/src/com/google/gwt/view/client/RangeChangeEvent.java
+++ b/user/src/com/google/gwt/view/client/RangeChangeEvent.java
@@ -48,7 +48,7 @@
* @param source the source of the handlers
* @param range the new range
*/
- public static <I> void fire(HasRows source, Range range) {
+ public static void fire(HasRows source, Range range) {
if (TYPE != null) {
RangeChangeEvent event = new RangeChangeEvent(range);
source.fireEvent(event);
diff --git a/user/src/com/google/gwt/view/client/RowCountChangeEvent.java b/user/src/com/google/gwt/view/client/RowCountChangeEvent.java
index 19f71e9..c166d3e 100644
--- a/user/src/com/google/gwt/view/client/RowCountChangeEvent.java
+++ b/user/src/com/google/gwt/view/client/RowCountChangeEvent.java
@@ -48,7 +48,7 @@
* @param source the source of the handlers
* @param rowCount the new rowCount
*/
- public static <I> void fire(HasRows source, int rowCount, boolean isExact) {
+ public static void fire(HasRows source, int rowCount, boolean isExact) {
if (TYPE != null) {
RowCountChangeEvent event = new RowCountChangeEvent(rowCount, isExact);
source.fireEvent(event);
diff --git a/user/src/com/google/gwt/xhr/client/ReadyStateChangeHandler.java b/user/src/com/google/gwt/xhr/client/ReadyStateChangeHandler.java
index feec633..6ea5905 100644
--- a/user/src/com/google/gwt/xhr/client/ReadyStateChangeHandler.java
+++ b/user/src/com/google/gwt/xhr/client/ReadyStateChangeHandler.java
@@ -16,13 +16,13 @@
package com.google.gwt.xhr.client;
/**
- * A ready-state callback for an {@Link XMLHttpRequest} object.
+ * A ready-state callback for an {@link XMLHttpRequest} object.
*/
public interface ReadyStateChangeHandler {
/**
* This is called whenever the state of the XMLHttpRequest changes. See
- * {@link XMLHttpRequest#setOnReadyStateHandler}.
+ * {@link XMLHttpRequest#setOnReadyStateChange}.
*
* @param xhr the object whose state has changed.
*/
diff --git a/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java b/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java
index a84e8a3..c1a1d15 100644
--- a/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java
+++ b/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java
@@ -19,10 +19,11 @@
/**
* The native XMLHttpRequest object. Most applications should use the higher-
- * level {@link RequestBuilder} class unless they need specific functionality
- * provided by the XMLHttpRequest object.
+ * level {@link com.google.gwt.http.client.RequestBuilder} class unless they
+ * need specific functionality provided by the XMLHttpRequest object.
*
- * @see http://www.w3.org/TR/XMLHttpRequest/
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/"
+ * >http://www.w3.org/TR/XMLHttpRequest/</a>/
*/
public class XMLHttpRequest extends JavaScriptObject {
@@ -100,8 +101,9 @@
/**
* Aborts the current request.
- *
- * @see http://www.w3.org/TR/XMLHttpRequest/#abort
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#abort"
+ * >http://www.w3.org/TR/XMLHttpRequest/#abort</a>.
*/
public final native void abort() /*-{
this.abort();
@@ -109,9 +111,11 @@
/**
* Clears the {@link ReadyStateChangeHandler}.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange"
+ * >http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange</a>.
*
* @see #clearOnReadyStateChange()
- * @see http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange
*/
public final native void clearOnReadyStateChange() /*-{
var self = this;
@@ -124,9 +128,11 @@
/**
* Gets all the HTTP response headers, as a single string.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#getallresponseheaders"
+ * >http://www.w3.org/TR/XMLHttpRequest/#getallresponseheaders</a>.
*
* @return the response headers.
- * @see http://www.w3.org/TR/XMLHttpRequest/#getallresponseheaders
*/
public final native String getAllResponseHeaders() /*-{
return this.getAllResponseHeaders();
@@ -134,9 +140,11 @@
/**
* Get's the current ready-state.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#readystate"
+ * >http://www.w3.org/TR/XMLHttpRequest/#readystate</a>.
*
* @return the ready-state constant
- * @see http://www.w3.org/TR/XMLHttpRequest/#readystate
*/
public final native int getReadyState() /*-{
return this.readyState;
@@ -144,10 +152,12 @@
/**
* Gets an HTTP response header.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#getresponseheader"
+ * >http://www.w3.org/TR/XMLHttpRequest/#getresponseheader</a>.
*
* @param header the response header to be retrieved
* @return the header value
- * @see http://www.w3.org/TR/XMLHttpRequest/#getresponseheader
*/
public final native String getResponseHeader(String header) /*-{
return this.getResponseHeader(header);
@@ -155,9 +165,11 @@
/**
* Gets the response text.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#responsetext"
+ * >http://www.w3.org/TR/XMLHttpRequest/#responsetext</a>.
*
* @return the response text
- * @see http://www.w3.org/TR/XMLHttpRequest/#responsetext
*/
public final native String getResponseText() /*-{
return this.responseText;
@@ -165,9 +177,11 @@
/**
* Gets the status code.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#status"
+ * >http://www.w3.org/TR/XMLHttpRequest/#status</a>.
*
* @return the status code
- * @see http://www.w3.org/TR/XMLHttpRequest/#status
*/
public final native int getStatus() /*-{
return this.status;
@@ -175,9 +189,11 @@
/**
* Gets the status text.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#statustext"
+ * >http://www.w3.org/TR/XMLHttpRequest/#statustext</a>.
*
* @return the status text
- * @see http://www.w3.org/TR/XMLHttpRequest/#statustext
*/
public final native String getStatusText() /*-{
return this.statusText;
@@ -185,10 +201,12 @@
/**
* Opens an asynchronous connection.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#open"
+ * >http://www.w3.org/TR/XMLHttpRequest/#open</a>.
*
* @param httpMethod the HTTP method to use
* @param url the URL to be opened
- * @see http://www.w3.org/TR/XMLHttpRequest/#open
*/
public final native void open(String httpMethod, String url) /*-{
this.open(httpMethod, url, true);
@@ -196,11 +214,13 @@
/**
* Opens an asynchronous connection.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#open"
+ * >http://www.w3.org/TR/XMLHttpRequest/#open</a>.
*
* @param httpMethod the HTTP method to use
* @param url the URL to be opened
* @param user user to use in the URL
- * @see http://www.w3.org/TR/XMLHttpRequest/#open
*/
public final native void open(String httpMethod, String url, String user) /*-{
this.open(httpMethod, url, true, user);
@@ -208,12 +228,14 @@
/**
* Opens an asynchronous connection.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#open"
+ * >http://www.w3.org/TR/XMLHttpRequest/#open</a>.
*
* @param httpMethod the HTTP method to use
* @param url the URL to be opened
* @param user user to use in the URL
* @param password password to use in the URL
- * @see http://www.w3.org/TR/XMLHttpRequest/#open
*/
public final native void open(String httpMethod, String url, String user,
String password) /*-{
@@ -231,9 +253,11 @@
/**
* Initiates a request with data. If there is no data, specify null.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#send"
+ * >http://www.w3.org/TR/XMLHttpRequest/#send</a>.
*
* @param requestData the data to be sent with the request
- * @see http://www.w3.org/TR/XMLHttpRequest/#send
*/
public final native void send(String requestData) /*-{
this.send(requestData);
@@ -242,6 +266,9 @@
/**
* Sets the {@link ReadyStateChangeHandler} to be notified when the object's
* ready-state changes.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange"
+ * >http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange</a>.
*
* <p>
* Note: Applications <em>must</em> call {@link #clearOnReadyStateChange()}
@@ -251,7 +278,6 @@
*
* @param handler the handler to be called when the ready state changes
* @see #clearOnReadyStateChange()
- * @see http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange
*/
public final native void setOnReadyStateChange(ReadyStateChangeHandler handler) /*-{
// The 'this' context is always supposed to point to the xhr object in the
@@ -264,10 +290,12 @@
/**
* Sets a request header.
+ * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#setrequestheader"
+ * >http://www.w3.org/TR/XMLHttpRequest/#setrequestheader</a>.
*
* @param header the header to be set
* @param value the header's value
- * @see http://www.w3.org/TR/XMLHttpRequest/#setrequestheader
*/
public final native void setRequestHeader(String header, String value) /*-{
this.setRequestHeader(header, value);
diff --git a/user/test/com/google/gwt/core/ext/test/CrossSiteIframeLinkerTest.java b/user/test/com/google/gwt/core/ext/test/CrossSiteIframeLinkerTest.java
index b6b8d2f..81a2684 100644
--- a/user/test/com/google/gwt/core/ext/test/CrossSiteIframeLinkerTest.java
+++ b/user/test/com/google/gwt/core/ext/test/CrossSiteIframeLinkerTest.java
@@ -19,7 +19,6 @@
import com.google.gwt.junit.DoNotRunWith;
import com.google.gwt.junit.Platform;
-
/**
* Integration test of the cross-site iframe linker.
*/
diff --git a/user/test/com/google/gwt/dev/jjs/test/EnumsWithNameObfuscationTest.java b/user/test/com/google/gwt/dev/jjs/test/EnumsWithNameObfuscationTest.java
index 295c689..d669efc 100644
--- a/user/test/com/google/gwt/dev/jjs/test/EnumsWithNameObfuscationTest.java
+++ b/user/test/com/google/gwt/dev/jjs/test/EnumsWithNameObfuscationTest.java
@@ -78,8 +78,7 @@
} catch (IllegalArgumentException expected) {
}
}
-
-
+
@Override
public void testCompareTo() {
diff --git a/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java b/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java
index 158331b..048745d 100644
--- a/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java
+++ b/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java
@@ -924,7 +924,7 @@
*/
public void testNullValueInIntegerListRequest() {
delayTestFinish(DELAY_TEST_FINISH);
- List<Integer> list = Arrays.asList(new Integer[]{1, 2, null});
+ List<Integer> list = Arrays.asList(new Integer[] {1, 2, null});
final Request<Void> fooReq = req.simpleFooRequest().receiveNullValueInIntegerList(
list);
fooReq.fire(new Receiver<Void>() {
@@ -940,7 +940,7 @@
*/
public void testNullValueInStringListRequest() {
delayTestFinish(DELAY_TEST_FINISH);
- List<String> list = Arrays.asList(new String[]{"nonnull", "null", null});
+ List<String> list = Arrays.asList(new String[] {"nonnull", "null", null});
final Request<Void> fooReq = req.simpleFooRequest().receiveNullValueInStringList(
list);
fooReq.fire(new Receiver<Void>() {
@@ -1762,7 +1762,7 @@
@Override
public void onSuccess(SimpleFooProxy response) {
assertEquals(2, response.getOneToManyField().size());
-
+
// Check lists of proxies returned from a mutable object are mutable
response = simpleFooRequest().edit(response);
response.getOneToManyField().get(0).setUserName("canMutate");
@@ -1960,6 +1960,64 @@
});
}
+ /**
+ * This is analagous to FindServiceTest.testFetchDeletedEntity() only we're
+ * trying to invoke a method on the deleted entity using a stale EntityProxy
+ * reference on the client.
+ */
+ public void testUseOfDeletedEntity() {
+ delayTestFinish(DELAY_TEST_FINISH);
+ SimpleBarRequest context = simpleBarRequest();
+ SimpleBarProxy willDelete = context.create(SimpleBarProxy.class);
+ willDelete.setUserName("A");
+
+ // Persist the newly-created object
+ context.persistAndReturnSelf().using(willDelete).fire(
+ new Receiver<SimpleBarProxy>() {
+ @Override
+ public void onSuccess(SimpleBarProxy response) {
+ assertEquals("A", response.getUserName());
+ // Mark the object as deleted
+ SimpleBarRequest context = simpleBarRequest();
+ response = context.edit(response);
+ response.setFindFails(true);
+ response.setUserName("B");
+ context.persistAndReturnSelf().using(response).fire(
+ new Receiver<SimpleBarProxy>() {
+
+ @Override
+ public void onSuccess(SimpleBarProxy response) {
+ // The last-known state should be returned
+ assertNotNull(response);
+ assertEquals("B", response.getUserName());
+
+ SimpleBarRequest context = simpleBarRequest();
+ // Ensure attempts to mutate deleted objects don't blow up
+ response = context.edit(response);
+ response.setUserName("C");
+
+ // Attempting to use the now-deleted object should fail
+ context.persistAndReturnSelf().using(response).fire(
+ new Receiver<SimpleBarProxy>() {
+ @Override
+ public void onFailure(ServerFailure error) {
+ assertTrue(error.getMessage().contains(
+ "The requested entity is not available on"
+ + " the server"));
+ finishTestAndReset();
+ }
+
+ @Override
+ public void onSuccess(SimpleBarProxy response) {
+ fail();
+ }
+ });
+ }
+ });
+ }
+ });
+ }
+
public void testViolationAbsent() {
delayTestFinish(DELAY_TEST_FINISH);
diff --git a/user/test/com/google/gwt/resources/client/DataResourceDoNotEmbedTest.java b/user/test/com/google/gwt/resources/client/DataResourceDoNotEmbedTest.java
index cb96a26..e9f188b 100644
--- a/user/test/com/google/gwt/resources/client/DataResourceDoNotEmbedTest.java
+++ b/user/test/com/google/gwt/resources/client/DataResourceDoNotEmbedTest.java
@@ -42,7 +42,7 @@
}
/**
- * RFC 2397 data URL scheme
+ * RFC 2397 data URL scheme.
*/
private static final String DATA_URL_SCHEME = "data:";
diff --git a/user/test/com/google/gwt/uibinder/test/client/HandlerDemo.java b/user/test/com/google/gwt/uibinder/test/client/HandlerDemo.java
index ad812af..4416a5a 100644
--- a/user/test/com/google/gwt/uibinder/test/client/HandlerDemo.java
+++ b/user/test/com/google/gwt/uibinder/test/client/HandlerDemo.java
@@ -71,8 +71,7 @@
}
@UiHandler("buttonSubmit")
- @SuppressWarnings("unused")
- void doClickSubmit(ClickEvent ignored) {
+ void doClickSubmit(@SuppressWarnings("unused") ClickEvent ignored) {
panelForm.submit();
}
diff --git a/user/test/com/google/gwt/user/cellview/client/CellTableTest.java b/user/test/com/google/gwt/user/cellview/client/CellTableTest.java
index ad5a790..4c42144 100644
--- a/user/test/com/google/gwt/user/cellview/client/CellTableTest.java
+++ b/user/test/com/google/gwt/user/cellview/client/CellTableTest.java
@@ -1,12 +1,12 @@
/*
* Copyright 2010 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
@@ -16,12 +16,130 @@
package com.google.gwt.user.cellview.client;
import com.google.gwt.cell.client.TextCell;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.TableCellElement;
+import com.google.gwt.dom.client.TableElement;
+import com.google.gwt.dom.client.TableRowElement;
+import com.google.gwt.dom.client.TableSectionElement;
+import com.google.gwt.user.cellview.client.CellTable.Resources;
+import com.google.gwt.user.cellview.client.CellTable.Style;
/**
* Tests for {@link CellTable}.
*/
public class CellTableTest extends AbstractHasDataTestBase {
+ /**
+ * Test headers that span multiple columns.
+ */
+ public void testMultiColumnHeader() {
+ Resources res = GWT.create(Resources.class);
+ CellTable<String> table = new CellTable<String>(10, res);
+ TextHeader header = new TextHeader("Hello");
+
+ // Get the style information.
+ Style style = res.cellTableStyle();
+ String styleHeader = style.cellTableHeader();
+ String styleFirstColumn = style.cellTableFirstColumnHeader();
+ String styleLastColumn = style.cellTableLastColumnHeader();
+
+ // No header.
+ table.redraw();
+ assertEquals(0, getHeaderCount(table));
+
+ // Single column.
+ table.addColumn(new TextColumn<String>() {
+ @Override
+ public String getValue(String object) {
+ return null;
+ }
+ }, header);
+ table.redraw();
+ assertEquals(1, getHeaderCount(table));
+ assertEquals(1, getHeaderElement(table, 0).getColSpan());
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(styleHeader));
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(
+ styleFirstColumn));
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(
+ styleLastColumn));
+
+ // Header spans both columns.
+ table.addColumn(new TextColumn<String>() {
+ @Override
+ public String getValue(String object) {
+ return null;
+ }
+ }, header);
+ table.redraw();
+ assertEquals(1, getHeaderCount(table));
+ assertEquals(2, getHeaderElement(table, 0).getColSpan());
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(styleHeader));
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(
+ styleFirstColumn));
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(
+ styleLastColumn));
+
+ // Header spans all three columns.
+ table.addColumn(new TextColumn<String>() {
+ @Override
+ public String getValue(String object) {
+ return null;
+ }
+ }, header);
+ table.redraw();
+ assertEquals(1, getHeaderCount(table));
+ assertEquals(3, getHeaderElement(table, 0).getColSpan());
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(styleHeader));
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(
+ styleFirstColumn));
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(
+ styleLastColumn));
+
+ // New header at fourth column.
+ table.addColumn(new TextColumn<String>() {
+ @Override
+ public String getValue(String object) {
+ return null;
+ }
+ }, "New Header");
+ table.redraw();
+ assertEquals(2, getHeaderCount(table));
+ assertEquals(3, getHeaderElement(table, 0).getColSpan());
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(styleHeader));
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(
+ styleFirstColumn));
+ assertEquals(1, getHeaderElement(table, 1).getColSpan());
+ assertTrue(getHeaderElement(table, 1).getClassName().contains(styleHeader));
+ assertTrue(getHeaderElement(table, 1).getClassName().contains(
+ styleLastColumn));
+
+ // Two separate spans of same header: HHHXHH.
+ table.addColumn(new TextColumn<String>() {
+ @Override
+ public String getValue(String object) {
+ return null;
+ }
+ }, header);
+ table.addColumn(new TextColumn<String>() {
+ @Override
+ public String getValue(String object) {
+ return null;
+ }
+ }, header);
+ table.redraw();
+ assertEquals(3, getHeaderCount(table));
+ assertEquals(3, getHeaderElement(table, 0).getColSpan());
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(styleHeader));
+ assertTrue(getHeaderElement(table, 0).getClassName().contains(
+ styleFirstColumn));
+ assertEquals(1, getHeaderElement(table, 1).getColSpan());
+ assertTrue(getHeaderElement(table, 1).getClassName().contains(styleHeader));
+ assertEquals(2, getHeaderElement(table, 2).getColSpan());
+ assertTrue(getHeaderElement(table, 2).getClassName().contains(styleHeader));
+ assertTrue(getHeaderElement(table, 2).getClassName().contains(
+ styleLastColumn));
+ }
+
@Override
protected CellTable<String> createAbstractHasData() {
CellTable<String> table = new CellTable<String>();
@@ -39,4 +157,31 @@
});
return table;
}
+
+ /**
+ * Get the number of column headers in the table.
+ *
+ * @param table the {@link CellTable}
+ * @return the number of column headers
+ */
+ private int getHeaderCount(CellTable<?> table) {
+ TableElement tableElem = table.getElement().cast();
+ TableSectionElement thead = tableElem.getTHead();
+ TableRowElement tr = thead.getRows().getItem(0);
+ return tr.getCells().getLength();
+ }
+
+ /**
+ * Get a column header from the table.
+ *
+ * @param table the {@link CellTable}
+ * @param column the column index
+ * @return the column header
+ */
+ private TableCellElement getHeaderElement(CellTable<?> table, int column) {
+ TableElement tableElem = table.getElement().cast();
+ TableSectionElement thead = tableElem.getTHead();
+ TableRowElement tr = thead.getRows().getItem(0);
+ return tr.getCells().getItem(column);
+ }
}
diff --git a/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java b/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java
index 026a8a9..02ba0ad 100644
--- a/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java
@@ -252,7 +252,7 @@
}
/**
- * Tests SafeHtml constructor
+ * Tests SafeHtml constructor.
*/
public void testSafeHtml() {
TestTemplates templates = GWT.create(TestTemplates.class);
diff --git a/user/test/com/google/gwt/user/server/rpc/RPCServletUtilsTest.java b/user/test/com/google/gwt/user/server/rpc/RPCServletUtilsTest.java
index d6b90b6..27c6932 100644
--- a/user/test/com/google/gwt/user/server/rpc/RPCServletUtilsTest.java
+++ b/user/test/com/google/gwt/user/server/rpc/RPCServletUtilsTest.java
@@ -41,7 +41,6 @@
final String mockContent;
final String mockContentType;
-
public MockReqContentType(String contentType) {
this(contentType, "abcdefg");
}