Skip to content

Commit 7f91ee9

Browse files
1 parent 7d0ccc8 commit 7f91ee9

File tree

3 files changed

+93
-89
lines changed

3 files changed

+93
-89
lines changed

‎google-api-client/src/main/java/com/google/api/client/googleapis/json/GoogleJsonError.java

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -184,72 +184,72 @@ public ErrorInfo clone() {
184184
}
185185
}
186186

187-
// public static class Details {
188-
// @Key("@type")
189-
// private String type;
190-
//
191-
// @Key private String detail;
192-
// @Key private String reason;
193-
// @Key private List<ParameterViolations> parameterViolations;
194-
//
195-
// public String getType() {
196-
// return type;
197-
// }
198-
//
199-
// public void setType(String type) {
200-
// this.type = type;
201-
// }
202-
//
203-
// public String getDetail() {
204-
// return detail;
205-
// }
206-
//
207-
// public void setDetail(String detail) {
208-
// this.detail = detail;
209-
// }
210-
//
211-
// public String getReason() {
212-
// return reason;
213-
// }
214-
//
215-
// public void setReason(String reason) {
216-
// this.reason = reason;
217-
// }
218-
//
219-
// public List<ParameterViolations> getParameterViolations() {
220-
// return parameterViolations;
221-
// }
222-
//
223-
// /**
224-
// * Sets parameterViolations list as immutable to prevent exposing mutable state.
225-
// *
226-
// * @param parameterViolations
227-
// */
228-
// public void setParameterViolations(List<ParameterViolations> parameterViolations) {
229-
// this.parameterViolations = ImmutableList.copyOf(parameterViolations);
230-
// }
231-
// }
232-
//
233-
// public static class ParameterViolations {
234-
// @Key private String parameter;
235-
// @Key private String description;
236-
//
237-
// public String getDescription() {
238-
// return description;
239-
// }
240-
//
241-
// public void setDescription(String description) {
242-
// this.description = description;
243-
// }
244-
//
245-
// public String getParameter() {
246-
// return parameter;
247-
// }
248-
//
249-
// public void setParameter(String parameter) {
250-
// this.parameter = parameter;
251-
// }
252-
// }
187+
// public static class Details {
188+
// @Key("@type")
189+
// private String type;
190+
//
191+
// @Key private String detail;
192+
// @Key private String reason;
193+
// @Key private List<ParameterViolations> parameterViolations;
194+
//
195+
// public String getType() {
196+
// return type;
197+
// }
198+
//
199+
// public void setType(String type) {
200+
// this.type = type;
201+
// }
202+
//
203+
// public String getDetail() {
204+
// return detail;
205+
// }
206+
//
207+
// public void setDetail(String detail) {
208+
// this.detail = detail;
209+
// }
210+
//
211+
// public String getReason() {
212+
// return reason;
213+
// }
214+
//
215+
// public void setReason(String reason) {
216+
// this.reason = reason;
217+
// }
218+
//
219+
// public List<ParameterViolations> getParameterViolations() {
220+
// return parameterViolations;
221+
// }
222+
//
223+
// /**
224+
// * Sets parameterViolations list as immutable to prevent exposing mutable state.
225+
// *
226+
// * @param parameterViolations
227+
// */
228+
// public void setParameterViolations(List<ParameterViolations> parameterViolations) {
229+
// this.parameterViolations = ImmutableList.copyOf(parameterViolations);
230+
// }
231+
// }
232+
//
233+
// public static class ParameterViolations {
234+
// @Key private String parameter;
235+
// @Key private String description;
236+
//
237+
// public String getDescription() {
238+
// return description;
239+
// }
240+
//
241+
// public void setDescription(String description) {
242+
// this.description = description;
243+
// }
244+
//
245+
// public String getParameter() {
246+
// return parameter;
247+
// }
248+
//
249+
// public void setParameter(String parameter) {
250+
// this.parameter = parameter;
251+
// }
252+
// }
253253

