Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API.scala #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update API.scala #81

wants to merge 1 commit into from

Conversation

datagic
Copy link

@datagic datagic commented Dec 16, 2023

您好,
原代码中,matricInfo.getOrElse("totalVirtualCores","")返回的为Integer类型,下一步使用.asInstanceOf[Double]是不安全的,因为 Integer 和 Double 之间没有直接的继承关系,会报错:java.lang.Integer cannot be cast to java.lang.Double

修改代码将原返回值转换为字符串,之后使用toDouble方法进行转换。

另,去掉部分scala代码中结尾的不必要分号

您好,
原代码中,matricInfo.getOrElse("totalVirtualCores","")返回的为Integer类型,下一步使用.asInstanceOf[Double]是不安全的,因为 Integer 和 Double 之间没有直接的继承关系,会报错:java.lang.Integer cannot be cast to java.lang.Double

修改代码将原返回值转换为字符串,之后使用toDouble方法进行转换。

另,去掉部分scala代码中结尾的不必要分号
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant