diff --git a/google-http-client-jackson2/src/main/java/com/google/api/client/json/jackson2/JacksonFactory.java b/google-http-client-jackson2/src/main/java/com/google/api/client/json/jackson2/JacksonFactory.java index e76228805..a78cc3647 100644 --- a/google-http-client-jackson2/src/main/java/com/google/api/client/json/jackson2/JacksonFactory.java +++ b/google-http-client-jackson2/src/main/java/com/google/api/client/json/jackson2/JacksonFactory.java @@ -61,6 +61,7 @@ public static JacksonFactory getDefaultInstance() { /** Holder for the result of {@link #getDefaultInstance()}. */ static class InstanceHolder { static final JacksonFactory INSTANCE; + static { INSTANCE = new JacksonFactory(); } diff --git a/google-http-client-jackson2/src/test/java/com/google/api/client/json/jackson2/JacksonFactoryTest.java b/google-http-client-jackson2/src/test/java/com/google/api/client/json/jackson2/JacksonFactoryTest.java index 5551dcc75..d80bb8390 100644 --- a/google-http-client-jackson2/src/test/java/com/google/api/client/json/jackson2/JacksonFactoryTest.java +++ b/google-http-client-jackson2/src/test/java/com/google/api/client/json/jackson2/JacksonFactoryTest.java @@ -38,7 +38,11 @@ public class JacksonFactoryTest extends AbstractJsonFactoryTest { static { JSON_ENTRY_PRETTY = - "{" + StringUtils.LINE_SEPARATOR + " \"title\" : \"foo\"" + StringUtils.LINE_SEPARATOR + "}"; + "{" + + StringUtils.LINE_SEPARATOR + + " \"title\" : \"foo\"" + + StringUtils.LINE_SEPARATOR + + "}"; JSON_FEED_PRETTY = "{" + StringUtils.LINE_SEPARATOR diff --git a/google-http-client-protobuf/src/main/resources/META-INF/native-image/com.google.http-client/google-http-client-protobuf/native-image.properties b/google-http-client-protobuf/src/main/resources/META-INF/native-image/com.google.http-client/google-http-client-protobuf/native-image.properties new file mode 100644 index 000000000..3cbd2b27f --- /dev/null +++ b/google-http-client-protobuf/src/main/resources/META-INF/native-image/com.google.http-client/google-http-client-protobuf/native-image.properties @@ -0,0 +1 @@ +Args=--initialize-at-build-time=org.junit.runner.RunWith,java.lang.annotation.Annotation diff --git a/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java b/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java index 920b2cc28..a0629280f 100644 --- a/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java +++ b/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java @@ -101,7 +101,6 @@ public void testParse_empty() throws Exception { } } - @Test public void testParse_emptyMap() throws Exception { JsonParser parser = newFactory().createJsonParser(EMPTY_OBJECT); @@ -139,8 +138,7 @@ public void testParser_partialEmpty() throws Exception { static { JSON_ENTRY = "{\"title\":\"foo\"}"; - JSON_FEED = - "{\"entries\":[" + "{\"title\":\"foo\"}," + "{\"title\":\"bar\"}]}"; + JSON_FEED = "{\"entries\":[" + "{\"title\":\"foo\"}," + "{\"title\":\"bar\"}]}"; } @Test @@ -461,6 +459,7 @@ public static class AnyType { } static final String ANY_TYPE; + static { ANY_TYPE = "{\"arr\":[1],\"bool\":true,\"nul\":null,\"num\":5," @@ -548,8 +547,7 @@ public static class MapOfMapType { static final String MAP_TYPE; static { - MAP_TYPE = - "{\"value\":[{\"map1\":{\"k1\":1,\"k2\":2},\"map2\":{\"kk1\":3,\"kk2\":4}}]}"; + MAP_TYPE = "{\"value\":[{\"map1\":{\"k1\":1,\"k2\":2},\"map2\":{\"kk1\":3,\"kk2\":4}}]}"; } @Test @@ -929,8 +927,7 @@ public static class EnumValue { static final String ENUM_VALUE; static { - ENUM_VALUE = - "{\"nullValue\":null,\"otherValue\":\"other\",\"value\":\"VALUE\"}"; + ENUM_VALUE = "{\"nullValue\":null,\"otherValue\":\"other\",\"value\":\"VALUE\"}"; } @Test diff --git a/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonParserTest.java b/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonParserTest.java index e746ae02d..25bb77bb4 100644 --- a/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonParserTest.java +++ b/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonParserTest.java @@ -39,8 +39,7 @@ public abstract class AbstractJsonParserTest { private static final String TEST_JSON_BIG_DECIMAL; static { - TEST_JSON = - "{\"strValue\": \"bar\", \"intValue\": 123, \"boolValue\": false}"; + TEST_JSON = "{\"strValue\": \"bar\", \"intValue\": 123, \"boolValue\": false}"; TEST_JSON_BIG_DECIMAL = "{\"bigDecimalValue\": 1559341956102}"; } diff --git a/google-http-client-test/src/main/java/com/google/api/client/test/util/store/AbstractDataStoreFactoryTest.java b/google-http-client-test/src/main/java/com/google/api/client/test/util/store/AbstractDataStoreFactoryTest.java index 36ee9eefa..7a5f464c8 100644 --- a/google-http-client-test/src/main/java/com/google/api/client/test/util/store/AbstractDataStoreFactoryTest.java +++ b/google-http-client-test/src/main/java/com/google/api/client/test/util/store/AbstractDataStoreFactoryTest.java @@ -49,6 +49,7 @@ public abstract class AbstractDataStoreFactoryTest { STRING_ID = "String"; BOOLEAN_ID = "Boolean"; } + DataStoreFactory dataStore; DataStore stringTyped; DataStore boolTyped; diff --git a/google-http-client-xml/src/test/java/com/google/api/client/xml/XmlNamespaceDictionaryTest.java b/google-http-client-xml/src/test/java/com/google/api/client/xml/XmlNamespaceDictionaryTest.java index 958406df4..34022a873 100644 --- a/google-http-client-xml/src/test/java/com/google/api/client/xml/XmlNamespaceDictionaryTest.java +++ b/google-http-client-xml/src/test/java/com/google/api/client/xml/XmlNamespaceDictionaryTest.java @@ -25,7 +25,6 @@ import java.io.StringWriter; import java.util.Collection; import java.util.TreeSet; -import junit.framework.TestCase; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/google-http-client-xml/src/test/java/com/google/api/client/xml/XmlTest.java b/google-http-client-xml/src/test/java/com/google/api/client/xml/XmlTest.java index 2b815c50e..539bd00a7 100644 --- a/google-http-client-xml/src/test/java/com/google/api/client/xml/XmlTest.java +++ b/google-http-client-xml/src/test/java/com/google/api/client/xml/XmlTest.java @@ -63,8 +63,7 @@ public class XmlTest { SIMPLE_XML = "test"; SIMPLE_XML_NUMERIC = "1"; START_WITH_TEXT = "start_with_text"; - MISSING_END_ELEMENT = - "" + "missing_end_element"; + MISSING_END_ELEMENT = "" + "missing_end_element"; START_WITH_END_ELEMENT = "

start_with_end_elemtn"; START_WITH_END_ELEMENT_NESTED = diff --git a/google-http-client-xml/src/test/resources/META-INF/native-image/com.google.http-client/google-http-client-xml/native-image.properties b/google-http-client-xml/src/test/resources/META-INF/native-image/com.google.http-client/google-http-client-xml/native-image.properties new file mode 100644 index 000000000..3cbd2b27f --- /dev/null +++ b/google-http-client-xml/src/test/resources/META-INF/native-image/com.google.http-client/google-http-client-xml/native-image.properties @@ -0,0 +1 @@ +Args=--initialize-at-build-time=org.junit.runner.RunWith,java.lang.annotation.Annotation diff --git a/google-http-client/src/main/java/com/google/api/client/util/store/AbstractDataStoreFactory.java b/google-http-client/src/main/java/com/google/api/client/util/store/AbstractDataStoreFactory.java index e6a8c9b4e..d70de7d43 100644 --- a/google-http-client/src/main/java/com/google/api/client/util/store/AbstractDataStoreFactory.java +++ b/google-http-client/src/main/java/com/google/api/client/util/store/AbstractDataStoreFactory.java @@ -55,8 +55,7 @@ public abstract class AbstractDataStoreFactory implements DataStoreFactory { } public final DataStore getDataStore(String id) throws IOException { - checkArgument( - ID_PATTERN.matcher(id).matches(), "%s does not match pattern %s", id, ID_PATTERN); + checkArgument(ID_PATTERN.matcher(id).matches(), "%s does not match pattern %s", id, ID_PATTERN); lock.lock(); try { @SuppressWarnings("unchecked") diff --git a/google-http-client/src/main/java/com/google/api/client/util/store/FileDataStoreFactory.java b/google-http-client/src/main/java/com/google/api/client/util/store/FileDataStoreFactory.java index a53d14d8f..16b33b093 100644 --- a/google-http-client/src/main/java/com/google/api/client/util/store/FileDataStoreFactory.java +++ b/google-http-client/src/main/java/com/google/api/client/util/store/FileDataStoreFactory.java @@ -56,6 +56,7 @@ public class FileDataStoreFactory extends AbstractDataStoreFactory { private static final boolean IS_WINDOWS; + static { try { IS_WINDOWS =