Skip to content

Commit

Permalink
Merge pull request #147 from jianghaolu/guavafix
Browse files Browse the repository at this point in the history
[Azure/azure-sdk-for-java#1322] Upgrade guava to 20.0
  • Loading branch information
jianghaolu authored Feb 14, 2017
2 parents 0d02ae5 + 3121e52 commit 95ddf9c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 311 deletions.
98 changes: 0 additions & 98 deletions azure-client-authentication/build.gradle

This file was deleted.

96 changes: 0 additions & 96 deletions azure-client-runtime/build.gradle

This file was deleted.

109 changes: 0 additions & 109 deletions client-runtime/build.gradle

This file was deleted.

14 changes: 7 additions & 7 deletions client-runtime/src/main/java/com/microsoft/rest/Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public static void validate(Object parameter) {
}
if (parameterToken.isPrimitive()
|| parameterType.isEnum()
|| parameterToken.isAssignableFrom(LocalDate.class)
|| parameterToken.isAssignableFrom(DateTime.class)
|| parameterToken.isAssignableFrom(String.class)
|| parameterToken.isAssignableFrom(DateTimeRfc1123.class)
|| parameterToken.isAssignableFrom(Period.class)) {
|| parameterToken.isSupertypeOf(LocalDate.class)
|| parameterToken.isSupertypeOf(DateTime.class)
|| parameterToken.isSupertypeOf(String.class)
|| parameterToken.isSupertypeOf(DateTimeRfc1123.class)
|| parameterToken.isSupertypeOf(Period.class)) {
return;
}

Expand Down Expand Up @@ -86,13 +86,13 @@ public static void validate(Object parameter) {
} else {
try {
Class<?> propertyType = property.getClass();
if (TypeToken.of(List.class).isAssignableFrom(propertyType)) {
if (TypeToken.of(List.class).isSupertypeOf(propertyType)) {
List<?> items = (List<?>) property;
for (Object item : items) {
Validator.validate(item);
}
}
else if (TypeToken.of(Map.class).isAssignableFrom(propertyType)) {
else if (TypeToken.of(Map.class).isSupertypeOf(propertyType)) {
Map<?, ?> entries = (Map<?, ?>) property;
for (Map.Entry<?, ?> entry : entries.entrySet()) {
Validator.validate(entry.getKey());
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
<version>20.0</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
Expand Down

0 comments on commit 95ddf9c

Please sign in to comment.