Revision: 8897
Author: [email protected]
Date: Wed Sep 29 11:01:14 2010
Log: Use generics for EntityProxyId
This affects the public API of FindRequest, which requires generator changes
Clean up generics in general
Remove some other warnings
Review at http://gwt-code-reviews.appspot.com/888802
http://code.google.com/p/google-web-toolkit/source/detail?r=8897
Modified:
/trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java
/trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
/trunk/user/src/com/google/gwt/app/place/AbstractProxyEditActivity.java
/trunk/user/src/com/google/gwt/app/place/ProxyPlaceToListPlace.java
/trunk/user/src/com/google/gwt/editor/client/adapters/EditorSource.java
/trunk/user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java
/trunk/user/src/com/google/gwt/editor/rebind/model/EditorModel.java
/trunk/user/src/com/google/gwt/requestfactory/client/LoginWidget.java
/trunk/user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonListRequest.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonObjectRequest.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonProxyCollectionRequest.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonProxyListRequest.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonProxySetRequest.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonValueListRequest.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/FindRequest.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/FindRequestObjectImpl.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/JsoCollection.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/ProxyImpl.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/ProxyJsoImpl.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryEditorDelegate.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryJsonImpl.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/ValueStoreJsonImpl.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/json/ClientJsonUtil.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/json/JsonVisitor.java
/trunk/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
/trunk/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
/trunk/user/src/com/google/gwt/requestfactory/server/SampleDataPopulator.java
/trunk/user/src/com/google/gwt/requestfactory/shared/Violation.java
/trunk/user/src/com/google/gwt/user/client/rpc/impl/RpcStatsContext.java
/trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
/trunk/user/src/com/google/gwt/validation/client/impl/AbstractGwtSpecificValidator.java
/trunk/user/test/com/google/gwt/app/place/impl/PlaceHistoryMapperGeneratorTest.java
/trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java
/trunk/user/test/com/google/gwt/requestfactory/client/impl/EntityProxyIdImplTest.java
=======================================
---
/trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java
Tue Sep 28 08:39:15 2010
+++
/trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/PersonEditorWorkflow.java
Wed Sep 29 11:01:14 2010
@@ -97,11 +97,13 @@
}
@UiHandler("cancel")
+ @SuppressWarnings("unused")
void onCancel(ClickEvent e) {
dialog.hide();
}
@UiHandler("save")
+ @SuppressWarnings("unused")
void onSave(ClickEvent e) {
// MOVE TO ACTIVITY END
final Request<Void> request = editorDriver.<Void> flush();
@@ -124,6 +126,7 @@
}
@UiHandler("favorite")
+ @SuppressWarnings("unused")
void onValueChanged(ValueChangeEvent<Boolean> event) {
manager.setFavorite(person, favorite.getValue());
}
=======================================
---
/trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
Fri Sep 24 12:10:50 2010
+++
/trunk/samples/dynatablerf/src/com/google/gwt/sample/dynatablerf/client/widgets/SummaryWidget.java
Wed Sep 29 11:01:14 2010
@@ -163,6 +163,7 @@
}
@UiHandler("create")
+ @SuppressWarnings("unused")
void onCreate(ClickEvent event) {
AddressProxy address = requestFactory.create(AddressProxy.class);
PersonProxy person = requestFactory.create(PersonProxy.class);
@@ -181,8 +182,8 @@
if (displayOffset != -1) {
// Record is onscreen and may differ from our data
requestFactory.find(personId).fire(new Receiver<PersonProxy>() {
- public void onSuccess(PersonProxy response) {
- PersonProxy person = (PersonProxy) response;
+ @Override
+ public void onSuccess(PersonProxy person) {
// Re-check offset in case of changes while waiting for data
int offset = offsetOf(person.stableId());
if (offset != -1) {
=======================================
--- /trunk/user/src/com/google/gwt/app/place/AbstractProxyEditActivity.java
Tue Sep 28 08:39:15 2010
+++ /trunk/user/src/com/google/gwt/app/place/AbstractProxyEditActivity.java
Wed Sep 29 11:01:14 2010
@@ -177,6 +177,7 @@
} else {
Request<P> findRequest = requests.find(getEntityProxyId());
findRequest.with(editorDriver.getPaths()).fire(new Receiver<P>() {
+ @Override
public void onSuccess(P proxy) {
if (display != null) {
doStart(proxy);
=======================================
--- /trunk/user/src/com/google/gwt/app/place/ProxyPlaceToListPlace.java Thu
Sep 23 22:21:55 2010
+++ /trunk/user/src/com/google/gwt/app/place/ProxyPlaceToListPlace.java Wed
Sep 29 11:01:14 2010
@@ -15,7 +15,6 @@
*/
package com.google.gwt.app.place;
-
/**
* Converts a {...@link #ProxyPlace} to a {...@link ProxyListPlace}.
*/
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/adapters/EditorSource.java
Thu Sep 9 11:46:06 2010
+++ /trunk/user/src/com/google/gwt/editor/client/adapters/EditorSource.java
Wed Sep 29 11:01:14 2010
@@ -53,12 +53,17 @@
/**
* Called when an Editor no longer requires a sub-Editor. The default
* implementation is a no-op.
+ *
+ * @param subEditor
*/
public void dispose(E subEditor) {
}
/**
* Re-order a sub-Editor. The default implementation is a no-op.
+ *
+ * @param editor
+ * @param index
*/
public void setIndex(E editor, int index) {
}
=======================================
---
/trunk/user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java
Wed Sep 15 06:48:28 2010
+++
/trunk/user/src/com/google/gwt/editor/rebind/AbstractEditorDriverGenerator.java
Wed Sep 29 11:01:14 2010
@@ -325,6 +325,14 @@
protected abstract String mutableObjectExpression(EditorData data,
String sourceObjectExpression);
+ /**
+ * @param logger
+ * @param context
+ * @param model
+ * @param sw
+ *
+ * @throws UnableToCompleteException
+ */
protected void writeAdditionalContent(TreeLogger logger,
GeneratorContext context, EditorModel model, SourceWriter sw)
throws UnableToCompleteException {
=======================================
--- /trunk/user/src/com/google/gwt/editor/rebind/model/EditorModel.java Wed
Sep 15 02:26:39 2010
+++ /trunk/user/src/com/google/gwt/editor/rebind/model/EditorModel.java Wed
Sep 29 11:01:14 2010
@@ -450,7 +450,7 @@
* <code>{ ".getFoo().getBar()", "getBaz", "setBaz" }</code>.
*/
private void findBeanPropertyMethods(String path, JClassType
propertyType,
- EditorData.Builder builder) throws UnableToCompleteException {
+ EditorData.Builder builder) {
StringBuilder interstitialGetters = new StringBuilder();
StringBuilder interstitialGuard = new StringBuilder("true");
String[] parts = path.split(Pattern.quote("."));
=======================================
--- /trunk/user/src/com/google/gwt/requestfactory/client/LoginWidget.java
Thu Sep 2 20:54:55 2010
+++ /trunk/user/src/com/google/gwt/requestfactory/client/LoginWidget.java
Wed Sep 29 11:01:14 2010
@@ -47,10 +47,10 @@
}
@UiHandler("logoutLink")
+ @SuppressWarnings("unused")
void handleClick(ClickEvent e) {
if (logoutUrl != "") {
Location.replace(logoutUrl);
}
}
-
-}
+}
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java
Thu Sep 23 22:21:55 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/RequestFactoryEditorDriver.java
Wed Sep 29 11:01:14 2010
@@ -64,8 +64,8 @@
* proxy (see {...@link Request#edit()}. Note that this driver will not
fire the
* request.
*
- * @param the proxy to be edited
- * @param the request that will accumulate edits and is returned form
{...@link #flush}
+ * @param proxy the proxy to be edited
+ * @param request the request that will accumulate edits and is returned
form {...@link #flush}
*/
void edit(P proxy, Request<?> request);
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonListRequest.java
Tue Sep 28 08:39:15 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonListRequest.java
Wed Sep 29 11:01:14 2010
@@ -18,7 +18,6 @@
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.requestfactory.shared.EntityProxy;
-import com.google.gwt.requestfactory.shared.Request;
import java.util.ArrayList;
import java.util.List;
@@ -38,7 +37,7 @@
*/
public abstract class //
AbstractJsonListRequest<T extends EntityProxy, R extends
AbstractJsonListRequest<T, R>> //
- extends AbstractRequest<List<T>, R> implements Request<List<T>> {
+ extends AbstractRequest<List<T>, R> {
protected final ProxySchema<?> schema;
public AbstractJsonListRequest(ProxySchema<? extends T> schema,
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonObjectRequest.java
Tue Sep 28 08:39:15 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonObjectRequest.java
Wed Sep 29 11:01:14 2010
@@ -17,7 +17,6 @@
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.requestfactory.shared.EntityProxy;
-import com.google.gwt.requestfactory.shared.Request;
/**
* <p>
@@ -34,11 +33,11 @@
*/
public abstract class //
AbstractJsonObjectRequest<T extends EntityProxy, R extends
AbstractJsonObjectRequest<T, R>> //
- extends AbstractRequest<T, R> implements Request<T> {
+ extends AbstractRequest<T, R> {
protected final ProxySchema<?> schema;
- public AbstractJsonObjectRequest(ProxySchema<? extends T> schema,
+ public AbstractJsonObjectRequest(ProxySchema<?> schema,
RequestFactoryJsonImpl requestService) {
super(requestService);
this.schema = schema;
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonProxyCollectionRequest.java
Wed Sep 22 04:32:28 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonProxyCollectionRequest.java
Wed Sep 29 11:01:14 2010
@@ -43,12 +43,13 @@
extends AbstractRequest<C, R> {
protected final ProxySchema<?> schema;
- public AbstractJsonProxyCollectionRequest(ProxySchema<? extends T>
schema,
+ public AbstractJsonProxyCollectionRequest(ProxySchema<?> schema,
RequestFactoryJsonImpl requestService) {
super(requestService);
this.schema = schema;
}
+ @Override
public void handleResult(Object jsoResult) {
@SuppressWarnings("unchecked")
JsArray<JavaScriptObject> rawJsos = (JsArray<JavaScriptObject>)
jsoResult;
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonProxyListRequest.java
Wed Sep 29 08:04:55 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonProxyListRequest.java
Wed Sep 29 11:01:14 2010
@@ -16,7 +16,6 @@
package com.google.gwt.requestfactory.client.impl;
import com.google.gwt.requestfactory.shared.EntityProxy;
-import com.google.gwt.requestfactory.shared.Request;
import java.util.ArrayList;
import java.util.List;
@@ -38,16 +37,16 @@
public abstract class //
AbstractJsonProxyListRequest<T extends EntityProxy,
R extends AbstractJsonProxyListRequest<T, R>>
- extends AbstractJsonProxyCollectionRequest<List<T>, T, R>
- implements Request<List<T>> {
+ extends AbstractJsonProxyCollectionRequest<List<T>, T, R> {
protected final ProxySchema<?> schema;
- public AbstractJsonProxyListRequest(ProxySchema<? extends T> schema,
+ public AbstractJsonProxyListRequest(ProxySchema<?> schema,
RequestFactoryJsonImpl requestService) {
super(schema, requestService);
this.schema = schema;
}
+ @Override
protected List<T> createCollection() {
return new ArrayList<T>();
}
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonProxySetRequest.java
Tue Sep 28 08:39:15 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonProxySetRequest.java
Wed Sep 29 11:01:14 2010
@@ -16,7 +16,6 @@
package com.google.gwt.requestfactory.client.impl;
import com.google.gwt.requestfactory.shared.EntityProxy;
-import com.google.gwt.requestfactory.shared.Request;
import java.util.HashSet;
import java.util.Set;
@@ -38,16 +37,16 @@
public abstract class //
AbstractJsonProxySetRequest<T extends EntityProxy,
R extends AbstractJsonProxySetRequest<T, R>>
- extends AbstractJsonProxyCollectionRequest<Set<T>, T, R>
- implements Request<Set<T>> {
+ extends AbstractJsonProxyCollectionRequest<Set<T>, T, R> {
protected final ProxySchema<?> schema;
- public AbstractJsonProxySetRequest(ProxySchema<? extends T> schema,
+ public AbstractJsonProxySetRequest(ProxySchema<?> schema,
RequestFactoryJsonImpl requestService) {
super(schema, requestService);
this.schema = schema;
}
+ @Override
protected Set<T> createCollection() {
return new HashSet<T>();
}
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonValueListRequest.java
Wed Sep 22 07:25:43 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/AbstractJsonValueListRequest.java
Wed Sep 29 11:01:14 2010
@@ -18,7 +18,6 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
-import com.google.gwt.requestfactory.shared.Request;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -38,11 +37,10 @@
*/
public abstract class //
AbstractJsonValueListRequest<T> //
- extends AbstractRequest<Collection<T>, AbstractJsonValueListRequest<T>>
- implements Request<Collection<T>> {
+ extends AbstractRequest<Collection<T>,
AbstractJsonValueListRequest<T>> {
static Object decodeValueType(Class<?> valueType, String value,
- Enum[] enumValues) {
+ Enum<?>[] enumValues) {
try {
if (Boolean.class == valueType) {
return Boolean.valueOf(value);
@@ -109,10 +107,10 @@
private Class<?> leafType;
- private Enum[] enumValues;
+ private Enum<?>[] enumValues;
public AbstractJsonValueListRequest(RequestFactoryJsonImpl
requestService,
- boolean isSet, Class<?> leafType, Enum[] enumValues) {
+ boolean isSet, Class<?> leafType, Enum<?>[] enumValues) {
super(requestService);
this.isSet = isSet;
this.leafType = leafType;
@@ -133,7 +131,7 @@
}
@Override
- protected AbstractJsonValueListRequest getThis() {
+ protected AbstractJsonValueListRequest<T> getThis() {
return this;
}
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/FindRequest.java
Tue Sep 28 08:39:15 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/FindRequest.java
Wed Sep 29 11:01:14 2010
@@ -27,5 +27,5 @@
*/
@Service(FindService.class)
public interface FindRequest {
- Request<EntityProxy> find(EntityProxyId proxyId);
-}
+ <P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId);
+}
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/FindRequestObjectImpl.java
Wed Sep 22 07:25:43 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/FindRequestObjectImpl.java
Wed Sep 29 11:01:14 2010
@@ -21,22 +21,24 @@
/**
* Abstract implementation of {...@link AbstractJsonObjectRequest} for
special find
* methods that return single instances of {...@link EntityProxy}.
+ *
+ * @param <P>
*/
-public abstract class FindRequestObjectImpl extends
- AbstractJsonObjectRequest<EntityProxy, FindRequestObjectImpl> {
-
- public FindRequestObjectImpl(RequestFactoryJsonImpl factory,
EntityProxyId proxyId) {
- super(((EntityProxyIdImpl) proxyId).schema, factory);
+public abstract class FindRequestObjectImpl<P extends EntityProxy> extends
+ AbstractJsonObjectRequest<EntityProxy, FindRequestObjectImpl<P>> {
+
+ public FindRequestObjectImpl(RequestFactoryJsonImpl factory,
EntityProxyId<P> proxyId) {
+ super(((EntityProxyIdImpl<P>) proxyId).schema, factory);
}
// This declaration works around a javac generics bug
@Override
- public FindRequestObjectImpl with(String... propertyRef) {
+ public FindRequestObjectImpl<P> with(String... propertyRef) {
return super.with(propertyRef);
}
@Override
- protected FindRequestObjectImpl getThis() {
+ protected FindRequestObjectImpl<P> getThis() {
return this;
}
}
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/JsoCollection.java
Fri Sep 24 12:10:50 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/JsoCollection.java
Wed Sep 29 11:01:14 2010
@@ -26,7 +26,7 @@
/**
* Inject dependencies needed by jso collections to commit mutations to
* {...@link DeltaValueStoreJsonImpl}.
- *
+ *
* @param property the Property corresponding to the contained type
* @param proxy the Proxy on which this collection resides
*/
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/ProxyImpl.java
Fri Sep 24 12:10:50 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/ProxyImpl.java
Wed Sep 29 11:01:14 2010
@@ -21,6 +21,8 @@
import com.google.gwt.requestfactory.shared.impl.HasWireFormatId;
import com.google.gwt.requestfactory.shared.impl.Property;
+import java.util.Collection;
+
/**
* <p>
* <span style="color:red">Experimental API: This class is still under
rapid
@@ -100,7 +102,7 @@
* @return the value
*/
@SuppressWarnings("unchecked")
- public <V> V get(Property<V> property) {
+ public <L extends Collection<V>, V> V get(Property<V> property) {
// Read through to the DeltaValueStore to see if the entity has been
mutated
V toReturn = null;
if (deltaValueStore != null
@@ -112,7 +114,7 @@
toReturn = (V) jso.getCollection((CollectionProperty) property);
} else {
// Return a scalar property from the backing object
- toReturn = jso.<V> get(property);
+ toReturn = jso.<L, V> get(property);
}
}
// Ensure mutability
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/ProxyJsoImpl.java
Fri Sep 24 19:41:56 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/ProxyJsoImpl.java
Wed Sep 29 11:01:14 2010
@@ -97,8 +97,8 @@
return String.valueOf(((Date) o).getTime());
} else if (o instanceof ProxyImpl) {
return ((ProxyImpl) o).wireFormatId();
- } else if (o instanceof Enum) {
- return (double) ((Enum) o).ordinal();
+ } else if (o instanceof Enum<?>) {
+ return (double) ((Enum<?>) o).ordinal();
}
return o;
}
@@ -151,13 +151,14 @@
return
[email protected]::ENCODED_ID_PROPERTY];
}-*/;
- public final <V> V get(Property<V> property) {
+ @SuppressWarnings("unchecked")
+ public final <L extends Collection<V>, V> V get(Property<V> property) {
String name = property.getName();
Class<V> type = property.getType();
- if (property instanceof CollectionProperty) {
+ if (property instanceof CollectionProperty<?,?>) {
assert type == List.class || type == Set.class;
JsoCollection col = (JsoCollection) getCollection(
- (CollectionProperty) property);
+ (CollectionProperty<L, V>) property);
col.setDependencies(property, null);
return (V) col;
}
@@ -367,9 +368,9 @@
if (value instanceof JsoCollection) {
setJso(property.getName(), ((JsoCollection) value).asJso());
return;
- } else if (value instanceof Collection) {
+ } else if (value instanceof Collection<?>) {
JavaScriptObject jso = JavaScriptObject.createArray();
- for (Object o : ((Collection) value)) {
+ for (Object o : ((Collection<?>) value)) {
o = encodeToJsType(o);
if (o instanceof String) {
((JsArrayString) jso).push((String) o);
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryEditorDelegate.java
Fri Sep 24 12:10:50 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryEditorDelegate.java
Wed Sep 29 11:01:14 2010
@@ -54,7 +54,7 @@
}
}
- @SuppressWarnings( {"rawtypes", "unchecked"})
+ @SuppressWarnings({"rawtypes", "unchecked"})
private void doFind(List<String> paths, EntityProxyId id) {
factory.find(id).with(paths.toArray(new String[paths.size()])).fire(
new SubscriptionReceiver());
@@ -95,7 +95,7 @@
}
// Can't just use getObject().getClass() because it's not the proxy
type
- EntityProxyId stableId = ((EntityProxy) getObject()).stableId();
+ EntityProxyId<?> stableId = ((EntityProxy) getObject()).stableId();
@SuppressWarnings("unchecked")
Class<EntityProxy> clazz = (Class<EntityProxy>)
stableId.getProxyClass();
HandlerRegistration toReturn = EntityProxyChange.<EntityProxy>
registerForProxyType(
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryJsonImpl.java
Tue Sep 28 08:39:15 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/RequestFactoryJsonImpl.java
Wed Sep 29 11:01:14 2010
@@ -104,7 +104,7 @@
return createFuture(schema);
}
- public Request<EntityProxy> find(EntityProxyId proxyId) {
+ public <P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId)
{
return findRequest().find(proxyId);
}
@@ -144,8 +144,8 @@
public abstract ProxySchema<?> getSchema(String token);
- public String getWireFormat(EntityProxyId proxyId) {
- EntityProxyIdImpl proxyIdImpl = (EntityProxyIdImpl) proxyId;
+ public String getWireFormat(EntityProxyId<?> proxyId) {
+ EntityProxyIdImpl<?> proxyIdImpl = (EntityProxyIdImpl<?>) proxyId;
String id = (String) proxyIdImpl.encodedId;
if (proxyIdImpl.isFuture) {
// search for the datastore id for this futureId.
@@ -195,6 +195,9 @@
/**
* This implementation cannot be changed without breaking clients.
+ *
+ * @param proxyId
+ * @param recordToTypeMap
*/
protected String getHistoryToken(EntityProxyId<?> proxyId,
ProxyToTypeMap recordToTypeMap) {
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/ValueStoreJsonImpl.java
Mon Sep 27 08:21:01 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/ValueStoreJsonImpl.java
Wed Sep 29 11:01:14 2010
@@ -95,7 +95,7 @@
factory.postChangeEvent(newJsoRecord, WriteOperation.UPDATE);
}
return null;
- }
+ }
if (oldRecord.hasChanged(newJsoRecord)) {
records.put(recordKey, newJsoRecord);
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/json/ClientJsonUtil.java
Sun Sep 26 19:46:41 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/json/ClientJsonUtil.java
Wed Sep 29 11:01:14 2010
@@ -72,7 +72,7 @@
}
@Override
- public void endVisit(JsArray array, JsonContext ctx) {
+ public void endVisit(JsArray<?> array, JsonContext ctx) {
if (pretty) {
indentLevel = indentLevel.substring(0,
indentLevel.length() - indent.length());
@@ -109,7 +109,7 @@
}
@Override
- public boolean visit(JsArray array, JsonContext ctx) {
+ public boolean visit(JsArray<?> array, JsonContext ctx) {
checkCycle(array);
sb.append("[");
if (pretty) {
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/json/JsonVisitor.java
Fri Sep 24 19:41:56 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/json/JsonVisitor.java
Wed Sep 29 11:01:14 2010
@@ -44,12 +44,16 @@
/**
* Called after every element of array has been visited.
+ *
+ * @param array
+ * @param ctx
*/
- public void endVisit(JsArray array, JsonContext ctx) {
+ public void endVisit(JsArray<?> array, JsonContext ctx) {
}
/**
* Called after every field of an object has been visited.
+ *
* @param object
* @param ctx
*/
@@ -58,18 +62,27 @@
/**
* Called for JS numbers present in a JSON object.
+ *
+ * @param number
+ * @param ctx
*/
public void visit(double number, JsonContext ctx) {
}
/**
* Called for JS strings present in a JSON object.
+ *
+ * @param string
+ * @param ctx
*/
public void visit(String string, JsonContext ctx) {
}
/**
* Called for JS boolean present in a JSON object.
+ *
+ * @param bool
+ * @param ctx
*/
public void visit(boolean bool, JsonContext ctx) {
}
@@ -81,7 +94,7 @@
* @param ctx a context to replace or delete the array
* @return true if the array elements should be visited
*/
- public boolean visit(JsArray array, JsonContext ctx) {
+ public boolean visit(JsArray<?> array, JsonContext ctx) {
return true;
}
@@ -118,6 +131,8 @@
/**
* Called for nulls present in a JSON object.
+ *
+ * @param ctx
*/
public void visitNull(JsonContext ctx) {
}
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
Wed Sep 29 08:04:55 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
Wed Sep 29 11:01:14 2010
@@ -25,6 +25,7 @@
import com.google.gwt.core.ext.typeinfo.JParameterizedType;
import com.google.gwt.core.ext.typeinfo.JPrimitiveType;
import com.google.gwt.core.ext.typeinfo.JType;
+import com.google.gwt.core.ext.typeinfo.JTypeParameter;
import com.google.gwt.core.ext.typeinfo.NotFoundException;
import com.google.gwt.core.ext.typeinfo.TypeOracle;
import com.google.gwt.requestfactory.client.impl.AbstractBigDecimalRequest;
@@ -240,6 +241,11 @@
if (generatedProxyTypes.contains(publicProxyType)) {
return;
}
+ // Hack
+ if ("P".equals(publicProxyType.getName())) {
+ return;
+ }
+
String packageName = publicProxyType.getPackage().getName();
String proxyImplTypeName = publicProxyType.getName() + "Impl";
@@ -366,7 +372,7 @@
* Because a Proxy A may relate to B which relates to C, we need to
* ensure transitively.
*/
- if (isProxyType(typeOracle, returnType)) {
+ if (isProxyType(returnType)) {
transitiveDeps.add(returnType);
}
}
@@ -564,6 +570,7 @@
sw.indent();
for (JClassType publicProxyType : generatedProxyTypes) {
String qualifiedSourceName =
publicProxyType.getQualifiedSourceName();
+ qualifiedSourceName = removeTypeParameter(qualifiedSourceName);
sw.println("if (proxyClass == " + qualifiedSourceName + ".class) {");
sw.indent();
sw.println("return (ProxySchema<R>) " + qualifiedSourceName
@@ -582,6 +589,7 @@
sw.println("String[] bits = token.split(\"@\");");
for (JClassType publicProxyType : generatedProxyTypes) {
String qualifiedSourceName =
publicProxyType.getQualifiedSourceName();
+ qualifiedSourceName = removeTypeParameter(qualifiedSourceName);
sw.println("if (bits[0].equals(\"" + qualifiedSourceName + "\")) {");
sw.indent();
sw.println("return " + qualifiedSourceName + "Impl.SCHEMA;");
@@ -596,6 +604,7 @@
sw.indent();
for (JClassType publicProxyType : generatedProxyTypes) {
String qualifiedSourceName =
publicProxyType.getQualifiedSourceName();
+ qualifiedSourceName = removeTypeParameter(qualifiedSourceName);
sw.println("if (proxyClass == " + qualifiedSourceName + ".class) {");
sw.indent();
sw.println("return \"" + qualifiedSourceName + "\";");
@@ -697,7 +706,7 @@
} else {
requestClassName = asInnerImplClass("ObjectRequestImpl",
returnType);
}
- } else if (isValueListRequest(typeOracle, requestType)) {
+ } else if (isValueListRequest(requestType)) {
requestClassName = AbstractJsonValueListRequest.class.getName();
// generate argument list for AbstractJsonValueListRequest
constructor
JClassType colType =
requestType.isParameterized().getTypeArgs()[0];
@@ -759,7 +768,7 @@
sw.indent();
sw.println("return new %s(\"%s\", %s, %s, getPropertyRefs());",
RequestData.class.getSimpleName(), operationName,
- getParametersAsString(method, typeOracle),
+ getParametersAsString(method),
getEntityParameters(method));
sw.outdent();
sw.println("}");
@@ -784,7 +793,7 @@
JClassType retType = requestType.isParameterized().getTypeArgs()[0];
if (retType.isParameterized() != null) {
JClassType leafType = retType.isParameterized().getTypeArgs()[0];
- if (isProxyType(typeOracle, leafType)) {
+ if (isProxyType(leafType)) {
if (retType.isAssignableTo(listType)) {
return List.class;
} else if (retType.isAssignableTo(setType)) {
@@ -814,6 +823,20 @@
*/
private String getMethodDeclaration(JMethod method) {
StringBuilder sb = new StringBuilder("public ");
+ JTypeParameter[] typeParams = method.getTypeParameters();
+ if (typeParams.length > 0) {
+ sb.append("<");
+ boolean needComma = false;
+ for (JTypeParameter typeParam : typeParams) {
+ if (needComma) {
+ sb.append(", ");
+ } else {
+ needComma = true;
+ }
+ sb.append(typeParam.getQualifiedSourceName());
+ }
+ sb.append("> ");
+ }
sb.append(method.getReturnType().getParameterizedQualifiedSourceName());
sb.append(" ");
sb.append(method.getName());
@@ -839,7 +862,7 @@
* Returns the string representation of the parameters to be passed to
the
* server side method.
*/
- private String getParametersAsString(JMethod method, TypeOracle
typeOracle) {
+ private String getParametersAsString(JMethod method) {
StringBuilder sb = new StringBuilder();
for (JParameter parameter : method.getParameters()) {
if (sb.length() > 0) {
@@ -926,7 +949,7 @@
return false;
}
- private boolean isProxyType(TypeOracle typeOracle, JClassType
requestType) {
+ private boolean isProxyType(JClassType requestType) {
return requestType.isAssignableTo(entityProxyType);
}
@@ -934,12 +957,12 @@
JClassType requestType) {
JClassType retType = requestType.isParameterized().getTypeArgs()[0];
if (retType.isAssignableTo(listType) ||
retType.isAssignableTo(setType)) {
- if (retType.isParameterized() != null) {
+ if (retType.isParameterized() != null) {
JClassType leafType = retType.isParameterized().getTypeArgs()[0];
- return isProxyType(typeOracle, leafType);
- }
- }
- return false;
+ return isProxyType(leafType);
+ }
+ }
+ return false;
}
private boolean isShortRequest(TypeOracle typeOracle, JClassType
requestType) {
@@ -950,13 +973,12 @@
return
requestType.isParameterized().getTypeArgs()[0].isAssignableTo(typeOracle.findType(String.class.getName()));
}
- private boolean isValueListRequest(TypeOracle typeOracle,
- JClassType requestType) {
+ private boolean isValueListRequest(JClassType requestType) {
JClassType retType = requestType.isParameterized().getTypeArgs()[0];
if (retType.isAssignableTo(listType) ||
retType.isAssignableTo(setType)) {
if (retType.isParameterized() != null) {
JClassType leafType = retType.isParameterized().getTypeArgs()[0];
- return !isProxyType(typeOracle, leafType);
+ return !isProxyType(leafType);
}
}
return false;
@@ -1129,4 +1151,12 @@
sw.println("}");
return propertyType;
}
-}
+
+ private String removeTypeParameter(String qualifiedSourceName) {
+ int index = qualifiedSourceName.indexOf(" extends ");
+ if (index != -1) {
+ qualifiedSourceName = qualifiedSourceName.substring(index + 9);
+ }
+ return qualifiedSourceName;
+ }
+}
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
Tue Sep 28 08:39:15 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
Wed Sep 29 11:01:14 2010
@@ -249,8 +249,10 @@
}
if (genericParameterType instanceof ParameterizedType) {
ParameterizedType pType = (ParameterizedType) genericParameterType;
- if (pType.getRawType() instanceof Class) {
+ if (pType.getRawType() instanceof Class<?>) {
Class<?> rType = (Class<?>) pType.getRawType();
+ // Ensure parameterType is initialized
+ parameterType = rType;
if (Collection.class.isAssignableFrom(rType)) {
Collection<Object> collection = createCollection(rType);
if (collection != null) {
@@ -396,10 +398,10 @@
InvocationTargetException, JSONException {
Object returnValue = getRawPropertyValueFromDatastore(entityElement,
- propertyName, propertyContext);
+ propertyName);
Class<?> proxyPropertyType = property.getType();
- Class<?> elementType = property instanceof CollectionProperty
- ? ((CollectionProperty) property).getLeafType() :
proxyPropertyType;
+ Class<?> elementType = property instanceof CollectionProperty<?,?>
+ ? ((CollectionProperty<?,?>) property).getLeafType() :
proxyPropertyType;
String encodedEntityId = isEntityReference(returnValue,
proxyPropertyType);
if (returnValue == null) {
@@ -408,13 +410,13 @@
String keyRef = encodeRelated(proxyPropertyType, propertyName,
propertyContext, returnValue);
return keyRef;
- } else if (property instanceof CollectionProperty) {
- Class<?> colType = ((CollectionProperty) property).getType();
+ } else if (property instanceof CollectionProperty<?,?>) {
+ Class<?> colType = ((CollectionProperty<?,?>) property).getType();
Collection<Object> col = createCollection(colType);
if (col != null) {
- for (Object o : ((Collection) returnValue)) {
+ for (Object o : ((Collection<?>) returnValue)) {
String encodedValId = isEntityReference(o,
- ((CollectionProperty) property).getLeafType());
+ ((CollectionProperty<?,?>) property).getLeafType());
if (encodedValId != null) {
col.add(encodeRelated(elementType, propertyName,
propertyContext, o));
} else {
@@ -488,16 +490,16 @@
Object propertyValue = null;
if (recordObject.isNull(key)) {
// null
- } else if (dtoProperty instanceof CollectionProperty) {
+ } else if (dtoProperty instanceof CollectionProperty<?,?>) {
Class<?> cType = dtoProperty.getType();
- Class<?> leafType = ((CollectionProperty)
dtoProperty).getLeafType();
+ Class<?> leafType = ((CollectionProperty<?,?>)
dtoProperty).getLeafType();
Collection<Object> col = createCollection(cType);
if (col != null) {
JSONArray array = recordObject.getJSONArray(key);
for (int i = 0; i < array.length(); i++) {
if (EntityProxy.class.isAssignableFrom(leafType)) {
propertyValue = getPropertyValueFromRequestCached(array,
- propertiesInProxy, i, dtoProperty);
+ i, dtoProperty);
} else {
propertyValue = decodeParameterValue(leafType,
array.getString(i));
@@ -597,9 +599,9 @@
if (entityElement instanceof Number || entityElement instanceof
String
|| entityElement instanceof Character
|| entityElement instanceof Date || entityElement instanceof
Boolean
- || entityElement instanceof Enum) {
+ || entityElement instanceof Enum<?>) {
jsonArray.put(encodePropertyValue(entityElement));
- } else if (entityElement instanceof List || entityElement instanceof
Set) {
+ } else if (entityElement instanceof List<?> || entityElement
instanceof Set<?>) {
// TODO: unwrap nested type params?
jsonArray.put(getJsonArray((Collection<?>) entityElement,
entityKeyClass));
@@ -1172,7 +1174,7 @@
return null;
}
- private String encodeId(Object id) throws JSONException {
+ private String encodeId(Object id) {
if (id instanceof String) {
return base64Encode((String) id);
}
@@ -1214,7 +1216,7 @@
+ "");
// violations have already been taken care of.
Object newId = getRawPropertyValueFromDatastore(entityInstance,
- ENTITY_ID_PROPERTY, propertyRefs);
+ ENTITY_ID_PROPERTY);
if (newId == null) {
log.warning("Record with futureId " + originalEntityKey.encodedId
+ " not persisted");
@@ -1277,12 +1279,11 @@
}
private Object getPropertyValueFromRequestCached(JSONArray recordArray,
- Map<String, Property<?>> propertiesInProxy, int index,
- Property<?> dtoProperty) throws JSONException,
IllegalAccessException,
+ int index, Property<?> dtoProperty) throws JSONException,
IllegalAccessException,
InvocationTargetException, NoSuchMethodException,
InstantiationException {
Object propertyValue;
- Class<?> leafType = dtoProperty instanceof CollectionProperty
- ? ((CollectionProperty) dtoProperty).getLeafType()
+ Class<?> leafType = dtoProperty instanceof CollectionProperty<?,?>
+ ? ((CollectionProperty<?,?>) dtoProperty).getLeafType()
: dtoProperty.getType();
// if the property type is a Proxy, we expect an encoded Key string
@@ -1304,7 +1305,7 @@
}
private Object getRawPropertyValueFromDatastore(Object entityElement,
- String propertyName, RequestProperty propertyContext)
+ String propertyName)
throws SecurityException, NoSuchMethodException,
IllegalAccessException,
InvocationTargetException {
String methodName = getMethodNameFromPropertyName(propertyName, "get");
@@ -1406,7 +1407,7 @@
private String isEntityReference(Object entity, Class<?>
proxyPropertyType)
throws SecurityException, NoSuchMethodException,
IllegalArgumentException, IllegalAccessException,
- InvocationTargetException, JSONException {
+ InvocationTargetException {
if (entity != null &&
EntityProxy.class.isAssignableFrom(proxyPropertyType)) {
Method idMethod = getIdMethodForEntity(entity.getClass());
return encodeId(idMethod.invoke(entity));
@@ -1428,8 +1429,8 @@
return false;
}
Class<?> leafType = p.getType();
- if (p instanceof CollectionProperty) {
- leafType = ((CollectionProperty) p).getLeafType();
+ if (p instanceof CollectionProperty<?,?>) {
+ leafType = ((CollectionProperty<?,?>) p).getLeafType();
}
if (EntityProxy.class.isAssignableFrom(leafType)) {
return propertyContext.hasProperty(p.getName());
@@ -1467,9 +1468,9 @@
+ "@NO@"
+ operationRegistry.getSecurityProvider().encodeClassType(
p.getType());
- } else if (p instanceof CollectionProperty) {
+ } else if (p instanceof CollectionProperty<?,?>) {
JSONArray array = new JSONArray();
- for (Object val : ((Collection) returnValue)) {
+ for (Object val : ((Collection<?>) returnValue)) {
String encodedIdVal = isEntityReference(val, p.getType());
if (encodedIdVal != null) {
propertyValue = encodedIdVal
@@ -1516,7 +1517,7 @@
continue;
}
Class<?> fieldType = property.getType();
- if (property instanceof CollectionProperty) {
+ if (property instanceof CollectionProperty<?,?>) {
toReturn.put(field.getName(), fieldType);
} else if (fieldType != null) {
if (EntityProxy.class.isAssignableFrom(fieldType)) {
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/server/SampleDataPopulator.java
Wed Sep 22 07:25:43 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/server/SampleDataPopulator.java
Wed Sep 29 11:01:14 2010
@@ -19,7 +19,6 @@
import com.google.gwt.requestfactory.shared.impl.RequestData;
import org.apache.http.HttpEntity;
-import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
@@ -80,7 +79,7 @@
this.filePathName = filePathName;
}
- public void populate() throws JSONException, HttpException, IOException {
+ public void populate() throws JSONException, IOException {
JSONObject jsonObject =
readAsJsonObject(readFileAsString(filePathName));
postJsonFile(jsonObject);
}
=======================================
--- /trunk/user/src/com/google/gwt/requestfactory/shared/Violation.java Tue
Sep 14 03:12:23 2010
+++ /trunk/user/src/com/google/gwt/requestfactory/shared/Violation.java Wed
Sep 29 11:01:14 2010
@@ -28,5 +28,5 @@
String getPath();
- EntityProxyId getProxyId();
-}
+ EntityProxyId<?> getProxyId();
+}
=======================================
---
/trunk/user/src/com/google/gwt/user/client/rpc/impl/RpcStatsContext.java
Mon Sep 20 10:54:28 2010
+++
/trunk/user/src/com/google/gwt/user/client/rpc/impl/RpcStatsContext.java
Wed Sep 29 11:01:14 2010
@@ -81,6 +81,11 @@
};
}-*/;
+ /**
+ * @param method
+ * @param result
+ * @param eventType
+ */
public JavaScriptObject timeStat(String method, Object result, String
eventType) {
return timeStat(method, eventType);
}
=======================================
--- /trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java Mon
Sep 20 15:25:50 2010
+++ /trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java Wed
Sep 29 11:01:14 2010
@@ -578,6 +578,11 @@
}
}
+ /**
+ * @param syncMethod
+ * @param asyncMethod
+ * @param statsContextName
+ */
protected void generateRpcStatsContext(SourceWriter w, JMethod
syncMethod,
JMethod asyncMethod, String statsContextName) {
w.println("RpcStatsContext " + statsContextName + " = new
RpcStatsContext();");
=======================================
---
/trunk/user/src/com/google/gwt/validation/client/impl/AbstractGwtSpecificValidator.java
Wed Sep 8 07:45:57 2010
+++
/trunk/user/src/com/google/gwt/validation/client/impl/AbstractGwtSpecificValidator.java
Wed Sep 29 11:01:14 2010
@@ -31,6 +31,18 @@
public abstract class AbstractGwtSpecificValidator<G> implements
GwtSpecificValidator<G> {
+ /**
+ * @param <A>
+ * @param <T>
+ * @param <V>
+ * @param context
+ * @param violations
+ * @param object
+ * @param value
+ * @param validator
+ * @param constraintDescriptor
+ * @param groups
+ */
protected <A extends Annotation, T, V> void validate(
GwtValidationContext<T> context, Set<ConstraintViolation<T>>
violations,
G object, V value, ConstraintValidator<A, V> validator,
=======================================
---
/trunk/user/test/com/google/gwt/app/place/impl/PlaceHistoryMapperGeneratorTest.java
Wed Sep 22 07:25:43 2010
+++
/trunk/user/test/com/google/gwt/app/place/impl/PlaceHistoryMapperGeneratorTest.java
Wed Sep 29 11:01:14 2010
@@ -87,6 +87,7 @@
doTest(subject, factory);
}
+ // CHECKSTYLE_OFF
private void doTest(AbstractPlaceHistoryMapper<?> subject,
TokenizerFactory factory) {
String history1 = subject.getPrefixAndToken(place1).toString();
@@ -128,4 +129,5 @@
assertNull(subject.getPrefixAndToken(place));
assertNull(subject.getTokenizer("snot"));
}
-}
+ // CHECKSTYLE_ON
+}
=======================================
---
/trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java
Mon Sep 27 08:21:01 2010
+++
/trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java
Wed Sep 29 11:01:14 2010
@@ -1110,6 +1110,7 @@
final Request<SimpleFooProxy> fooReq =
req.simpleFooRequest().findSimpleFooById(
999L);
fooReq.fire(new Receiver<SimpleFooProxy>() {
+ @Override
public void onSuccess(SimpleFooProxy response) {
final Request<Integer> sumReq =
req.simpleFooRequest().sum(response,
Arrays.asList(1, 2, 3));
@@ -1216,6 +1217,7 @@
final Request<SimpleFooProxy> fooReq =
req.simpleFooRequest().findSimpleFooById(
999L).with("selfOneToManyField");
fooReq.fire(new Receiver<SimpleFooProxy>() {
+ @Override
public void onSuccess(final SimpleFooProxy fooProxy) {
final Request<String> procReq = req.simpleFooRequest().processList(
fooProxy, fooProxy.getSelfOneToManyField());
=======================================
---
/trunk/user/test/com/google/gwt/requestfactory/client/impl/EntityProxyIdImplTest.java
Tue Sep 21 12:24:16 2010
+++
/trunk/user/test/com/google/gwt/requestfactory/client/impl/EntityProxyIdImplTest.java
Wed Sep 29 11:01:14 2010
@@ -44,42 +44,42 @@
}
public void testEquals() {
- EntityProxyIdImpl newKey1 = new EntityProxyIdImpl("test", new
Schema1(),
+ EntityProxyIdImpl<?> newKey1 = new
EntityProxyIdImpl<EntityProxy>("test", new Schema1(),
RequestFactoryJsonImpl.IS_FUTURE, null);
- EntityProxyIdImpl anotherNewKey1 = new
EntityProxyIdImpl(newKey1.encodedId, newKey1.schema,
+ EntityProxyIdImpl<?> anotherNewKey1 = new
EntityProxyIdImpl<EntityProxy>(newKey1.encodedId, newKey1.schema,
newKey1.isFuture, null);
assertTrue(newKey1.equals(anotherNewKey1));
assertTrue(newKey1.hashCode() == anotherNewKey1.hashCode());
- EntityProxyIdImpl newKey2 = new EntityProxyIdImpl((String)
newKey1.encodedId + 1, newKey1.schema,
+ EntityProxyIdImpl<?> newKey2 = new
EntityProxyIdImpl<EntityProxy>((String) newKey1.encodedId + 1,
newKey1.schema,
newKey1.isFuture, null);
assertFalse(newKey1.equals(newKey2));
assertFalse(newKey1.hashCode() == newKey2.hashCode());
- EntityProxyIdImpl newKey1NoSchema = new
EntityProxyIdImpl(newKey1.encodedId,
+ EntityProxyIdImpl<?> newKey1NoSchema = new
EntityProxyIdImpl<EntityProxy>(newKey1.encodedId,
new Schema2(), newKey1.isFuture, null);
assertFalse(newKey1.equals(newKey1NoSchema));
assertFalse(newKey1.hashCode() == newKey1NoSchema.hashCode());
- EntityProxyIdImpl oldKey1 = new EntityProxyIdImpl(newKey1.encodedId,
newKey1.schema,
+ EntityProxyIdImpl<?> oldKey1 = new
EntityProxyIdImpl<EntityProxy>(newKey1.encodedId, newKey1.schema,
!newKey1.isFuture, null);
assertFalse(newKey1.equals(oldKey1));
assertFalse(newKey1.hashCode() == oldKey1.hashCode());
}
public void testEqualsWithFuture() {
- EntityProxyIdImpl newKey1 = new EntityProxyIdImpl("test", new
Schema1(),
+ EntityProxyIdImpl<?> newKey1 = new
EntityProxyIdImpl<EntityProxy>("test", new Schema1(),
RequestFactoryJsonImpl.IS_FUTURE, null);
- EntityProxyIdImpl persistedNewKey1 = new EntityProxyIdImpl("test2",
+ EntityProxyIdImpl<?> persistedNewKey1 = new
EntityProxyIdImpl<EntityProxy>("test2",
newKey1.schema, RequestFactoryJsonImpl.NOT_FUTURE,
newKey1.encodedId);
assertTrue(persistedNewKey1.equals(persistedNewKey1));
assertTrue(newKey1.equals(persistedNewKey1));
assertTrue(persistedNewKey1.equals(newKey1));
assertTrue(newKey1.hashCode() == persistedNewKey1.hashCode());
- EntityProxyIdImpl anotherPersistedNewKey1 = new
EntityProxyIdImpl("test3",
+ EntityProxyIdImpl<?> anotherPersistedNewKey1 = new
EntityProxyIdImpl<EntityProxy>("test3",
newKey1.schema, RequestFactoryJsonImpl.NOT_FUTURE,
(String) newKey1.encodedId + 1);
assertTrue(anotherPersistedNewKey1.equals(anotherPersistedNewKey1));
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors