Skip to content

Commit e6d84cd

Browse files
authored
SupressWarnings correctly (GoogleCloudPlatform#824)
1 parent 0e81fc5 commit e6d84cd

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

appengine-java8/datastore/src/test/java/com/example/appengine/EntitiesTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public void repeatedProperties_storesList() throws Exception {
218218
assertThat(retrievedFruits).containsExactlyElementsIn(favoriteFruit).inOrder();
219219
}
220220

221-
@SuppressWarnings(VariableDeclarationUsageDistance)
221+
@SuppressWarnings("VariableDeclarationUsageDistance")
222222
@Test
223223
public void embeddedEntity_fromEmbedded_embedsProperties() throws Exception {
224224
Entity employee = new Entity("Employee");

appengine-java8/datastore/src/test/java/com/example/appengine/TransactionsTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ public void entityGroups() throws Exception {
140140
}
141141
}
142142

143-
@SuppressWarnings(VariableDeclarationUsageDistance)
144143
@Test
145144
public void creatingAnEntityInASpecificEntityGroup() throws Exception {
146145
String boardName = "my-message-board";
@@ -152,14 +151,14 @@ public void creatingAnEntityInASpecificEntityGroup() throws Exception {
152151
String messageText = "Some message.";
153152
Date postDate = new Date();
154153

155-
Transaction txn = datastore.beginTransaction();
156-
157154
Key messageBoardKey = KeyFactory.createKey("MessageBoard", boardName);
158155

159156
Entity message = new Entity("Message", messageBoardKey);
160157
message.setProperty("message_title", messageTitle);
161158
message.setProperty("message_text", messageText);
162159
message.setProperty("post_date", postDate);
160+
161+
Transaction txn = datastore.beginTransaction();
163162
datastore.put(txn, message);
164163

165164
txn.commit();

0 commit comments

Comments
 (0)