#23505 closed defect (fixed)
incorrect number of modified ways in command, improve performance, fix memory leak
Reported by: | GerdP | Owned by: | *Martin* |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin simplifyArea | Version: | |
Keywords: | template_report | Cc: | stoecker, taylor.smock |
Description
What steps will reproduce the problem?
- Add a node to a rectangular building
- Select the building
- Press Shift+Ctrl+Y to "Simplify Area"
What is the expected result?
A command on the undo/redo stack that says something like "Simplified 1 way"
The command to remove the node should be a ChangeNodesCommand, not a ChangeCommand (see #19885)
What happens instead?
A command on the undo/redo stack that says something like "Simplified 3 ways" and contains two
Please provide any additional information below. Attach a screenshot if possible.
While working on a fix I found some more problems:
- Crash report when the selection contains incomplete ways
- Slow execution when many ways are selected
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2024-02-05 12:56:34 +0100 (Mon, 05 Feb 2024) Revision:18969 Build-Date:2024-02-06 02:30:58 URL:https://josm.openstreetmap.de/svn/trunk Identification: JOSM/1.5 (18969 en) Windows 10 64-Bit OS Build number: Windows 10 Pro 2009 (19045) Memory Usage: 644 MB / 1888 MB (221 MB allocated, but free) Java version: 17.0.8+7-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel Screen: \Display0 1920×1080 (scaling 1.00×1.00) Maximum Screen Size: 1920×1080 Best cursor sizes: 16×16→32×32, 32×32→32×32 System property file.encoding: Cp1252 System property sun.jnu.encoding: Cp1252 Locale info: en_DE Numbers with default locale: 1234567890 -> 1234567890 VM arguments: [-Djpackage.app-version=1.5.18789, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\HWConsole.exe] Dataset consistency test: No problems found Plugins: + OpeningHoursEditor (36196) + RoadSigns (36196) + SimplifyArea (36200) + apache-commons (36176) + buildings_tools (36200) + comfort0 (36200) + o5m (36126) + pbf (36176) + poly (36126) + reverter (36196) + splinex (36126) + undelete (36126) + utilsplugin2 (36200) Validator rules: + d:\java_tools\JOSM\mygeometry.mapcss + https://josm.openstreetmap.de/josmfile?page=Rules/GermanySpecific&zip=1 + c:\josm\core\resources\data\validator\geometry.mapcss Last errors/warnings: - 00000.576 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF' - 00000.578 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF' - 00000.982 E: java.security.KeyStoreException: Windows-ROOT not found. Cause: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available
Attachments (2)
Change History (10)
by , 15 months ago
Attachment: | commands.JPG added |
---|
follow-up: 2 comment:1 by , 15 months ago
Cc: | added |
---|
Probably stupid question: What's the right way to distribute a new binary for a plugin now? Do I still compile with JDK 8?
comment:2 by , 15 months ago
What's the right way to distribute a new binary for a plugin now?
For svn
plugins, still svn
. For GitHub
plugins, the GitHub release system (I've got a GH action to autorelease updates).
Do I still compile with JDK 8?
Ideally, yes. It shouldn't be a problem to compile with a newer version of Java though. I usually compile with Java 8 just to avoid any potential issues, and to reduce the differences between builds.
See java.lang.version.
EDIT: There is a 99.9999% chance of no issues if you compile with Java 21, for example. Assuming that the plugin is using build-common.xml
and hasn't overridden java.lang.version
somehow.
comment:3 by , 15 months ago
As an alternative to doing it yourself, you can wait for me to do another i18n update where I recompile all the plugins anyway.
comment:4 by , 15 months ago
OK, thanks. I still have JDK, I just have to check if mainVersion is up to date. If nobody complains I'll release the patch tomorrow.
comment:5 by , 15 months ago
Why aren't you using Way#isUsable
? I assume you have a good reason.
- ways.removeIf(w -> w.isIncomplete() || w.hasIncompleteNodes()); + ways.removeIf(w -> !w.isUsable());
screen shot showing too complex command