Optional int parameter 'roomId' is present but cannot be translated into a null value due to being declared as a primitive type.
时间: 2024-02-27 07:54:57 浏览: 398
This error message means that you have a method or constructor that takes an `int` parameter for `roomId`, and you are trying to pass an optional value into it. However, because `int` is a primitive type, it cannot be null, so the optional value cannot be translated into a null value.
To fix this error, you can change the parameter type from `int` to `Integer`. This will allow you to pass in an optional value without causing a null value error.
For example, if you had a method like this:
```java
public void doSomething(int roomId) {
// ...
}
```
You can change it to this:
```java
public void doSomething(Integer roomId) {
// ...
}
```
This will allow you to pass in an optional value for `roomId`, and handle the null value as needed within the method.
阅读全文