Skip to content

Commit cc65dc2

Browse files
ludochgae-java-bot
authored andcommitted
Cleanup and standardization of App Engine Standard Java code.
PiperOrigin-RevId: 876534240 Change-Id: I5f4733910a43e999823255019afbe8b1da3eee11
1 parent 2d9211a commit cc65dc2

4 files changed

Lines changed: 7 additions & 36 deletions

File tree

api_dev/src/main/java/com/google/appengine/tools/info/Jetty121EE11Sdk.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ protected List<File> getJetty121Jars(String subDir) {
221221
|| f.getName().contains("jakarta.interceptor")
222222
|| f.getName().contains("jakarta.servlet-api-6.0.0") // for EE10
223223
|| f.getName().contains("jakarta.transaction")
224-
// TODO Still needed for EE11, not sure why
224+
// TODO: Still needed for EE11, not sure why
225225
// || f.getName().contains("jetty-servlet-api-") // no javax.
226226
|| f.getName().contains("ee8") // we want ee11 only. jakarta apis should be in shared
227227
|| f.getName().contains("ee9") // we want ee11 only. jakarta apis should be in shared

google3/third_party/java_src/appengine_standard/api_compatibility_tests/src/test/java/com/google/appengine/apicompat/usage/BlobstoreApiUsage.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,7 @@ public Set<Class<?>> useApi() {
320320
} catch (IOException e) {
321321
// ok
322322
}
323-
// This is a hack to get around the fact that java 7 classes are not yet available in
324-
// blaze but tests are running under a Java 7 runtime.
325-
// TODO: Reference AutoCloseable directly once java 7 classes are available at compile
326-
// time.
327-
Class<?> autoCloseable = Closeable.class.getInterfaces()[0];
328-
return classes(Object.class, InputStream.class, autoCloseable, Closeable.class);
323+
return classes(Object.class, InputStream.class, AutoCloseable.class, Closeable.class);
329324
} finally {
330325
helper.tearDown();
331326
}

remoteapi/src/test/java/com/google/appengine/tools/remoteapi/RemoteDatastoreTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
/**
4646
* Test for {@link RemoteDatastore}
4747
*
48-
* @author maxr@google.com (Max Ross)
4948
*/
5049
@RunWith(JUnit4.class)
5150
public class RemoteDatastoreTest {
@@ -356,11 +355,7 @@ private static EntityProto createEntityProto(String appId, int index) {
356355

357356
EntityProto.Builder entity = EntityProto.newBuilder().setKey(key);
358357

359-
// TODO: There are utilities for this, but they are all under
360-
// apphosting/datastore/testing which we may not want to depend on from here.
361-
OnestoreEntity.Path group =
362-
OnestoreEntity.Path.newBuilder().addElement(key.getPath().getElement(0)).build();
363-
entity.setEntityGroup(group);
358+
entity.setEntityGroup(OnestoreEntity.Path.newBuilder().addElement(key.getPath().getElement(0)));
364359

365360
addProperty(entity, "someproperty", index);
366361

remoteapi/src/test/java/com/google/appengine/tools/remoteapi/testing/RemoteApiSharedTests.java

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public class RemoteApiSharedTests {
5858
private final String remoteApiPath;
5959
private final int port;
6060
private final boolean testKeysCreatedBeforeRemoteApiInstall;
61-
private final boolean expectRemoteAppIdsOnKeysAfterInstallingRemoteApi;
6261

6362
/**
6463
* Builder for a {@link RemoteApiSharedTests} with some sensible defaults.
@@ -82,14 +81,6 @@ public static class Builder {
8281
*/
8382
private boolean testKeysCreatedBeforeRemoteApiInstall = true;
8483

85-
/**
86-
* Allow these tests to be turned off because they rely on recent changes that haven't been
87-
* rolled out everywhere yet. Targeting 1.8.8.
88-
* See http://b/11254141 and http://b/10788115
89-
* TODO: Remove this.
90-
*/
91-
private boolean expectRemoteAppIdsOnKeysAfterInstallingRemoteApi = true;
92-
9384
@CanIgnoreReturnValue
9485
public Builder setLocalAppId(String localAppId) {
9586
this.localAppId = localAppId;
@@ -135,8 +126,7 @@ public RemoteApiSharedTests build() {
135126
server,
136127
remoteApiPath,
137128
port,
138-
testKeysCreatedBeforeRemoteApiInstall,
139-
expectRemoteAppIdsOnKeysAfterInstallingRemoteApi);
129+
testKeysCreatedBeforeRemoteApiInstall);
140130
}
141131
}
142132

@@ -148,8 +138,7 @@ private RemoteApiSharedTests(
148138
String server,
149139
String remoteApiPath,
150140
int port,
151-
boolean testKeysCreatedBeforeRemoteApiInstall,
152-
boolean expectRemoteAppIdsOnKeysAfterInstallingRemoteApi) {
141+
boolean testKeysCreatedBeforeRemoteApiInstall) {
153142
this.localAppId = localAppId;
154143
this.remoteAppId = remoteAppId;
155144
this.username = username;
@@ -158,8 +147,6 @@ private RemoteApiSharedTests(
158147
this.remoteApiPath = remoteApiPath;
159148
this.port = port;
160149
this.testKeysCreatedBeforeRemoteApiInstall = testKeysCreatedBeforeRemoteApiInstall;
161-
this.expectRemoteAppIdsOnKeysAfterInstallingRemoteApi =
162-
expectRemoteAppIdsOnKeysAfterInstallingRemoteApi;
163150
}
164151

165152
/**
@@ -314,8 +301,6 @@ public void run(
314301
DatastoreService ds, Supplier<Key> keySupplier, Supplier<Entity> entitySupplier) {
315302
// Note that we can't use local keys here. Query will fail if you set an ancestor whose app
316303
// id does not match the "global" AppIdNamespace.
317-
// TODO: Consider making it more lenient, but it's not a big deal. Users can
318-
// just use a Key that was created after installing the Remote API.
319304
Entity entity = new Entity(getFreshKindName());
320305
entity.setProperty("prop1", 99L);
321306
ds.put(entity);
@@ -399,9 +384,7 @@ private RemoteKeySupplier() {
399384
public Key get() {
400385
// This assumes that the remote api has already been installed.
401386
Key key = KeyFactory.createKey(kind, "somename" + nameCounter);
402-
if (expectRemoteAppIdsOnKeysAfterInstallingRemoteApi) {
403-
assertRemoteAppId(key);
404-
}
387+
assertRemoteAppId(key);
405388
nameCounter++;
406389

407390
return key;
@@ -424,9 +407,7 @@ private RemoteEntitySupplier() {
424407
public Entity get() {
425408
// This assumes that the remote api has already been installed.
426409
Entity entity = new Entity(kind);
427-
if (expectRemoteAppIdsOnKeysAfterInstallingRemoteApi) {
428-
assertRemoteAppId(entity.getKey());
429-
}
410+
assertRemoteAppId(entity.getKey());
430411

431412
return entity;
432413
}

0 commit comments

Comments
 (0)