Skip to content

Commit

Permalink
Merge pull request #190 from BingAds/v13.0.20.2
Browse files Browse the repository at this point in the history
V13.0.20.2
  • Loading branch information
xinyuwen2 committed May 9, 2024
2 parents e66576e + dc3114d commit f7989fc
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 58 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The Bing Ads Java SDK includes and depends on the microsoft.bingads Maven artifa
<dependency>
<groupId>com.microsoft.bingads</groupId>
<artifactId>microsoft.bingads</artifactId>
<version>13.0.20.1</version>
<version>13.0.20.2</version>
</dependency>
```
If you are not using a Maven project, you must include the correct version of each dependency. You can review the complete list of Bing Ads Java SDK dependencies at the [Maven Repository](http://mvnrepository.com/artifact/com.microsoft.bingads/microsoft.bingads/).
2 changes: 1 addition & 1 deletion examples/BingAdsDesktopApp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependency>
<groupId>com.microsoft.bingads</groupId>
<artifactId>microsoft.bingads</artifactId>
<version>13.0.20.1</version>
<version>13.0.20.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
2 changes: 1 addition & 1 deletion examples/BingAdsDesktopApp/pom_for_java1.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependency>
<groupId>com.microsoft.bingads</groupId>
<artifactId>microsoft.bingads</artifactId>
<version>13.0.20.1</version>
<version>13.0.20.2</version>
<exclusions>
<!-- Exclude CXF, which does not support Java 8 -->
<exclusion>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.bingads</groupId>
<version>13.0.20.1</version>
<version>13.0.20.2</version>
<name>Bing Ads Java SDK</name>
<description>The Bing Ads Java SDK is a library improving developer experience when working with the Bing Ads services by providing high-level access to features such as Bulk API, OAuth Authorization and SOAP API.</description>
<url>https://github.com/BingAds/BingAds-Java-SDK</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public class ServiceFactoryImpl implements ServiceFactory {

public static final String VERSION = "13.0.20.1";
public static final String VERSION = "13.0.20.2";

private static final int DEFAULT_WS_CREATE_TIMEOUT_IN_SECOND = 60;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
package com.microsoft.bingads.internal.restful.adaptor;

import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.BeanProperty;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.deser.ContextualDeserializer;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;


Expand All @@ -35,29 +23,7 @@ public CalendarDeserializer(Class<?> t) {

@Override
public Calendar deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
String str = p.getText();
str = str.replaceAll("\\.\\d+", "");
try {
String dateTime = str.substring(0, 19); //yyyy-MM-ddTHH:mm:ss
String zone = str.length() > 19 ? str.substring(19, str.length()) : null;
Calendar calendar = Calendar.getInstance();
TimeZone timeZone = TimeZone.getTimeZone("UTC");
if (zone == null || zone.contains("Z")) {
calendar.setTimeZone(timeZone);
}
else if (zone != null && (zone.contains("+") || zone.contains("-"))) {
timeZone = TimeZone.getTimeZone("GMT" + zone.substring(0, 3));

}
formatter.setTimeZone(timeZone);
calendar.setTimeZone(timeZone);
Date date = formatter.parse(dateTime);
calendar.setTime(date);
return calendar;
} catch (ParseException e) {
throw new RuntimeException(e);
}

return jakarta.xml.bind.DatatypeConverter.parseDate(p.getText());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,10 @@
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;


import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.BeanProperty;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.deser.ContextualDeserializer;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.ContextualSerializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;


Expand All @@ -37,9 +24,6 @@ public CalendarSerializer(Class t) {

@Override
public void serialize(Calendar value, JsonGenerator gen, SerializerProvider provider) throws IOException {
formatter.setTimeZone(value.getTimeZone());
String zone = value.getTimeZone().getID().replaceAll("GMT", "").replaceAll("UTC", "");
Date date = value.getTime();
gen.writeString(formatter.format(value.getTime()) + zone);
gen.writeString(jakarta.xml.bind.DatatypeConverter.printDateTime(value));
}
}

0 comments on commit f7989fc

Please sign in to comment.