javalang
javalang copied to clipboard
JavaSyntaxError parsing method reference
The code below is throwing a JavaSyntaxError because of the brackets in "Long[]::new", and I can't figure out why. Is it invalid Java?
public class StatementStepDefinition {
public void foobar() {
final Long[] secondaryTransactionsIds = getSecondaryTransactions().stream().toArray(Long[]::new);
}
}
It is valid JDK8 Streams API syntax. I ran into this issue too, so will see if I can submit a PR to resolve it.