254254
/** List of detailed errors or {@code null} for none. */
255255
@Key private List<ErrorInfo> errors;
@@ -260,8 +260,8 @@ public ErrorInfo clone() {
260260
/** Human-readable explanation of the error or {@code null} for none. */
261261
@Key private String message;
262262

263-
// /** Lists type and parameterViolation details of an Exception. */
264-
// @Key private List<Details> details;
263+
// /** Lists type and parameterViolation details of an Exception. */
264+
// @Key private List<Details> details;
265265

266266
/**
267267
* Returns the list of detailed errors or {@code null} for none.
@@ -318,19 +318,19 @@ public final void setMessage(String message) {
318318
this.message = message;
319319
}
320320

321-
// public List<Details> getDetails() {
322-
// return details;
323-
// }
324-
//
325-
// /**
326-
// * Sets the list of invalid parameter error details as immutable to prevent exposing mutable
327-
// * state.
328-
// *
329-
// * @param details
330-
// */
331-
// public void setDetails(List<Details> details) {
332-
// this.details = ImmutableList.copyOf(details);
333-
// }
321+
// public List<Details> getDetails() {
322+
// return details;
323+
// }
324+
//
325+
// /**
326+
// * Sets the list of invalid parameter error details as immutable to prevent exposing mutable
327+
// * state.
328+
// *
329+
// * @param details
330+
// */
331+
// public void setDetails(List<Details> details) {
332+
// this.details = ImmutableList.copyOf(details);
333+
// }
334334

335335
@Override
336336
public GoogleJsonError set(String fieldName, Object value) {

‎google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonErrorTest.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import com.google.api.client.testing.http.MockHttpTransport;
2828
import com.google.api.client.testing.http.MockLowLevelHttpRequest;
2929
import com.google.api.client.testing.http.MockLowLevelHttpResponse;
30-
3130
import java.io.InputStream;
3231
import java.io.InputStreamReader;
3332
import junit.framework.TestCase;
@@ -101,7 +100,8 @@ public void testParse_withMultipleErrorTypesInDetails() throws Exception {
101100
GoogleJsonErrorTest.class.getResourceAsStream("errorWithMultipleTypesInDetails.json");
102101

103102
InputStream expectedContent =
104-
GoogleJsonErrorTest.class.getResourceAsStream("expectedResultErrorWithMultipleTypesInDetails.json");
103+
GoogleJsonErrorTest.class.getResourceAsStream(
104+
"expectedResultErrorWithMultipleTypesInDetails.json");
105105

106106
HttpTransport transport =
107107
new ErrorTransport(
@@ -116,7 +116,9 @@ public void testParse_withMultipleErrorTypesInDetails() throws Exception {
116116
com.google.api.client.googleapis.json.GoogleJsonError errorResponse =
117117
com.google.api.client.googleapis.json.GoogleJsonError.parse(FACTORY, response);
118118
System.out.println(errorResponse.toString());
119-
assertEquals(JSON_PARSER.parse(new InputStreamReader(expectedContent)), JSON_PARSER.parse(FACTORY.toString(errorResponse)));
119+
assertEquals(
120+
JSON_PARSER.parse(new InputStreamReader(expectedContent)),
121+
JSON_PARSER.parse(FACTORY.toString(errorResponse)));
120122
// assertNotNull(errorResponse.getDetails().get(2).getReason());
121123
}
122124

@@ -149,8 +151,9 @@ public void testParse_withDetails() throws Exception {
149151
com.google.api.client.googleapis.json.GoogleJsonError errorResponse =
150152
com.google.api.client.googleapis.json.GoogleJsonError.parse(FACTORY, response);
151153

152-
assertEquals(JSON_PARSER.parse(DETAILS_ERROR), JSON_PARSER.parse(FACTORY.toString(errorResponse)));
153-
// assertNotNull(errorResponse.getDetails());
154+
assertEquals(
155+
JSON_PARSER.parse(DETAILS_ERROR), JSON_PARSER.parse(FACTORY.toString(errorResponse)));
156+
// assertNotNull(errorResponse.getDetails());
154157
}
155158

156159
public void testParse_withReasonInDetails() throws Exception {
@@ -193,7 +196,8 @@ public void testParse_withReasonInDetails() throws Exception {
193196
com.google.api.client.googleapis.json.GoogleJsonError errorResponse =
194197
com.google.api.client.googleapis.json.GoogleJsonError.parse(FACTORY, response);
195198

196-
assertEquals(JSON_PARSER.parse(DETAILS_ERROR), JSON_PARSER.parse(FACTORY.toString(errorResponse)));
197-
// assertNotNull(errorResponse.getDetails().get(2).getReason());
199+
assertEquals(
200+
JSON_PARSER.parse(DETAILS_ERROR), JSON_PARSER.parse(FACTORY.toString(errorResponse)));
201+
// assertNotNull(errorResponse.getDetails().get(2).getReason());
198202
}
199203
}

‎google-api-client/src/test/java/com/google/api/client/googleapis/json/GoogleJsonResponseExceptionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,6 @@ public void testFrom_detailsWithInvalidParameter() throws Exception {
207207
GoogleJsonResponseException ge =
208208
GoogleJsonResponseException.from(
209209
com.google.api.client.googleapis.json.GoogleJsonErrorTest.FACTORY, response);
210-
// assertNotNull(ge.getDetails().getDetails());
210+
// assertNotNull(ge.getDetails().getDetails());
211211
}
212212
}

0 commit comments

Comments
 (0)