Modify

Opened 3 years ago

Closed 3 years ago

#12900 closed defect (fixed)

Conflicts in pasted tags cannot be resolved, cannot be resolved to "none"

Reported by: Allroads Owned by: team
Priority: normal Milestone: 16.07
Component: Core Version: latest
Keywords: regression Cc: michael2402

Description (last modified by Allroads)

Hello,

When I use the icon for CTRL SHIFT V,

  1. I have often the problem that I get not the expected tags from the clipboard.

It sometimes I set ford to it, and the next road I want to give with icon only highway tag, but then there is ford=yes from the clipboard, I know what I copied to the clipboard and,is there a learning process to give me other presumed tags in the clipboard. Looks like it overruled may copy to clipboard, what I expect.(two pics)

  1. Popup Conflicts in pasted tags.

What annoying is that I can not get none for a choice, this ford is sometimes set also but is do not need it, form a clipboard.
But when I choose the right tags. The apply button does not light up. (BUG)
When I choose to go not further and click the red cross (upper right), delete popup, expecting no actions is taken but all tags are set. (two pics).

Josm 10301
Java 1 80_91

Attachments (5)

clipboard.jpg (163.9 KB) - added by Allroads 3 years ago.
clipboard 2.jpg (76.7 KB) - added by Allroads 3 years ago.
conflict pasted tag 2.jpg (77.3 KB) - added by Allroads 3 years ago.
conflict pasted tag.jpg (76.8 KB) - added by Allroads 3 years ago.
patch-fix-12900.patch (45.6 KB) - added by michael2402 3 years ago.

Download all attachments as: .zip

Change History (16)

Changed 3 years ago by Allroads

Attachment: clipboard.jpg added

Changed 3 years ago by Allroads

Attachment: clipboard 2.jpg added

Changed 3 years ago by Allroads

Attachment: conflict pasted tag 2.jpg added

Changed 3 years ago by Allroads

Attachment: conflict pasted tag.jpg added

comment:1 Changed 3 years ago by Allroads

Description: modified (diff)

comment:2 Changed 3 years ago by michael2402

Component: Core bugreportCore

comment:3 Changed 3 years ago by Klumbumbus

  1. I don't really understand the problem. When you click on "copy all tags" then it copies the tags into the clipboard and removes the content which was there before. This is how clipboard works everywhere.
  1. I can confirm the two bugs.

comment:4 in reply to:  3 Changed 3 years ago by Allroads

Replying to Klumbumbus:

  1. I don't really understand the problem. When you click on "copy all tags" then it copies the tags into the clipboard and removes the content which was there before. This is how clipboard works everywhere.
  1. I can confirm the two bugs.

1.

I use Ctrl-C (to copy ways to other layer) or I use like in the pic "Copy all Keys/Values".

Clipboard is set, example: mostly I use last times on clipboard highway=track source=bing

Now I am drawing ways further, use button +++ (pic) to do Ctrl-Shift-V.To set tags on way. All goes well.
Then I cut a way to set a part for a ford=yes use a preset button.
Or a new way, attached to highway=unclassified / tertairy, then suddenly sometimes the clipboard is changed, and I did not use Ctrl_C or "Copy all Keys/Values". In my mind I know the key value. It is annoying that it is changed.

That's why I thought is there al self learning JOSM, josm set the clipboard by itself. Set to obvious keys/values. Last used or so. Attached to new road, so must also be the like the to attached road.
Or the unclassified is set or a ford is in the tags, this ford is really annoying, because it is not used often.
I do not like that.

Maybe this 1. is related to 2.

This is since the last two Josm updates, I believe, since bugs 2. occurred

Is there a difference/relation in use Ctrl-C or Copy All keys/Values and clipboard?

Last edited 3 years ago by Allroads (previous) (diff)

comment:5 Changed 3 years ago by simon04

To reproduce 2:

  1. Create node with name=foo
  2. Create node with name=bar
  3. Select both nodes, Ctrl+C
  4. Create new node, select it, Ctrl+Shift+V
Last edited 3 years ago by simon04 (previous) (diff)

comment:6 Changed 3 years ago by simon04

Keywords: regression added
Summary: Conflicts in pasted tagsConflicts in pasted tags cannot be resolved, cannot be resolved to "none"

Bug "Cannot resolve conflict" not present in r7641, but present in r7642+r8800+r10000+r10526

Last edited 3 years ago by simon04 (previous) (diff)

comment:7 Changed 3 years ago by simon04

Milestone: 16.07

comment:8 Changed 3 years ago by simon04

Cc: michael2402 added

With JOSM latest r10710 no conflict is shown at all! Likely a regression of r10604. The class org.openstreetmap.josm.actions.PasteTagsAction.TagPaster is no longer used at all.

comment:9 Changed 3 years ago by michael2402

We should unify the key/value counting while doing that. There are several places that need to handle such tag conflicts at the moment.

Places I found so far:
PropertiesDialog#selectionChanged, starting at final Map<String, Integer> keyCount = new HashMap<>();
TagCollection, e.g. getNumTagsFor
MultiValueResolutionDecision uses TagCollection internally
PasteTagsConflictResolverDialog#populate uses TagCollection to mostlycount keys.
TagModel same as TagCollection for a single key. We can replace getValueCount with getNumTagsFor, getValue with getJoinedValues
TagEditHelper same as TagCollection with added counts.

The HashSet of TagCollection is using a HashMap<Tag, Boolean> internally. It would be no big deal to change it to a HashMap<Tag, Integer>. That way we could count the number of tags that were inserted without breaking backward compatibility. I'll write a patch for it.

comment:10 Changed 3 years ago by michael2402

I added a patch that addresses the issue. The patch requires #13271 (if that patch is not applied, the dialog will not be shown. An exception is printed to the console and the tags are applied without resolving the conflicts).

It displays a merge conflict in all cases (multiple primitives, multiple values) I tested. I hope I did not miss any special cases.

Changed 3 years ago by michael2402

Attachment: patch-fix-12900.patch added

comment:11 Changed 3 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 10737/josm:

fix #12900 - Conflicts in pasted tags cannot be resolved, cannot be resolved to "none" (patch by michael2402) - gsoc-core

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.