Modify

Opened 3 years ago

Closed 3 years ago

#21521 closed defect (fixed)

IndexOutOfBoundsException in `ImageData.getSelectedImage`

Reported by: anonymous Owned by: team
Priority: normal Milestone: 22.03
Component: Core image mapping Version:
Keywords: template_report, regression Cc:

Description

What steps will reproduce the problem?

What is the expected result?

What happens instead?

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 sk) Windows 10 64-Bit
OS Build number: Windows 10 Pro 2009 (19043)
Memory Usage: 482 MB / 2012 MB (266 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)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1250
System property sun.jnu.encoding: Cp1250
Locale info: sk_SK
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\JOSM.exe]

Plugins:
+ RovasConnector (0.1.0)
+ apache-commons (35524)
+ ejml (35458)
+ freemapkapor (57)
+ geotools (35458)
+ imagery_offset_db (35640)
+ jaxb (35543)
+ jts (35458)
+ opendata (35803)
+ turnrestrictions (35640)
+ utilsplugin2 (35842)

Last errors/warnings:
- 00000.450 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00000.452 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00002.486 E: java.security.KeyStoreException: Windows-ROOT not found. Príčina: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available
- 00037.502 E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0



=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (23) of main
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source)
	at java.base/java.util.Objects.checkIndex(Unknown Source)
	at java.base/java.util.ArrayList.get(Unknown Source)
	at org.openstreetmap.josm.data.ImageData.getSelectedImage(ImageData.java:120)
	at org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer.getPhotoIdxUnderMouse(GeoImageLayer.java:572)
	at org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer.access$400(GeoImageLayer.java:73)
	at org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer$ImageMouseListener.mouseReleased(GeoImageLayer.java:212)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.desktop/java.awt.AWTEventMulticaster.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 (0)

Change History (9)

comment:1 by taylor.smock, 3 years ago

Component: CoreCore image mapping
Keywords: regression added
Summary: Error after deleting foto from layerIndexOutOfBoundsException in `ImageData.getSelectedImage`

Relevant code:

    public ImageEntry getSelectedImage() {
        int selectedImageIndex = selectedImagesIndex.isEmpty() ? -1 : selectedImagesIndex.get(0);
        if (selectedImageIndex > -1) {
            return data.get(selectedImageIndex);
        }
        return null;
    }

I'm guessing this is probably a threading issue.

comment:2 by Don-vip, 3 years ago

Milestone: 21.11

comment:3 by Don-vip, 3 years ago

Milestone: 21.1121.12

Milestone renamed

comment:4 by Don-vip, 3 years ago

Milestone: 21.1222.01

comment:5 by stoecker, 3 years ago

Milestone: 22.0122.02

Milestone renamed

comment:6 by Don-vip, 3 years ago

Milestone: 22.0222.03

comment:7 by skyper, 3 years ago

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

comment:8 by skyper, 3 years ago

#21974 has the relevant source code lines in the status report.

comment:9 by taylor.smock, 3 years ago

Resolution: fixed
Status: newclosed

In 18421/josm:

fix #21521: IOOBE in ImageData.getSelectedImage

This is caused by not updating the selected image when an image is
removed from the image dataset. This only occurs when the remove
method is called in ImageEntry.

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.