cheptsov / AdvancedExpressionFolding

https://plugins.jetbrains.com/plugin/9320?pr=idea
140 stars 30 forks source link

[critical bug fix] Get rid off toJavaFormatString (closes #146) #148

Closed stokito closed 3 years ago

stokito commented 3 years ago

The sun.misc.FloatingDecimal.toJavaFormatString is not available anymore in JDK11. Since IntelliJ switched to 11 then users start getting an exception java.lang.NoClassDefFoundError: sun/misc/FloatingDecimal in runtime.

Double.toString() and Float.toString() internally calls the toJavaFormatString() so we can safely just call number.toString() even without any number.floatValue() or number.doubleValue().

stokito commented 3 years ago

Hi @cheptsov this fix is very important because now the plugin makes impossible to open a file in editor with new intellij. Since idea itself migrated to JDK 11 you can recompile plugin for 11 and this will give some performance boost. You can also try to compile with latest Idea but it will fail on FoldingTest because there was some changes in Idea API

cheptsov commented 3 years ago

This has been fixed by https://github.com/cheptsov/AdvancedExpressionFolding/commit/18285b31380cf9db1b411b4797b3d7d4eb2ce74d