Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

Commit bd30519

Browse files
author
Yaniv Inbar
committed
Update samples to Eclipse 3.7, new library
http://codereview.appspot.com/5340047/
1 parent 1694357 commit bd30519

File tree

113 files changed

+1090
-833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1090
-833
lines changed

.hgignore

+3
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ syntax: regexp
1010
syntax: regexp
1111
^[^/]+/.gwt$
1212

13+
syntax: regexp
14+
^[^/]+/bin$
15+

books-cmdline-sample/.classpath

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
33
<classpathentry kind="src" path="src/main/java" />
4-
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER" />
5-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" />
4+
<classpathentry kind="con"
5+
path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" />
6+
<classpathentry kind="con"
7+
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" />
68
<classpathentry kind="output" path="target/classes" />
79
</classpath>

books-cmdline-sample/.project

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
</arguments>
1212
</buildCommand>
1313
<buildCommand>
14-
<name>org.maven.ide.eclipse.maven2Builder</name>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
1515
<arguments>
1616
</arguments>
1717
</buildCommand>
1818
</buildSpec>
1919
<natures>
2020
<nature>org.eclipse.jdt.core.javanature</nature>
21-
<nature>org.maven.ide.eclipse.maven2Nature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
2222
</natures>
2323
</projectDescription>

books-cmdline-sample/.settings/org.eclipse.jdt.core.prefs

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Wed Mar 02 09:47:19 EST 2011
1+
#Fri Nov 04 10:10:38 EDT 2011
22
eclipse.preferences.version=1
33
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
44
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
@@ -88,12 +88,12 @@ org.eclipse.jdt.core.formatter.alignment_for_annotations_on_member=569
8888
org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration=569
8989
org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=24
9090
org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration=569
91-
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16|5|80
91+
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
9292
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16
9393
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
94-
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16|5|80
95-
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16|5|80
96-
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16|4|80
94+
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
95+
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
96+
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
9797
org.eclipse.jdt.core.formatter.alignment_for_assignment=16
9898
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
9999
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
@@ -104,11 +104,12 @@ org.eclipse.jdt.core.formatter.alignment_for_field_declaration=16
104104
org.eclipse.jdt.core.formatter.alignment_for_for_statement=16
105105
org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments=16
106106
org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration=16
107+
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
107108
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
108109
org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class=0
109110
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16|5|80
110111
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16|5|80
111-
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16|4|48
112+
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
112113
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
113114
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16|4|49
114115
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16|4|48
@@ -149,12 +150,18 @@ org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
149150
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
150151
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
151152
org.eclipse.jdt.core.formatter.comment.line_length=100
153+
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
154+
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
155+
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
152156
org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph=true
153157
org.eclipse.jdt.core.formatter.compact_else_if=true
154158
org.eclipse.jdt.core.formatter.continuation_indentation=2
155159
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
160+
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
161+
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
156162
org.eclipse.jdt.core.formatter.force_if_else_statement_brace=true
157163
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
164+
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
158165
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
159166
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
160167
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
@@ -166,6 +173,13 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
166173
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
167174
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
168175
org.eclipse.jdt.core.formatter.indentation.size=4
176+
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
177+
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
178+
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
179+
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
180+
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
181+
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
182+
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
169183
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
170184
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
171185
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
@@ -353,6 +367,7 @@ org.eclipse.jdt.core.formatter.sort_parameter_annotations=false
353367
org.eclipse.jdt.core.formatter.sort_type_annotations=false
354368
org.eclipse.jdt.core.formatter.tabulation.char=space
355369
org.eclipse.jdt.core.formatter.tabulation.size=2
370+
org.eclipse.jdt.core.formatter.use_on_off_tags=false
356371
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
357372
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
358373
org.eclipse.jdt.core.formatter.wrap_comment_inline_tags=false
@@ -361,4 +376,5 @@ org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation=true
361376
org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation=true
362377
org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation=false
363378
org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation=true
379+
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
364380
org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments=false

