Skip to content

Commit 6917a64

Browse files
author
Yaniv Inbar
committed
api issue 796: Remove Beta API deprecated in 1.15 [backwards incompatible]
https://code.google.com/p/google-api-java-client/issues/detail?id=796 https://codereview.appspot.com/10158043/
1 parent b0dbfe3 commit 6917a64

File tree

14 files changed

+110
-818
lines changed

14 files changed

+110
-818
lines changed

clirr-ignored-differences.xml

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,104 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!-- see http://mojo.codehaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
3-
43
<differences>
4+
<!-- 7002 (method removed): className, method -->
5+
<difference>
6+
<differenceType>7002</differenceType>
7+
<className>com/google/api/client/googleapis/auth/oauth2/**</className>
8+
<method>*setScopes*</method>
9+
</difference>
10+
<difference>
11+
<differenceType>7002</differenceType>
12+
<className>com/google/api/client/googleapis/auth/oauth2/**</className>
13+
<method>*setResponseTypes*</method>
14+
</difference>
15+
<difference>
16+
<differenceType>7002</differenceType>
17+
<className>com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow</className>
18+
<method>GoogleAuthorizationCodeFlow(com.google.api.client.http.HttpTransport, com.google.api.client.json.JsonFactory, java.lang.String, java.lang.String, java.lang.Iterable)</method>
19+
</difference>
20+
<difference>
21+
<differenceType>7002</differenceType>
22+
<className>com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow$Builder</className>
23+
<method>GoogleAuthorizationCodeFlow$Builder(com.google.api.client.http.HttpTransport, com.google.api.client.json.JsonFactory, java.lang.String, java.lang.String, java.lang.Iterable)</method>
24+
</difference>
25+
<difference>
26+
<differenceType>7002</differenceType>
27+
<className>com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow$Builder</className>
28+
<method>GoogleAuthorizationCodeFlow$Builder(com.google.api.client.http.HttpTransport, com.google.api.client.json.JsonFactory, com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets, java.lang.Iterable)</method>
29+
</difference>
30+
<difference>
31+
<differenceType>7002</differenceType>
32+
<className>com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrl</className>
33+
<method>GoogleAuthorizationCodeRequestUrl(java.lang.String, java.lang.String, java.lang.Iterable)</method>
34+
</difference>
35+
<difference>
36+
<differenceType>7002</differenceType>
37+
<className>com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrl</className>
38+
<method>GoogleAuthorizationCodeRequestUrl(java.lang.String, java.lang.String, java.lang.String, java.lang.Iterable)</method>
39+
</difference>
40+
<difference>
41+
<differenceType>7002</differenceType>
42+
<className>com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeRequestUrl</className>
43+
<method>GoogleAuthorizationCodeRequestUrl(com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets, java.lang.String, java.lang.Iterable)</method>
44+
</difference>
45+
<difference>
46+
<differenceType>7002</differenceType>
47+
<className>com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrl</className>
48+
<method>GoogleBrowserClientRequestUrl(java.lang.String, java.lang.String, java.lang.Iterable)</method>
49+
</difference>
50+
<difference>
51+
<differenceType>7002</differenceType>
52+
<className>com/google/api/client/googleapis/auth/oauth2/GoogleBrowserClientRequestUrl</className>
53+
<method>GoogleBrowserClientRequestUrl(com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets, java.lang.String, java.lang.Iterable)</method>
54+
</difference>
55+
<difference>
56+
<differenceType>7002</differenceType>
57+
<className>com/google/api/client/googleapis/auth/oauth2/GoogleClientSecrets</className>
58+
<method>com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets load(com.google.api.client.json.JsonFactory, java.io.InputStream)</method>
59+
</difference>
60+
<difference>
61+
<differenceType>7002</differenceType>
62+
<className>com/google/api/client/googleapis/auth/oauth2/GoogleCredential$Builder</className>
63+
<method>com.google.api.client.googleapis.auth.oauth2.GoogleCredential$Builder setServiceAccountScopes(java.lang.String[])</method>
64+
</difference>
65+
<difference>
66+
<differenceType>7002</differenceType>
67+
<className>com/google/api/client/googleapis/auth/oauth2/GoogleCredential$Builder</className>
68+
<method>com.google.api.client.googleapis.auth.oauth2.GoogleCredential$Builder setServiceAccountScopes(java.lang.Iterable)</method>
69+
</difference>
70+
<difference>
71+
<differenceType>7002</differenceType>
72+
<className>com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredential</className>
73+
<method>AppIdentityCredential(java.lang.Iterable)</method>
74+
</difference>
75+
<difference>
76+
<differenceType>7002</differenceType>
77+
<className>com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredential</className>
78+
<method>AppIdentityCredential(java.lang.String[])</method>
79+
</difference>
80+
<difference>
81+
<differenceType>7002</differenceType>
82+
<className>com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredential$Builder</className>
83+
<method>AppIdentityCredential$Builder(java.lang.String[])</method>
84+
</difference>
85+
<difference>
86+
<differenceType>7002</differenceType>
87+
<className>com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredential$Builder</className>
88+
<method>AppIdentityCredential$Builder(java.lang.Iterable)</method>
89+
</difference>
90+
<difference>
91+
<differenceType>7002</differenceType>
92+
<className>com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAccountCredential</className>
93+
<method>com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential usingOAuth2(android.content.Context, java.lang.String, java.lang.String[])</method>
94+
</difference>
95+
<!-- 8001 (Class removed): className -->
96+
<difference>
97+
<differenceType>8001</differenceType>
98+
<className>com/google/api/client/googleapis/json/GoogleJsonRpcHttpTransport</className>
99+
</difference>
100+
<difference>
101+
<differenceType>8001</differenceType>
102+
<className>com/google/api/client/googleapis/json/GoogleJsonRpcHttpTransport$Builder</className>
103+
</difference>
5104
</differences>

google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAccountCredential.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -102,28 +102,6 @@ public GoogleAccountCredential(Context context, String scope) {
102102
this.scope = scope;
103103
}
104104

105-
/**
106-
* {@link Beta} <br/>
107-
* Constructs a new instance using OAuth 2.0 scopes.
108-
*
109-
* @param context context
110-
* @param scope first OAuth 2.0 scope
111-
* @param extraScopes any additional OAuth 2.0 scopes
112-
* @return new instance
113-
* @deprecated (scheduled to be removed in 1.16) Use {@link #usingOAuth2(Context, Collection)}
114-
* instead.
115-
*/
116-
@Beta
117-
@Deprecated
118-
public static GoogleAccountCredential usingOAuth2(
119-
Context context, String scope, String... extraScopes) {
120-
StringBuilder scopeBuilder = new StringBuilder("oauth2:").append(scope);
121-
for (String extraScope : extraScopes) {
122-
scopeBuilder.append(' ').append(extraScope);
123-
}
124-
return new GoogleAccountCredential(context, scopeBuilder.toString());
125-
}
126-
127105
/**
128106
* Constructs a new instance using OAuth 2.0 scopes.
129107
*

google-api-client-appengine/src/main/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredential.java

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@
1818
import com.google.api.client.http.HttpExecuteInterceptor;
1919
import com.google.api.client.http.HttpRequest;
2020
import com.google.api.client.http.HttpRequestInitializer;
21-
import com.google.api.client.util.Beta;
22-
import com.google.api.client.util.Lists;
2321
import com.google.appengine.api.appidentity.AppIdentityService;
2422
import com.google.appengine.api.appidentity.AppIdentityServiceFactory;
2523

2624
import java.io.IOException;
27-
import java.util.Arrays;
2825
import java.util.Collection;
2926
import java.util.Collections;
30-
import java.util.List;
3127

3228
/**
3329
* OAuth 2.0 credential in which a client Google App Engine application needs to access data that it
@@ -74,34 +70,6 @@ public AppIdentityCredential(Collection<String> scopes) {
7470
this(new Builder(scopes));
7571
}
7672

77-
/**
78-
* {@link Beta} <br/>
79-
* Constructs a new {@link AppIdentityCredential}.
80-
*
81-
* @param scopes OAuth scopes
82-
* @deprecated (scheduled to be removed in 1.16) Use {@link #AppIdentityCredential(Collection)}
83-
* instead.
84-
*/
85-
@Beta
86-
@Deprecated
87-
public AppIdentityCredential(Iterable<String> scopes) {
88-
this(new Builder(scopes));
89-
}
90-
91-
/**
92-
* {@link Beta} <br/>
93-
* Constructs a new {@link AppIdentityCredential}.
94-
*
95-
* @param scopes OAuth scopes
96-
* @deprecated (scheduled to be removed in 1.16) Use {@link #AppIdentityCredential(Collection)}
97-
* instead.
98-
*/
99-
@Beta
100-
@Deprecated
101-
public AppIdentityCredential(String... scopes) {
102-
this(new Builder(scopes));
103-
}
104-
10573
/**
10674
* @param builder builder
10775
*
@@ -138,11 +106,6 @@ public final AppIdentityService getAppIdentityService() {
138106
/**
139107
* Gets the OAuth scopes (unmodifiable).
140108
*
141-
* <p>
142-
* Upgrade warning: in prior version 1.14 this method returned a {@link List}, but starting with
143-
* version 1.15 it returns a {@link Collection}.
144-
* </p>
145-
*
146109
* @since 1.12
147110
*/
148111
public final Collection<String> getScopes() {
@@ -179,34 +142,6 @@ public Builder(Collection<String> scopes) {
179142
this.scopes = Collections.unmodifiableCollection(scopes);
180143
}
181144

182-
/**
183-
* {@link Beta} <br/>
184-
* Returns an instance of a new builder.
185-
*
186-
* @param scopes OAuth scopes
187-
* @deprecated (scheduled to be removed in 1.16) Use
188-
* {@link #AppIdentityCredential.Builder(Collection)} instead.
189-
*/
190-
@Beta
191-
@Deprecated
192-
public Builder(Iterable<String> scopes) {
193-
this.scopes = Collections.unmodifiableList(Lists.newArrayList(scopes));
194-
}
195-
196-
/**
197-
* {@link Beta} <br/>
198-
* Returns an instance of a new builder.
199-
*
200-
* @param scopes OAuth scopes
201-
* @deprecated (scheduled to be removed in 1.16) Use
202-
* {@link #AppIdentityCredential.Builder(Collection)} instead.
203-
*/
204-
@Beta
205-
@Deprecated
206-
public Builder(String... scopes) {
207-
this(Arrays.asList(scopes));
208-
}
209-
210145
/**
211146
* Returns the App Identity Service that provides the access token or {@code null} to use
212147
* {@link AppIdentityServiceFactory#getAppIdentityService()}.
@@ -241,11 +176,6 @@ public AppIdentityCredential build() {
241176
/**
242177
* Returns the OAuth scopes (unmodifiable).
243178
*
244-
* <p>
245-
* Upgrade warning: in prior version 1.14 this method returned a {@link List}, but starting with
246-
* version 1.15 it returns a {@link Collection}.
247-
* </p>
248-
*
249179
* @since 1.14
250180
*/
251181
public final Collection<String> getScopes() {

google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow.java

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -82,29 +82,6 @@ public class GoogleAuthorizationCodeFlow extends AuthorizationCodeFlow {
8282
*/
8383
private final String accessType;
8484

85-
/**
86-
* {@link Beta} <br/>
87-
* Constructs a new {@link GoogleAuthorizationCodeFlow}.
88-
*
89-
* @param transport HTTP transport
90-
* @param jsonFactory JSON factory
91-
* @param clientId client identifier
92-
* @param clientSecret client secret
93-
* @param scopes list of scopes to be joined by a space separator (or a single value containing
94-
* multiple space-separated scopes)
95-
* @deprecated (scheduled to be removed in 1.16) Use {@link
96-
* #GoogleAuthorizationCodeFlow(HttpTransport, JsonFactory, String, String,
97-
* Collection)} instead.
98-
*
99-
* @since 1.14
100-
*/
101-
@Beta
102-
@Deprecated
103-
public GoogleAuthorizationCodeFlow(HttpTransport transport, JsonFactory jsonFactory,
104-
String clientId, String clientSecret, Iterable<String> scopes) {
105-
this(new Builder(transport, jsonFactory, clientId, clientSecret, scopes));
106-
}
107-
10885
/**
10986
* @param transport HTTP transport
11087
* @param jsonFactory JSON factory
@@ -186,29 +163,6 @@ public static class Builder extends AuthorizationCodeFlow.Builder {
186163
*/
187164
String accessType;
188165

189-
/**
190-
* {@link Beta} <br/>
191-
* Constructs a new {@link Builder}.
192-
*
193-
* @param transport HTTP transport
194-
* @param jsonFactory JSON factory
195-
* @param clientId client identifier
196-
* @param clientSecret client secret
197-
* @param scopes list of scopes to be joined by a space separator (or a single value containing
198-
* multiple space-separated scopes)
199-
* @deprecated (scheduled to be removed in 1.16) Use {@link #GoogleAuthorizationCodeFlow.Builder
200-
* (HttpTransport, JsonFactory, String, String, Collection)} instead.
201-
*/
202-
@Beta
203-
@Deprecated
204-
public Builder(HttpTransport transport, JsonFactory jsonFactory, String clientId,
205-
String clientSecret, Iterable<String> scopes) {
206-
super(BearerToken.authorizationHeaderAccessMethod(), transport, jsonFactory, new GenericUrl(
207-
GoogleOAuthConstants.TOKEN_SERVER_URL), new ClientParametersAuthentication(
208-
clientId, clientSecret), clientId, GoogleOAuthConstants.AUTHORIZATION_SERVER_URL);
209-
setScopes(Preconditions.checkNotNull(scopes));
210-
}
211-
212166
/**
213167
*
214168
* @param transport HTTP transport
@@ -228,30 +182,6 @@ public Builder(HttpTransport transport, JsonFactory jsonFactory, String clientId
228182
setScopes(scopes);
229183
}
230184

231-
/**
232-
* {@link Beta} <br/>
233-
* Constructs a new {@link Builder}.
234-
*
235-
* @param transport HTTP transport
236-
* @param jsonFactory JSON factory
237-
* @param clientSecrets Google client secrets
238-
* @param scopes list of scopes to be joined by a space separator (or a single value containing
239-
* multiple space-separated scopes)
240-
* @deprecated (scheduled to be removed in 1.16) Use
241-
* {@link #GoogleAuthorizationCodeFlow.Builder(HttpTransport, JsonFactory,
242-
* GoogleClientSecrets, Collection)} instead.
243-
*/
244-
@Beta
245-
@Deprecated
246-
public Builder(HttpTransport transport, JsonFactory jsonFactory,
247-
GoogleClientSecrets clientSecrets, Iterable<String> scopes) {
248-
super(BearerToken.authorizationHeaderAccessMethod(), transport, jsonFactory, new GenericUrl(
249-
GoogleOAuthConstants.TOKEN_SERVER_URL), new ClientParametersAuthentication(
250-
clientSecrets.getDetails().getClientId(), clientSecrets.getDetails().getClientSecret()),
251-
clientSecrets.getDetails().getClientId(), GoogleOAuthConstants.AUTHORIZATION_SERVER_URL);
252-
setScopes(Preconditions.checkNotNull(scopes));
253-
}
254-
255185
/**
256186
* @param transport HTTP transport
257187
* @param jsonFactory JSON factory
@@ -308,20 +238,6 @@ public Builder setScopes(Collection<String> scopes) {
308238
return (Builder) super.setScopes(scopes);
309239
}
310240

311-
@Override
312-
@Beta
313-
@Deprecated
314-
public Builder setScopes(Iterable<String> scopes) {
315-
return (Builder) super.setScopes(scopes);
316-
}
317-
318-
@Override
319-
@Beta
320-
@Deprecated
321-
public Builder setScopes(String... scopes) {
322-
return (Builder) super.setScopes(scopes);
323-
}
324-
325241
/**
326242
* @since 1.11
327243
*/

0 commit comments

Comments
 (0)