diff --git a/appengine-java8/datastore/src/test/java/com/example/appengine/EntitiesTest.java b/appengine-java8/datastore/src/test/java/com/example/appengine/EntitiesTest.java index 31d674e326b..b61233455a9 100644 --- a/appengine-java8/datastore/src/test/java/com/example/appengine/EntitiesTest.java +++ b/appengine-java8/datastore/src/test/java/com/example/appengine/EntitiesTest.java @@ -218,7 +218,7 @@ public void repeatedProperties_storesList() throws Exception { assertThat(retrievedFruits).containsExactlyElementsIn(favoriteFruit).inOrder(); } - @SuppressWarnings(VariableDeclarationUsageDistance) + @SuppressWarnings("VariableDeclarationUsageDistance") @Test public void embeddedEntity_fromEmbedded_embedsProperties() throws Exception { Entity employee = new Entity("Employee"); diff --git a/appengine-java8/datastore/src/test/java/com/example/appengine/TransactionsTest.java b/appengine-java8/datastore/src/test/java/com/example/appengine/TransactionsTest.java index 2dc5a1bc116..0e81e300dd1 100644 --- a/appengine-java8/datastore/src/test/java/com/example/appengine/TransactionsTest.java +++ b/appengine-java8/datastore/src/test/java/com/example/appengine/TransactionsTest.java @@ -140,7 +140,6 @@ public void entityGroups() throws Exception { } } - @SuppressWarnings(VariableDeclarationUsageDistance) @Test public void creatingAnEntityInASpecificEntityGroup() throws Exception { String boardName = "my-message-board"; @@ -152,14 +151,14 @@ public void creatingAnEntityInASpecificEntityGroup() throws Exception { String messageText = "Some message."; Date postDate = new Date(); - Transaction txn = datastore.beginTransaction(); - Key messageBoardKey = KeyFactory.createKey("MessageBoard", boardName); Entity message = new Entity("Message", messageBoardKey); message.setProperty("message_title", messageTitle); message.setProperty("message_text", messageText); message.setProperty("post_date", postDate); + + Transaction txn = datastore.beginTransaction(); datastore.put(txn, message); txn.commit();