Ticket #5231 (new defect)

Opened 2 months ago

Last modified 2 months ago

Exception on update data.

Reported by: anonymous Owned by: team
Priority: major Component: Core
Version: latest Keywords:
Cc:

Description

Using any of the update data options throws an exception when the list isEmpty() function is used on a Storage<T> object. It appears to need this instead:

diff --git a/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java b/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
index ea7de03..8f7ec44 100644
--- a/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
+++ b/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
@@ -138,7 +138,7 @@ public class DownloadOsmTask extends AbstractDownloadTask {
                 return;
             if (dataSet == null)
                 return; // user canceled download or error occurred
-            if (dataSet.allPrimitives().isEmpty()) {
+            if (dataSet.allPrimitives().size() == 0) {
                 rememberErrorMessage(tr("No data found in this area."));
                 // need to synthesize a download bounds lest the visual indication of downloaded
                 // area doesn't work

Attachments

Change History

Changed 2 months ago by anonymous

Actually, this appears to be because of a shadowed variable/method in DataSet.

Changed 2 months ago by bastiK

Looking at the code, I don't see why this should be the case. Is there an easy way to trigger that exception and can you provide stack trace?

Add/Change #5231 (Exception on update data.)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from team. Next status will be 'new'
Next status will be 'needinfo'The owner will change to anonymous
as duplicate The resolution will be set to duplicate. Next status will be 'closed'The specified ticket will be cross-referenced with this ticket
The owner will change from team to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.