digama0 / mmj2

mmj2 GUI Proof Assistant for the Metamath project
GNU General Public License v2.0
72 stars 24 forks source link

Move to next LTS version: Java SE 17? #62

Open mountain opened 2 years ago

mountain commented 2 years ago

Java SE 11 was released in Sept 2018, since then Java evolved a lot, see below link for details

Java SE 17 was released in Sept 2021, maybe too early to adopt? I check the code with Java SE 17, since Nashorn was removed in Java SE 15, a tiny code change is required

This may also related with issue #61 , because with a modern build system it is easy to add a dependency.

digama0 commented 2 years ago

Java 9+ broke compound undo, which is bad enough that I generally recommend downgrading in order to use mmj2. Maybe they have a better solution now, but last time I checked they removed the feature which let you undo more than one character at a time, which makes the text view pretty painful to use.

https://github.com/digama0/mmj2/blob/8f49fb2c93531c5c75fcb65886837c8d0617c033/src/mmj/pa/CompoundUndoManager.java#L128-L132

(Note: The Netbeans bugzilla appears to be dead; the relevant archive link is https://bz.apache.org/netbeans/show_bug.cgi?id=270142 .)

mountain commented 2 years ago

Thanks for the feedback, let me check this.

mountain commented 2 years ago

@digama0 I check with JDK 17, compound undo works, but with one extra line break?

JDK settings

image

Before editing, see the caret position

image

Add some characters

image

Invoke CTRL-Z

image

I do see compound undo worked, but with an extra line break.

mountain commented 2 years ago

If this issue was solved, we may switch develop environment to latest JDK but stick release version of the jar to JDK 11.

But let me check above on JDK 11....

emm, it also works. Is my test not correct?

mountain commented 2 years ago

@digama0 I had checked with JDK 11 on more complex cases, the undo works.

Could you double check this, or give the test details to reproduce the bug? If I have the details on how to reproduce, I can investigate the problem.

Mingli

mountain commented 2 years ago

OK, I just found this

Giving clue on how to reproduce, let me check hitting CTRL-U and CTRL-R

Check the JDK version

image

The params

LoadFile,/Users/mingli/Metamath/set.mm/set.mm
VerifyProof,*
Parse,*
ProofAsstUnifySearchExclude,biigb,xxxid,dummylink
ProofAsstProofFolder,/Users/mingli/Metamath/work
TheoremLoaderMMTFolder,/Users/mingli/Metamath/work
RunProofAsstGUI

Test new Proof

PA Window first appeared

image

click menu item New Proof

image

input a1i and then Enter, the first try was succeeded.

image

Test Unification and Reformat

Start again

image

input ax-mp

image

Hit CTRL-U

image

Hit CTRL-R

image

Are the above correct?