books-cmdline-sample/.settings/org.eclipse.jdt.ui.prefs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Mon May 09 17:25:49 PDT 2011
1+
#Fri Nov 04 10:06:25 EDT 2011
22
cleanup.add_default_serial_version_id=true
33
cleanup.add_generated_serial_version_id=false
44
cleanup.add_missing_annotations=true
@@ -54,7 +54,7 @@ cleanup_settings_version=2
5454
eclipse.preferences.version=1
5555
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=false
5656
formatter_profile=_google-api-java-client 100
57-
formatter_settings_version=11
57+
formatter_settings_version=12
5858
org.eclipse.jdt.ui.exception.name=exception
5959
org.eclipse.jdt.ui.gettersetter.use.is=false
6060
org.eclipse.jdt.ui.ignorelowercasenames=true

books-cmdline-sample/src/main/java/com/google/api/services/samples/books/cmdline/BooksSample.java

+7-9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package com.google.api.services.samples.books.cmdline;
1616

1717
import com.google.api.client.googleapis.json.GoogleJsonError;
18+
import com.google.api.client.googleapis.json.GoogleJsonResponseException;
1819
import com.google.api.client.googleapis.json.GoogleJsonError.ErrorInfo;
1920
import com.google.api.client.http.HttpResponseException;
2021
import com.google.api.client.http.javanet.NetHttpTransport;
@@ -172,16 +173,13 @@ public static void main(String[] args) {
172173
queryGoogleBooks(jsonFactory, query);
173174
// Success!
174175
return;
176+
} catch (GoogleJsonResponseException e) {
177+
// message already includes parsed response
178+
System.err.println(e.getMessage());
175179
} catch (HttpResponseException e) {
176-
if (!Json.CONTENT_TYPE.equals(e.getResponse().getContentType())) {
177-
System.err.println(e.getResponse().parseAsString());
178-
} else {
179-
GoogleJsonError errorResponse = GoogleJsonError.parse(jsonFactory, e.getResponse());
180-
System.err.println(errorResponse.code + " Error: " + errorResponse.message);
181-
for (ErrorInfo error : errorResponse.errors) {
182-
System.err.println(jsonFactory.toString(error));
183-
}
184-
}
180+
// message doesn't include parsed response
181+
System.err.println(e.getMessage());
182+
System.err.println(e.getResponse().parseAsString());
185183
}
186184
} catch (Throwable t) {
187185
t.printStackTrace();

calendar-android-sample/.classpath

+26-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="src" path="src/main/java"/>
4-
<classpathentry kind="src" path="gen"/>
3+
<classpathentry kind="src" path="src/main/java" />
4+
<classpathentry kind="output" path="bin/classes" />
5+
<classpathentry kind="src" path="gen" />
56
<classpathentry kind="con"
67
path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK" />
78
<classpathentry kind="var"
8-
path="M2_REPO/com/google/http-client/google-http-client/1.5.0-beta/google-http-client-1.5.0-beta.jar"
9-
sourcepath="M2_REPO/com/google/http-client/google-http-client/1.5.0-beta/google-http-client-1.5.0-beta-sources.jar" />
9+
path="M2_REPO/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar" />
1010
<classpathentry kind="var"
11-
path="M2_REPO/com/google/http-client/google-http-client-extensions-android2/1.5.0-beta/google-http-client-extensions-android2-1.5.0-beta.jar"
12-
sourcepath="M2_REPO/com/google/http-client/google-http-client-extensions-android2/1.5.0-beta/google-http-client-extensions-android2-1.5.0-beta-sources.jar" />
11+
path="M2_REPO/com/google/http-client/google-http-client/1.6.0-beta-SNAPSHOT/google-http-client-1.6.0-beta-SNAPSHOT.jar"
12+
sourcepath="M2_REPO/com/google/http-client/google-http-client/1.6.0-beta-SNAPSHOT/google-http-client-1.6.0-beta-SNAPSHOT-sources.jar" />
1313
<classpathentry kind="var"
14-
path="M2_REPO/com/google/api-client/google-api-client/1.5.0-beta/google-api-client-1.5.0-beta.jar"
15-
sourcepath="M2_REPO/com/google/api-client/google-api-client/1.5.0-beta/google-api-client-1.5.0-beta-sources.jar" />
14+
path="M2_REPO/com/google/http-client/google-http-client-extensions-android2/1.6.0-beta-SNAPSHOT/google-http-client-extensions-android2-1.6.0-beta-SNAPSHOT.jar"
15+
sourcepath="M2_REPO/com/google/http-client/google-http-client-extensions-android2/1.6.0-beta-SNAPSHOT/google-http-client-extensions-android2-1.6.0-beta-SNAPSHOT-sources.jar" />
1616
<classpathentry kind="var"
17-
path="M2_REPO/com/google/api-client/google-api-client-extensions-android2/1.5.0-beta/google-api-client-extensions-android2-1.5.0-beta.jar"
18-
sourcepath="M2_REPO/com/google/api-client/google-api-client-extensions-android2/1.5.0-beta/google-api-client-extensions-android2-1.5.0-beta-sources.jar" />
17+
path="M2_REPO/com/google/code/gson/gson/1.7.1/gson-1.7.1.jar" sourcepath="M2_REPO/com/google/code/gson/gson/1.7.1/gson-1.7.1-sources.jar" />
18+
<classpathentry kind="var"
19+
path="M2_REPO/com/google/oauth-client/google-oauth-client/1.6.0-beta-SNAPSHOT/google-oauth-client-1.6.0-beta-SNAPSHOT.jar"
20+
sourcepath="M2_REPO/com/google/oauth-client/google-oauth-client/1.6.0-beta-SNAPSHOT/google-oauth-client-1.6.0-beta-SNAPSHOT-sources.jar" />
21+
<classpathentry kind="var"
22+
path="M2_REPO/com/google/api-client/google-api-client/1.6.0-beta-SNAPSHOT/google-api-client-1.6.0-beta-SNAPSHOT.jar"
23+
sourcepath="M2_REPO/com/google/api-client/google-api-client/1.6.0-beta-SNAPSHOT/google-api-client-1.6.0-beta-SNAPSHOT-sources.jar" />
24+
<classpathentry kind="var"
25+
path="M2_REPO/com/google/api-client/google-api-client-extensions-android2/1.6.0-beta-SNAPSHOT/google-api-client-extensions-android2-1.6.0-beta-SNAPSHOT.jar"
26+
sourcepath="M2_REPO/com/google/api-client/google-api-client-extensions-android2/1.6.0-beta-SNAPSHOT/google-api-client-extensions-android2-1.6.0-beta-SNAPSHOT-sources.jar" />
1927
<classpathentry kind="var"
2028
path="M2_REPO/com/google/apis-samples/shared-sample-calendar/v2-1.0.0/shared-sample-calendar-v2-1.0.0.jar"
2129
sourcepath="M2_REPO/com/google/apis-samples/shared-sample-calendar/v2-1.0.0/shared-sample-calendar-v2-1.0.0-sources.jar" />
2230
<classpathentry kind="var"
2331
path="M2_REPO/com/google/apis-samples/shared-sample-gdata/1.0.0/shared-sample-gdata-1.0.0.jar"
2432
sourcepath="M2_REPO/com/google/apis-samples/shared-sample-gdata/1.0.0/shared-sample-gdata-1.0.0-sources.jar" />
25-
<classpathentry kind="var" path="M2_REPO/com/google/guava/guava/r09/guava-r09.jar"/>
26-
<classpathentry kind="output" path="target/classes"/>
33+
<classpathentry kind="var"
34+
path="M2_REPO/com/google/protobuf/protobuf-java/2.2.0/protobuf-java-2.2.0.jar"
35+
sourcepath="M2_REPO/com/google/protobuf/protobuf-java/2.2.0/protobuf-java-2.2.0-sources.jar" />
36+
<classpathentry kind="var"
37+
path="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.1/jackson-core-asl-1.9.1.jar"
38+
sourcepath="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.1/jackson-core-asl-1.9.1-sources.jar" />
39+
<classpathentry kind="var"
40+
path="M2_REPO/com/google/guava/guava/r09/guava-r09.jar" />
2741
</classpath>

calendar-android-sample/.project

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
<projects>
66
</projects>
77
<buildSpec>
8-
<buildCommand>
9-
<name>org.maven.ide.eclipse.maven2Builder</name>
10-
<arguments>
11-
</arguments>
12-
</buildCommand>
138
<buildCommand>
149
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
1510
<arguments>
@@ -34,6 +29,6 @@
3429
<natures>
3530
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
3631
<nature>org.eclipse.jdt.core.javanature</nature>
37-
<nature>org.maven.ide.eclipse.maven2Nature</nature>
32+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
3833
</natures>
3934
</projectDescription>

0 commit comments

Comments
 (0)