You don’t need the import for java.lang. You get those classes without importing them.
You should not import *. Just import the classes you are already using. In the code you’ve posted, you are not actually using anything from java.util so don’t need that import either.
I don’t think the error is with the get but with what the get is getting.,
Are you certain that there are four elements in the result of the split?
if(buffer.size != 4) logWarn("test", "Buffer has too many or too few elements! " + buffer.size)
Are you certain that the results are all parse able numbers?
buffer.forEach[ num | logInfo("test", "\"" + num + "\"") ]
There should be no spaces or other stray characters between the " " in the logs.
The string you pass to split is a regular expression. . means any character in regular expressions. So I bet it split into zero elements because each and every character matched.
To use . or any other regular expression special character you just need to escape it.
An older discussion but I stumbled across it. Maybe the solution will help others. The dot must be masked and this solution works for me (note 2x backslash is needed with NO spaces in-between - the Blockquote in this forum will remove the second backslash automatically).
val buffer = RuleTap.state.toString.split("\ \ .")