googleapis / googleapis/google-api-java-client

Data.isNull return invalid true after proguard

Đang mở
#2,603 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
priority: p3 type: bug
Ngôn ngữ chính
Java
Star
1.5k
Fork
772
Merge trung bình
1 giờ 44 phút
Pull request đã merge (30 ngày)
1

Mô tả

#### Environment details

1. Kotlin Multiplatform Project
2. Compose Multiplatform
3. Youtube API

#### Steps to reproduce

1. Configure Youtube API
2. Create request a videos list using setMine(true)
3. Apply proguard/r8
4. Get error

#### Code example

```java
// example
```

#### Stack trace
```

Field: mine , value: true, isNull: true
Field: part, value [contentDetails], isNull: false

Generated URL: https://youtube.googleapis.com/youtube/v3/channels?part=contentDetails

Exception in thread "AWT-EventQueue-0" com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
GET https://youtube.googleapis.com/youtube/v3/channels?part=contentDetails
{
"code": 400,
"errors": [
{
"domain": "youtube.parameter",
"location": "parameters.",
"locationType": "other",
"message": "No filter selected. Expected one of: mySubscribers, forUsername, forHandle, categoryId, id, mine, managedByMe",
"reason": "missingRequiredParameter"
}
],
"message": "No filter selected. Expected one of: mySubscribers, forUsername, forHandle, categoryId, id, mine, managedByMe"
}
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:118)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:37)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$3.interceptResponse(AbstractGoogleClientRequest.java:479)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1111)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:565)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:506)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:616)
at org.malv.youtube.services.YoutubeService$getVideos$2.invokeSuspend(YoutubeService.kt:49)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:124)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:1820)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@38fc853c, Dispatchers.Main.immediate]

```

#### External references such as API reference guides

isNull method

```
public static boolean isNull(Object object) { // don't call nullOf because will throw IllegalArgumentException if cannot create instance
return object != null && object == NULL_CACHE.get(object.getClass());
}
```

#### Any additional information below

I think the problem is that, after ProGuard, Boolean object is converted to primitives, so, "true" are the same object in NULL_CACHE and it return isNull. If the value is "false" return that is not null.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.