I have this seemingly innocent looking code.
String str = (String)convert.fromBytes(bytes);
我收到了来自checkstyle的错误提示:'cast' is not followed by whitespace.
所以我在(String)
后面加了一个空格,然后又出现了一个新的错误提示:')' is followed by whitespace.
...我尝试了很多配置选项(发现其中许多都可能涉及此问题),一段时间后我搞不清楚我改了什么(哈哈哈),但我设法消除了类型转换后的空格警告。然而,我更希望在类型转换后没有空格。那么,有谁能告诉我应该设置什么才能在没有空格的情况下消除这个警告呢?
编辑:以下是我最初写的内容:
String str = (String)convert.fromBytes(bytes);
然后我得到:
'cast'之后没有空格。
因此我改成了:
String str = (String) convert.fromBytes(bytes);
然后我得到了
')'后面跟着空格。
我的目的是在没有任何警告的情况下编写以下内容。
String str = (String)convert.fromBytes(bytes);
我应该设置什么选项?
附言:我在Eclipse中使用CheckStyle插件。
谢谢