Skip to content

Commit

Permalink
VendorId should be a String (#2343)
Browse files Browse the repository at this point in the history
Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com>
  • Loading branch information
markushi and marandaneto committed Nov 9, 2022
1 parent a04f788 commit bb20890
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 16 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Fix `Gpu.vendorId` should be a String ([#2343](https://github.com/getsentry/sentry-java/pull/2343))

## 6.7.0

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions sentry/api/sentry.api
Expand Up @@ -2511,7 +2511,7 @@ public final class io/sentry/protocol/Gpu : io/sentry/JsonSerializable, io/sentr
public fun getName ()Ljava/lang/String;
public fun getNpotSupport ()Ljava/lang/String;
public fun getUnknown ()Ljava/util/Map;
public fun getVendorId ()Ljava/lang/Integer;
public fun getVendorId ()Ljava/lang/String;
public fun getVendorName ()Ljava/lang/String;
public fun getVersion ()Ljava/lang/String;
public fun isMultiThreadedRendering ()Ljava/lang/Boolean;
Expand All @@ -2523,7 +2523,7 @@ public final class io/sentry/protocol/Gpu : io/sentry/JsonSerializable, io/sentr
public fun setName (Ljava/lang/String;)V
public fun setNpotSupport (Ljava/lang/String;)V
public fun setUnknown (Ljava/util/Map;)V
public fun setVendorId (Ljava/lang/Integer;)V
public fun setVendorId (Ljava/lang/String;)V
public fun setVendorName (Ljava/lang/String;)V
public fun setVersion (Ljava/lang/String;)V
}
Expand Down
8 changes: 4 additions & 4 deletions sentry/src/main/java/io/sentry/protocol/Gpu.java
Expand Up @@ -22,7 +22,7 @@ public final class Gpu implements JsonUnknown, JsonSerializable {
/** The PCI identifier of the graphics device. */
private @Nullable Integer id;
/** The PCI vendor identifier of the graphics device. */
private @Nullable Integer vendorId;
private @Nullable String vendorId;
/** The vendor name as reported by the graphics device. */
private @Nullable String vendorName;
/** The total GPU memory available in Megabytes. */
Expand Down Expand Up @@ -74,11 +74,11 @@ public void setId(Integer id) {
this.id = id;
}

public @Nullable Integer getVendorId() {
public @Nullable String getVendorId() {
return vendorId;
}

public void setVendorId(Integer vendorId) {
public void setVendorId(@Nullable String vendorId) {
this.vendorId = vendorId;
}

Expand Down Expand Up @@ -213,7 +213,7 @@ public static final class Deserializer implements JsonDeserializer<Gpu> {
gpu.id = reader.nextIntegerOrNull();
break;
case JsonKeys.VENDOR_ID:
gpu.vendorId = reader.nextIntegerOrNull();
gpu.vendorId = reader.nextStringOrNull();
break;
case JsonKeys.VENDOR_NAME:
gpu.vendorName = reader.nextStringOrNull();
Expand Down
Expand Up @@ -13,7 +13,7 @@ class GpuSerializationTest {
fun getSut() = Gpu().apply {
name = "d623a6b5-e1ab-4402-931b-c06f5a43a5ae"
id = -596576280
vendorId = 1874778041
vendorId = "1874778041"
vendorName = "d732cf76-07dc-48e2-8920-96d6bfc2439d"
memorySize = -1484004451
apiType = "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f"
Expand Down
4 changes: 2 additions & 2 deletions sentry/src/test/java/io/sentry/protocol/GpuTest.kt
Expand Up @@ -26,7 +26,7 @@ class GpuTest {
val gpu = Gpu()
gpu.name = "name"
gpu.id = 10
gpu.vendorId = 20
gpu.vendorId = "20"
gpu.vendorName = "vendor name"
gpu.memorySize = 1024
gpu.apiType = "api type"
Expand All @@ -40,7 +40,7 @@ class GpuTest {

assertEquals("name", clone.name)
assertEquals(10, clone.id)
assertEquals(20, clone.vendorId)
assertEquals("20", clone.vendorId)
assertEquals("vendor name", clone.vendorName)
assertEquals(1024, clone.memorySize)
assertEquals("api type", clone.apiType)
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/resources/json/contexts.json
Expand Up @@ -64,7 +64,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/resources/json/gpu.json
@@ -1,7 +1,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/resources/json/sentry_base_event.json
Expand Up @@ -67,7 +67,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/resources/json/sentry_event.json
Expand Up @@ -214,7 +214,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/resources/json/sentry_transaction.json
Expand Up @@ -110,7 +110,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
Expand Up @@ -110,7 +110,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
Expand Up @@ -102,7 +102,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down

0 comments on commit bb20890

Please sign in to comment.