Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#20363 closed enhancement (fixed)

[PATCH] Extract necessary method for QuadBuckets into separate interface

Reported by: taylor.smock Owned by: taylor.smock
Priority: normal Milestone: 21.02
Component: Core Version:
Keywords: Cc:

Description (last modified by taylor.smock)

Use cases:

  • Various layer users can implement IQuadBucketType on their respective methods
    • Notes (so that the Bounds passed into paint can be used) -- not really a speed up here, but depends upon note coverage
    • Geotagged images (Mapillary/Streetside/OKV, for example)

Notes: I don't think I missed any files for this, but my JOSM work directory is kind of messy right now (see #16567 16567.initial_extensions.3.patch)

Attachments (1)

20363.patch (8.5 KB ) - added by taylor.smock 3 years ago.
Initial implementation

Download all attachments as: .zip

Change History (14)

comment:1 by taylor.smock, 3 years ago

Description: modified (diff)

comment:2 by Don-vip, 3 years ago

It doesn't compile:

compile:
    [javac] Compiling 44 source files to C:\SVN\josm\core\build
    [javac] C:\SVN\josm\core\src\org\openstreetmap\josm\gui\preferences\PreferenceTabbedPane.java:59: warning: [deprecation] MapPreference in org.openstreetmap.josm.gui.preferences.map has been deprecated
    [javac] import org.openstreetmap.josm.gui.preferences.map.MapPreference;
    [javac]                                                  ^
    [javac] C:\SVN\josm\core\src\org\openstreetmap\josm\data\ImageData.java:46: error: type argument ImageEntry is not within bounds of type-variable T
    [javac]     QuadBuckets<ImageEntry> geoImages = new QuadBuckets<>();
    [javac]                 ^
    [javac]   where T is a type-variable:
    [javac]     T extends IQuadBucketType declared in class QuadBuckets
    [javac] C:\SVN\josm\core\src\org\openstreetmap\josm\data\ImageData.java:46: error: incompatible types: cannot infer type arguments for QuadBuckets<>
    [javac]     QuadBuckets<ImageEntry> geoImages = new QuadBuckets<>();
    [javac]                                                        ^
    [javac]     reason: inference variable T has incompatible bounds
    [javac]       equality constraints: ImageEntry
    [javac]       upper bounds: IQuadBucketType
    [javac]   where T is a type-variable:
    [javac]     T extends IQuadBucketType declared in class QuadBuckets
    [javac] 2 errors
    [javac] 1 warning

comment:3 by Don-vip, 3 years ago

Owner: changed from team to taylor.smock
Status: newneedinfo

in reply to:  2 comment:4 by taylor.smock, 3 years ago

Replying to Don-vip:
I was intending to apply the patch to a different tree before someone else looked at it, just to check and make certain that I wasn't missing anything, but you looked at it before I did. I need to find a better way to keep patchsets separate. I also should have marked it as WIP, since I thought I had probably missed a file.

Anyway, I'll upload a new patch.

by taylor.smock, 3 years ago

Attachment: 20363.patch added

Initial implementation

comment:5 by Don-vip, 3 years ago

Resolution: fixed
Status: needinfoclosed

In 17459/josm:

fix #20363 - Extract necessary method for QuadBuckets into separate interface (patch by taylor.smock, modified)

comment:6 by taylor.smock, 3 years ago

Thanks. I'll get an updated version of the Mapillary plugin out sometime today (I am using QuadBuckets there already, so I need to recompile for this patch).

comment:7 by Don-vip, 3 years ago

In 17460/josm:

see #20363 - fix NPE

comment:8 by Stereo, 3 years ago

Resolution: fixed
Status: closedreopened

It crashes on startup for me?

java.lang.NoSuchMethodError: 'boolean org.openstreetmap.josm.data.osm.QuadBuckets.add(org.openstreetmap.josm.data.osm.IPrimitive)'
	at org.openstreetmap.josm.data.osm.QuadBucketPrimitiveStore.addPrimitive(QuadBucketPrimitiveStore.java:107)
	at org.openstreetmap.josm.data.osm.DataSet.lambda$addPrimitive$5(DataSet.java:504)
	at org.openstreetmap.josm.data.osm.DataSet.update(DataSet.java:960)
	at org.openstreetmap.josm.data.osm.DataSet.addPrimitive(DataSet.java:495)
	at org.openstreetmap.josm.io.AbstractReader.processNodesAfterParsing(AbstractReader.java:141)
	at org.openstreetmap.josm.io.AbstractReader.prepareDataSet(AbstractReader.java:265)
	at org.openstreetmap.josm.io.AbstractReader.doParseDataSet(AbstractReader.java:310)
	at org.openstreetmap.josm.io.OsmReader.doParseDataSet(OsmReader.java:488)
	at org.openstreetmap.josm.io.OsmReader.parseDataSet(OsmReader.java:538)
	at org.openstreetmap.josm.io.OsmReader.parseDataSet(OsmReader.java:521)
	at org.openstreetmap.josm.tools.Territories.initializeInternalData(Territories.java:137)
	at org.openstreetmap.josm.tools.Territories.initialize(Territories.java:123)
	at org.openstreetmap.josm.gui.MainInitialization.lambda$beforeInitializationTasks$4(MainInitialization.java:85)
	at org.openstreetmap.josm.spi.lifecycle.InitializationTask.call(InitializationTask.java:33)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.runInitializationTasks(Lifecycle.java:99)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.initialize(Lifecycle.java:71)
	at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:920)
	at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:278)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:715)

in reply to:  8 comment:9 by taylor.smock, 3 years ago

Replying to Stereo:
Question: Are you running a release from the JOSM website or a locally built version? If the latter, please run ant clean dist. Otherwise, which version are you running from the JOSM website? josm-latest.jar I would presume.

comment:10 by Stereo, 3 years ago

Resolution: fixed
Status: reopenedclosed

Indeed, ant dist was all it took. Thank you!

comment:11 by Don-vip, 3 years ago

Possible regression: #20598

comment:12 by Don-vip, 3 years ago

In 17565/josm:

fix #20598 - see #20363 - Use getPos instead of getExifCoor (patch by taylor.smock)

comment:13 by Don-vip, 3 years ago

Milestone: 21.02

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain taylor.smock.
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.