Modify

Opened 3 years ago

Closed 6 months ago

#20849 closed defect (fixed)

[PATCH] WARNING: row index is bigger than sorter's row count. Most likely this is a wrong sorter usage.

Reported by: skyper Owned by: team
Priority: normal Milestone: 22.12
Component: Core Version: latest
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. Start JOSM with fresh/empty preferences

What is the expected result?

No warnings on startup

What happens instead?

In the console: WARNING: row index is bigger than sorter's row count. Most likely this is a wrong sorter usage.

Please provide any additional information below. Attach a screenshot if possible.

I noticed this for some time, now, and thought it is a problem of my external files but I was wrong.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-05-04 21:01:14 +0200 (Tue, 04 May 2021)
Revision:17860
Build-Date:2021-05-05 01:30:58
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (17860 en) Linux Debian GNU/Linux 10 (buster)
Java version: 11.0.11+9-post-Debian-1deb10u1, Debian, OpenJDK 64-Bit Server VM

Attachments (0)

Change History (8)

comment:1 by skyper, 2 years ago

I can track it down to be one of several problems with tagging presets preference:

  1. Start JOSM without preferences
  2. Open Preference Dialog
  3. Switch to Tagging Presets Preferences

In the console I notice warnings and errors:

2021-12-13 16:59:59.264 WARNING: Could not create font Arial Narrow
2021-12-13 16:59:59.276 WARNING: Could not create font Arial Narrow
2021-12-13 16:59:59.349 SEVERE: Failed to locate image '[[Image(pond.png)]]'
2021-12-13 16:59:59.361 SEVERE: Failed to locate image '[[Image(oil-palm.png)]]'
WARNING: row index is bigger than sorter's row count. Most likely this is a wrong sorter usage.
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-11-01 23:05:46 +0100 (Mon, 01 Nov 2021)
Revision:18303
Build-Date:2021-11-01 22:25:18
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18303 en) Linux Debian GNU/Linux 11 (bullseye)
Memory Usage: 197 MB / 256 MB (52 MB allocated, but free)
Java version: 17.0.1+12-Debian-1deb11u2, Debian, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
libcommons-compress-java: libcommons-compress-java:all-1.20-1
libcommons-logging-java: libcommons-logging-java:all-1.2-2
fonts-noto: fonts-noto:all-20201225-1
VM arguments: [-Djosm.home=<josm.pref>]

Last errors/warnings:
- 00101.590 E: Failed to locate image '[[Image(pond.png)]]'
- 00101.602 E: Failed to locate image '[[Image(oil-palm.png)]]'

comment:2 by taylor.smock, 16 months ago

Summary: WARNING: row index is bigger than sorter's row count. Most likely this is a wrong sorter usage.[PATCH] WARNING: row index is bigger than sorter's row count. Most likely this is a wrong sorter usage.

It looks like this is due to order in which the table listeners get notified. It looks like SonarLint doesn't like the patch (java:S3047), so I don't think we will apply this patch unless we really need to, or SonarLint is fixed.

Also, the fix is a bit of a hack -- the order in which TableModelListeners are notified is not specified in documentation, so it could change at any time. :(

I'll do a bit more debugging tomorrow to see if there is a "better" way to do it.

Last edited 16 months ago by taylor.smock (previous) (diff)

comment:3 by taylor.smock, 16 months ago

Resolution: fixed
Status: newclosed

In 18603/josm:

Fix #20849: WARNING: row index is bigger than sorter's row count. Most likely this is a wrong sorter usage

This is caused by the ordering of the TableModelListeners for
availableSourcesModel. While not documented, Java fires the listeners in reverse
order, so we want to remove the listener that updates the sorter and add the
column width adjustment listener, and then re-add the listener that updates the
sorter.

The alternative to adding/removing the listener for the sorter is to use an
AtomicReference for tblAvailableSources and add the adjustColumnWidth listener
before creating the tblAvailableSources.

comment:4 by taylor.smock, 16 months ago

Milestone: 22.11

comment:5 by taylor.smock, 16 months ago

Milestone: 22.1122.12

Milestone renamed

comment:6 by anonymous, 6 months ago

Resolution: fixed
Status: closedreopened

In Ubuntu 23.04 I am using

		DefaultTableModel mod1;
		mod1 = (DefaultTableModel) jTable1.getModel();
		mod1.setNumRows(0);
......
			mod1.addRow(row1);

The row1 is a plain vanilla object which I have been using for years.
All its values are legal and reasonable.
Only now did I notice this warning message.

comment:7 by ilan.tal@…, 6 months ago

I see my message got posted as anonymous

comment:8 by taylor.smock, 6 months ago

Resolution: fixed
Status: reopenedclosed

@ilan.tal: I don't know why you reopened this ticket. If you have a bug to report about JOSM or JOSM plugins, please use the report bug functionality. This gives us information on:

  • The java version you are using
  • The JOSM version you are using
  • The plugin versions you are using

If you additionally use the Report bug functionality when the report bug window appears spontaneously, we will also get a stack trace.


Thanks for your report, however your ticket is incomplete and therefore not helpful in its current form.

Please add all needed information according to this list:

  • The required parts of the Status Report from your JOSM.
  • Describe what behaviour you expected.
  • Describe what did happen instead.
  • Describe if and how the issue is reproducible.
  • Add any relevant information like error messages or screenshots.

To ensure that all technical relevant information is contained, create new tickets by clicking in JOSMs Main Menu on Helpsource:trunk/resources/images/bug.svg Report Bug.



With all that said, it sounds like you are working on a different Java project. This is not a generic Java help or troubleshooting forum. If that is the case, I would recommend filing a ticket against the JDK, see https://bugreport.java.com/bugreport/ .

If you want to see the changes I made to "fix" the problem in JOSM, see r18603.

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.