A strange error has appeared with Freeplane 1.9 preview, in a groovy class:
import javax.swing.DefaultListModel
class Candidates extends DefaultListModel<String>{
void foo(){
fireIntervalAdded( this, 0, 1 )
}
}
test = new Candidates()
test.foo()
The error is:
No signature of method: Candidates.firelntervalAdded() is applicable for argument types: (Candidates, Integer, Integer) values: [[], 0, 1]
As far as I know, the class Candidates should inherit the method firelntervalAdded from DefaultListModel which inherit it from AbstractListModel
This script raise no error with Freeplane 1.8
There is no error with Freeplane 1.9 pre18, Windows 7, java version "1.8.0251"
Java(TM) SE Runtime Environment (build 1.8.0251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
The error appear with Freeplane 1.9 pre18, MacOS, openjdk version "1.8.0242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0242-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)
I don't know if this is a Freeplane problem.
The error was reported by @jaoret about the Jumper add-on, which use this inheritance pattern. We have isolated the problem from Jumper in the attached Test.groovy file. This script should write "ok" in the status line. It works for me, but it trigger the error with the @jaroet configuration.
Additional information:
I have tried different fixes:
super.fireIntervalAdded( this, 0, 1 )
No signature of method:javax.swing.DefaultListModel.firelntervalAdded() is applicable for argument types: (Candidates, Integer, Integer) values: [[], 0, 1]
fireIntervalAdded( (DefaultListModel<String>) this, 0, 1 )
No signature of method: Candidates.firelntervalAdded() is applicable for argument types: (Candidates, Integer, Integer) values: [[], 0, 1]
The only fix I've found is:
@CompileStatic
void foo(){
fireIntervalAdded( this, 0, 1 )
}
but I'm not sure of what I'm exactly doing here, and I have the feeling this is not right that I have to write a fix.
Diff:
Attached script runs on my computer without any errors
Please try the same script on your computer without any changes.
I suspect that you might have used lower-case L instead of upper-case i in the method name in your original script.
I sent you the exact script that me and Jeroen have ran.
This script run with no error on my computer.
It triggers the error on Jeroen's mac computer.
It turned out to me a incompatibility between Groovy 3.0.8 and Java 16.
Unfortunately I need to package Java with MacOS Freeplane binaries.
I submitted a bug report https://issues.apache.org/jira/browse/GROOVY-10070 and hope that it can be resolved on Groovy side.
I am not sure if I should replace Java packaged with MacOS by earlier version, maybe I'll do.
I repackaged verison 1.9.0_22 with Java 15, it should solve the issue.
Jeroen confirmed that it works. Thank you Dimitry. This seems to be a lot of work to maintain such a multi-platform software.