Modify

Opened 3 years ago

Closed 3 years ago

#21507 closed defect (fixed)

[PATCH] IAE: "offsetLimit must be after current position" at MaxLengthDocumentFilter.replace (Japanese IME)

Reported by: anonymous Owned by: team
Priority: major Milestone: 21.12
Component: Core Version: tested
Keywords: IME input Japanese upload regression Cc: marcello@…

Description

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)

Attachments (8)

Screenshot from 2021-11-10 19-22-08.png (24.5 KB ) - added by marcello@… 3 years ago.
Typing Japanese in Win10
IME_setting.png (76.5 KB ) - added by torimomo 3 years ago.
Configuration of IME when an error occurs.
IME_Input_01.png (21.0 KB ) - added by torimomo 3 years ago.
How to reproduce
IME_Input_02.png (16.1 KB ) - added by torimomo 3 years ago.
How to reproduce
IME_Input_03.png (83.5 KB ) - added by torimomo 3 years ago.
How to reproduce
IME_Input_04.png (35.5 KB ) - added by torimomo 3 years ago.
How to reproduce (normal case)
IME_Input_05.png (35.3 KB ) - added by torimomo 3 years ago.
How to reproduce (normal case)
21507.patch (805 bytes ) - added by marcello@… 3 years ago.
patch

Download all attachments as: .zip

Change History (26)

comment:1 by skyper, 3 years ago

Version: latesttested

comment:2 by Don-vip, 3 years ago

Cc: marcello@… added

Possible regression of the recent RTL/LTR changes?

comment:3 by Don-vip, 3 years ago

Keywords: upload regression added
Milestone: 21.11

comment:4 by Don-vip, 3 years ago

Summary: Error in the Upload Comment InputIAE: "offsetLimit must be after current position" at MaxLengthDocumentFilter.replace (Japanese IME)

comment:5 by Don-vip, 3 years ago

Ticket #21547 has been marked as a duplicate of this ticket.

comment:6 by Don-vip, 3 years ago

Priority: normalmajor

@marcello it seems r18221 broke JOSM for our Japanese friends, can you please take a look?

comment:7 by marcello@…, 3 years ago

I will take a look. Some easy steps to reproduce (for a non-Windows user) would be nice.

by marcello@…, 3 years ago

Typing Japanese in Win10

comment:8 by marcello@…, 3 years ago

I find I can type Japanese just fine in Win10. So I'll need exact steps to reproduce, like all IME settings, what to keys to press, maybe fonts used.

Typing Japanese in Win10

comment:9 by skyper, 3 years ago

Ticket #21598 has been marked as a duplicate of this ticket.

comment:10 by skyper, 3 years ago

Ticket #21601 has been marked as a duplicate of this ticket.

comment:11 by marcello@…, 3 years ago

Ticket #21615 has been marked as a duplicate of this ticket.

comment:12 by marcello@…, 3 years ago

Summary: IAE: "offsetLimit must be after current position" at MaxLengthDocumentFilter.replace (Japanese IME)[PATCH] IAE: "offsetLimit must be after current position" at MaxLengthDocumentFilter.replace (Japanese IME)

Since no information on how to reproduce is forthcoming, I just can guess at a patch. If this doesn't fix it, I need very detailed steps on how to reproduce (detailed enough for a non-Japanese-speaking person that does not usually use Windows).

by torimomo, 3 years ago

Attachment: IME_setting.png added

Configuration of IME when an error occurs.

by torimomo, 3 years ago

Attachment: IME_Input_01.png added

How to reproduce

by torimomo, 3 years ago

Attachment: IME_Input_02.png added

How to reproduce

by torimomo, 3 years ago

Attachment: IME_Input_03.png added

How to reproduce

by torimomo, 3 years ago

Attachment: IME_Input_04.png added

How to reproduce (normal case)

by torimomo, 3 years ago

Attachment: IME_Input_05.png added

How to reproduce (normal case)

comment:13 by torimomo, 3 years ago

Hello. I'm the reporter.
The error also occurs with Japanese input other than comments.

The following is a detailed description of how to reproduce the error.

1.Enter Japanese. In this example, "tesuto".
How to reproduce

2.Press spacebar. Select a conversion candidate.
How to reproduce

3.Type next word. Then the error will occur.
The error will occur the moment you type the next character.
How to reproduce

comment:14 by torimomo, 3 years ago

When I did the following, the error did not occur.

1.Enter Japanese.
2.Press spacebar.Select a conversion candidate.
The inputs up to this point are the same.

3.Press the Enter key to confirm the conversion.
How to reproduce (normal case)

4.Type the next word.
How to reproduce (normal case)
This way, no error will occur.

comment:15 by marcello@…, 3 years ago

I did reproduce it. The attached patch works for me. (Replaces the previous patch that was bogus).

by marcello@…, 3 years ago

Attachment: 21507.patch added

patch

comment:16 by Don-vip, 3 years ago

Milestone: 21.1121.12

Milestone renamed

in reply to:  15 comment:17 by Don-vip, 3 years ago

Replying to marcello@…:

I did reproduce it. The attached patch works for me. (Replaces the previous patch that was bogus).

Awesome, thanks a lot!

comment:18 by Don-vip, 3 years ago

Resolution: fixed
Status: newclosed

In 18334/josm:

fix #21507 - fix autocompletion error with Japanese IME (patch by marcello)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.