3030import com .google .api .core .ApiFutureCallback ;
3131import com .google .api .core .ApiFutures ;
3232import com .google .api .gax .paging .AsyncPage ;
33+ import com .google .api .gax .paging .Page ;
3334import com .google .cloud .AsyncPageImpl ;
3435import com .google .cloud .BaseService ;
3536import com .google .cloud .MonitoredResource ;
3637import com .google .cloud .MonitoredResourceDescriptor ;
37- import com .google .api .gax .paging .Page ;
3838import com .google .cloud .PageImpl ;
3939import com .google .cloud .logging .spi .v2 .LoggingRpc ;
4040import com .google .common .base .Function ;
5959import com .google .logging .v2 .ListMonitoredResourceDescriptorsResponse ;
6060import com .google .logging .v2 .ListSinksRequest ;
6161import com .google .logging .v2 .ListSinksResponse ;
62- import com .google .logging .v2 .LogName ;
63- import com .google .logging .v2 .MetricName ;
6462import com .google .logging .v2 .ProjectLogName ;
6563import com .google .logging .v2 .ProjectMetricName ;
6664import com .google .logging .v2 .ProjectName ;
6765import com .google .logging .v2 .ProjectSinkName ;
68- import com .google .logging .v2 .SinkName ;
6966import com .google .logging .v2 .UpdateLogMetricRequest ;
7067import com .google .logging .v2 .UpdateSinkRequest ;
7168import com .google .logging .v2 .WriteLogEntriesRequest ;
@@ -597,10 +594,10 @@ private ApiFuture<Void> writeAsync(Iterable<LogEntry> logEntries, WriteOption...
597594 WRITE_RESPONSE_TO_VOID_FUNCTION );
598595 }
599596
600- private static ListLogEntriesRequest listLogEntriesRequest (LoggingOptions serviceOptions ,
601- Map <Option .OptionType , ?> options ) {
597+ static ListLogEntriesRequest listLogEntriesRequest (
598+ String projectId , Map <Option .OptionType , ?> options ) {
602599 ListLogEntriesRequest .Builder builder = ListLogEntriesRequest .newBuilder ();
603- builder .addProjectIds (serviceOptions . getProjectId () );
600+ builder .addProjectIds (projectId );
604601 Integer pageSize = PAGE_SIZE .get (options );
605602 if (pageSize != null ) {
606603 builder .setPageSize (pageSize );
@@ -622,7 +619,8 @@ private static ListLogEntriesRequest listLogEntriesRequest(LoggingOptions servic
622619
623620 private static ApiFuture <AsyncPage <LogEntry >> listLogEntriesAsync (
624621 final LoggingOptions serviceOptions , final Map <Option .OptionType , ?> options ) {
625- final ListLogEntriesRequest request = listLogEntriesRequest (serviceOptions , options );
622+ final ListLogEntriesRequest request =
623+ listLogEntriesRequest (serviceOptions .getProjectId (), options );
626624 ApiFuture <ListLogEntriesResponse > list = serviceOptions .getLoggingRpcV2 ().list (request );
627625 return transform (list , new Function <ListLogEntriesResponse , AsyncPage <LogEntry >>() {
628626 @ Override
0 commit comments