﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
21507	"[PATCH] IAE: ""offsetLimit must be after current position"" at MaxLengthDocumentFilter.replace (Japanese IME)"	anonymous	team	"==== What steps will reproduce the problem?
1. Open Upload Dialog
2. Input the Summery comment with MS Windows IME(Japanese)
3. Add comment with IME.

==== What is the expected result?

IME Input finished.

==== What happens instead?

An error occurred when I pressed the enter key to confirm the IME conversion.

==== Please provide any additional information below. Attach a screenshot if possible.

{{{
Revision:18303
Build-Date:2021-11-01 22:53:13

Identification: JOSM/1.5 (18303 ja) Windows 10 64-Bit
OS Build number: Windows 10 Home 2009 (19043)
Memory Usage: 2200 MB / 8180 MB (1138 MB allocated, but free)
Java version: 17.0.1+12-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) \Display1 1600×1200 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1200
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: MS932
System property sun.jnu.encoding: MS932
Locale info: ja_JP
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=1.5.18303, --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:
+ apache-commons (35524)
+ ejml (35458)
+ geotools (35458)
+ jaxb (35543)
+ jts (35458)
+ opendata (35803)
+ reverter (35732)
+ tageditor (35640)
+ turnlanes-tagging (288)
+ turnrestrictions (35640)
+ undelete (35640)
+ utilsplugin2 (35842)
+ waydownloader (35640)
+ wikipedia (1.1.4)

Tagging presets:
+ https://raw.githubusercontent.com/yopaseopor/traffic_signs_preset_JOSM/master/JP.zip
+ https://raw.githubusercontent.com/maripo/OSM_tree_preset/master/presets/japan.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/Japan&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Historical_Objects&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/JaNamigSample&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/PublicTransportOneClick&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/AdvertisingPreset&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/JP-Desaster&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LessObtrusiveNodes&zip=1
- https://raw.githubusercontent.com/OpenSidewalks/OpenSidewalks-Schema/master/open_sidewalks.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&zip=1

Validator rules:
+ https://josm.openstreetmap.de/josmfile?page=Rules/OSMLint&zip=1

Last errors/warnings:
- 00000.281 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00002.375 E: java.security.KeyStoreException: Windows-ROOT not found. 原因: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available
- 00154.012 W: 削除または移動されたオブジェクト - <html>ローカルデータセット中の5 954件のオブジェクトがサーバー上で削除されているかもしれません。<br>このサーバーでそれを削除したり更新したりすると、競合が表示されることになります。<br>サーバー上のこのオブジェクトの状態をチェックするには <strong>サーバーでチェック</strong> をクリックしてください。<br>無視するには<strong>無視する</strong>をクリックしてください。</html>
- 00485.683 W: 保存されていない変更 - <html>リレーションが変更されました。<br><br>変更を保存しますか？</html>
- 00878.359 W: 保存されていない変更 - <html>リレーションが変更されました。<br><br>変更を保存しますか？</html>
- 01067.711 W: 保存されていない変更 - <html>リレーションが変更されました。<br><br>変更を保存しますか？</html>
- 02554.975 E: Handled by bug report queue: java.lang.IllegalArgumentException: offsetLimit must be after current position
- 02554.983 E: Handled by bug report queue: java.lang.IllegalArgumentException: Zero length iterator passed to TextLayout constructor.
- 02554.996 E: Handled by bug report queue: java.lang.IllegalArgumentException: Zero length iterator passed to TextLayout constructor.
- 02629.022 E: Handled by bug report queue: java.lang.IllegalArgumentException: offsetLimit must be after current position



=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (24) of main
java.lang.IllegalArgumentException: offsetLimit must be after current position
	at java.desktop/java.awt.font.LineBreakMeasurer.nextOffset(Unknown Source)
	at java.desktop/java.awt.font.LineBreakMeasurer.nextLayout(Unknown Source)
	at java.desktop/javax.swing.text.TextLayoutStrategy.sync(Unknown Source)
	at java.desktop/javax.swing.text.TextLayoutStrategy.removeUpdate(Unknown Source)
	at java.desktop/javax.swing.text.FlowView.removeUpdate(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicTextFieldUI$I18nFieldView.removeUpdate(Unknown Source)
	at java.desktop/javax.swing.text.View.forwardUpdateToView(Unknown Source)
	at java.desktop/javax.swing.text.FlowView$LogicalView.forwardUpdateToView(Unknown Source)
	at java.desktop/javax.swing.text.View.forwardUpdate(Unknown Source)
	at java.desktop/javax.swing.text.FlowView$LogicalView.forwardUpdate(Unknown Source)
	at java.desktop/javax.swing.text.View.removeUpdate(Unknown Source)
	at java.desktop/javax.swing.text.FlowView.removeUpdate(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicTextFieldUI$I18nFieldView.removeUpdate(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicTextUI$RootView.removeUpdate(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicTextUI$UpdateHandler.removeUpdate(Unknown Source)
	at java.desktop/javax.swing.text.AbstractDocument.fireRemoveUpdate(Unknown Source)
	at java.desktop/javax.swing.text.AbstractDocument.handleRemove(Unknown Source)
	at java.desktop/javax.swing.text.AbstractDocument$DefaultFilterBypass.replace(Unknown Source)
	at java.desktop/javax.swing.text.DocumentFilter.replace(Unknown Source)
	at org.openstreetmap.josm.gui.tagging.ac.MaxLengthDocumentFilter.replace(MaxLengthDocumentFilter.java:41)
	at java.desktop/javax.swing.text.AbstractDocument.replace(Unknown Source)
	at java.desktop/javax.swing.text.JTextComponent.setText(Unknown Source)
	at org.openstreetmap.josm.gui.widgets.JosmComboBox.setText(JosmComboBox.java:194)
	at org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBox.autocomplete(AutoCompComboBox.java:97)
	at org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBox.autoCompPerformed(AutoCompComboBox.java:202)
	at org.openstreetmap.josm.gui.tagging.ac.AutoCompTextField.fireAutoCompEvent(AutoCompTextField.java:238)
	at org.openstreetmap.josm.gui.tagging.ac.AutoCompTextField.autocomplete(AutoCompTextField.java:165)
	at org.openstreetmap.josm.gui.tagging.ac.AutoCompTextField.lambda$keyTyped$0(AutoCompTextField.java:265)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.WaitDispatchSupport$2.run(Unknown Source)
	at java.desktop/java.awt.WaitDispatchSupport$4.run(Unknown Source)
	at java.desktop/java.awt.WaitDispatchSupport$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.desktop/java.awt.WaitDispatchSupport.enter(Unknown Source)
	at java.desktop/java.awt.Dialog.show(Unknown Source)
	at java.desktop/java.awt.Component.show(Unknown Source)
	at java.desktop/java.awt.Component.setVisible(Unknown Source)
	at java.desktop/java.awt.Window.setVisible(Unknown Source)
	at java.desktop/java.awt.Dialog.setVisible(Unknown Source)
	at org.openstreetmap.josm.gui.io.UploadDialog.setVisible(UploadDialog.java:354)
	at org.openstreetmap.josm.actions.UploadAction.uploadData(UploadAction.java:245)
	at org.openstreetmap.josm.actions.UploadAction.actionPerformed(UploadAction.java:296)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
	at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
}}}
"	defect	closed	major	21.12	Core	tested	fixed	IME input Japanese upload regression	marcello@…
