|
53 | 53 | import java.util.regex.Matcher; |
54 | 54 | import java.util.regex.Pattern; |
55 | 55 |
|
| 56 | +@SuppressWarnings("rawtypes") |
56 | 57 | public abstract class ServiceOptions< |
57 | 58 | ServiceT extends Service, |
58 | 59 | ServiceRpcT, |
@@ -305,8 +306,8 @@ protected ServiceOptions(Class<? extends ServiceFactory<ServiceT, OptionsT>> ser |
305 | 306 | if (projectIdRequired()) { |
306 | 307 | checkArgument( |
307 | 308 | projectId != null, |
308 | | - "A project ID is required for this service but could not be determined from the builder or " |
309 | | - + "the environment. Please set a project ID using the builder."); |
| 309 | + "A project ID is required for this service but could not be determined from the builder " |
| 310 | + + "or the environment. Please set a project ID using the builder."); |
310 | 311 | } |
311 | 312 | host = firstNonNull(builder.host, defaultHost()); |
312 | 313 | httpTransportFactory = firstNonNull(builder.httpTransportFactory, |
@@ -453,13 +454,15 @@ protected static String getAppEngineProjectId() { |
453 | 454 | } |
454 | 455 | } |
455 | 456 |
|
| 457 | + @SuppressWarnings("unchecked") |
456 | 458 | public ServiceT service() { |
457 | 459 | if (service == null) { |
458 | 460 | service = serviceFactory.create((OptionsT) this); |
459 | 461 | } |
460 | 462 | return service; |
461 | 463 | } |
462 | 464 |
|
| 465 | + @SuppressWarnings("unchecked") |
463 | 466 | public ServiceRpcT rpc() { |
464 | 467 | if (rpc == null) { |
465 | 468 | rpc = serviceRpcFactory.create((OptionsT) this); |
@@ -587,6 +590,7 @@ private void readObject(ObjectInputStream input) throws IOException, ClassNotFou |
587 | 590 | authCredentials = authCredentialsState != null ? authCredentialsState.restore() : null; |
588 | 591 | } |
589 | 592 |
|
| 593 | + @SuppressWarnings("unchecked") |
590 | 594 | private static <T> T newInstance(String className) throws IOException, ClassNotFoundException { |
591 | 595 | try { |
592 | 596 | return (T) Class.forName(className).newInstance(); |
|
0 commit comments