Modify

Opened 4 years ago

Closed 4 years ago

#21080 closed defect (fixed)

Mapillary plugin does not build anymore with JDK11

Reported by: Don-vip Owned by: taylor.smock
Priority: blocker Milestone:
Component: Plugin mapillary Version:
Keywords: java11 Cc:

Description

Plugins job fails to build in JDK11 when compiling Mapillary plugin:

https://josm.openstreetmap.de/jenkins/job/JOSM-Plugins/jdk=JDK11/2043/console

compile:
     [echo] compiling sources for /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/dist/Mapillary.jar ...
    [javac] Compiling 151 source files to /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/build
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/image/MapillaryAbstractImage.java:299: warning: [deprecation] setExifTime(Date) in GpxImageEntry has been deprecated
    [javac]     this.setExifTime(new Date(capturedAt));
    [javac]         ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/AdditionalInstructions.java:55: error: lowerIndex has private access in IWaySegment
    [javac]       nodes.add(nearestSegment.lowerIndex + 1, (Node) primitive);
    [javac]                               ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/image/MapillaryImportedImage.java:80: warning: [deprecation] getGpsTime() in GpxImageEntry has been deprecated
    [javac]     final long time = geoImage.hasGpsTime() ? geoImage.getGpsTime().getTime()
    [javac]                                                       ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/image/MapillaryImportedImage.java:81: warning: [deprecation] getExifTime() in GpxImageEntry has been deprecated
    [javac]       : geoImage.hasExifTime() ? geoImage.getExifTime().getTime() : System.currentTimeMillis();
    [javac]                                          ^
    [javac] 1 error
    [javac] 3 warnings

BUILD FAILED
/var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/build.xml:54: The following error occurred while executing this line:
/var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/build.xml:29: The following error occurred while executing this line:
/var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/build-common.xml:122: Compile failed; see the compiler error output for details.

It broke between 16th and 18th May. Still works with JDK8.

Attachments (0)

Change History (16)

comment:1 by taylor.smock, 4 years ago

var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/AdditionalInstructions.java:55: error: lowerIndex has private access in IWaySegment
    [javac]       nodes.add(nearestSegment.lowerIndex + 1, (Node) primitive);

I haven't merged the changes that fix this into Mapillary master yet -- I need to fix some tests that broke due to the v3 to v4 transition. Right now, IIRC, most of the failing tests have to do with oauth. I've got oauth working, but I'm waiting to see if Mapillary supports some form of oauth that does not require a secret key.

I'm actually surprised it is working with jdk8, TBH.

EDIT: See r17896 for the breaking change, and 6009a855820f261247b73df2cbf69f7e53d4215d for the fix in the plugin.

Last edited 4 years ago by taylor.smock (previous) (diff)

comment:2 by taylor.smock, 4 years ago

Resolution: fixed
Status: newclosed

I've started the merge pipeline for the branch with the fix.

See https://gitlab.com/smocktaylor/Mapillary/-/merge_requests/153 .

Assuming nothing goes wrong, it should be merged in an hour or two.

comment:3 by Don-vip, 4 years ago

yay, thanks!

comment:4 by Don-vip, 4 years ago

Resolution: fixed
Status: closedreopened

Pipeline failed and fix did not get merged :'(

comment:5 by taylor.smock, 4 years ago

Looks like I didn't initialize preferences in one test, but due to ordering, it was passing for me most of the time (it may have failed a few times where I was debugging other tests).

I've got a JUnit extension specifically for preferences (see #21064) that very specifically resets the static fields in Config so that it needs to be called each time, mostly so that I don't miss stuff like this. :(

EDIT: It is now merged. :)

Last edited 4 years ago by taylor.smock (previous) (diff)

comment:6 by Don-vip, 4 years ago

Thanks, I just launched a new job https://josm.openstreetmap.de/jenkins/job/JOSM-Plugins/2050/ Let see if it comes back green.

comment:7 by Don-vip, 4 years ago

Error changed, but still broken:

compile:
     [echo] compiling sources for /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/dist/Mapillary.jar ...
    [javac] Compiling 109 source files to /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/build
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/model/MapObject.java:15: error: cannot find symbol
    [javac] import org.openstreetmap.josm.plugins.mapillary.cache.Caches.MapObjectIconCache;
    [javac]                                                             ^
    [javac]   symbol:   class MapObjectIconCache
    [javac]   location: class Caches
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/MapillaryKeyListener.java:138: warning: [deprecation] KEY in MapillaryKeys has been deprecated
    [javac]       Map<String, VectorNode> map = data.getNodes().stream().filter(image -> image.hasKey(MapillaryKeys.KEY))
    [javac]                                                                                                        ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/MapillaryKeyListener.java:139: warning: [deprecation] KEY in MapillaryKeys has been deprecated
    [javac]         .collect(Collectors.toMap(image -> image.get(MapillaryKeys.KEY), i -> i));
    [javac]                                                                   ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/MapillaryKeyListener.java:147: warning: [deprecation] KEY in MapillaryKeys has been deprecated
    [javac]       Map<String, VectorNode> newMap = data.getNodes().stream().filter(image -> image.hasKey(MapillaryKeys.KEY))
    [javac]                                                                                                           ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/MapillaryKeyListener.java:148: warning: [deprecation] KEY in MapillaryKeys has been deprecated
    [javac]         .collect(Collectors.toMap(image -> image.get(MapillaryKeys.KEY), i -> i));
    [javac]                                                                   ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/MapillaryKeyListener.java:175: warning: [deprecation] KEY in MapillaryKeys has been deprecated
    [javac]       final Map<String, VectorNode> dataImages = data.getNodes().stream().filter(i -> i.hasKey(MapillaryKeys.KEY))
    [javac]                                                                                                             ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/MapillaryKeyListener.java:176: warning: [deprecation] KEY in MapillaryKeys has been deprecated
    [javac]         .collect(Collectors.toMap(i -> i.get(MapillaryKeys.KEY), i -> i));
    [javac]                                                           ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/actions/WalkThread.java:134: warning: [deprecation] KEY in MapillaryKeys has been deprecated
    [javac]       if (nextImg != null && nextImg.hasKey(MapillaryKeys.KEY) && n > 1) {
    [javac]                                                          ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryVectorTileWorkarounds.java:39: warning: [unchecked] Possible heap pollution from parameterized vararg type N
    [javac]   default <N extends INode> void setSelected(N... nodes) {
    [javac]                                                   ^
    [javac]   where N is a type-variable:
    [javac]     N extends INode declared in method <N>setSelected(N...)
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/Caches.java:58: warning: [unchecked] unchecked generic array creation for varargs parameter of type Predicate<ImageIcon>[]
    [javac]   public static final MapillaryCacheAccess<ImageIcon> mapObjectIconCache = new MapillaryCacheAccess<>(
    [javac]                                                                            ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/Caches.java:61: warning: [unchecked] unchecked generic array creation for varargs parameter of type Predicate<UserProfile>[]
    [javac]   public static final MapillaryCacheAccess<UserProfile> userProfileCache = new MapillaryCacheAccess<>(
    [javac]                                                                            ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/Caches.java:65: warning: [unchecked] unchecked generic array creation for varargs parameter of type Predicate<BufferedImage>[]
    [javac]   public static final MapillaryCacheAccess<BufferedImage> metaImages = new MapillaryCacheAccess<>(
    [javac]                                                                        ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/Caches.java:69: warning: [unchecked] unchecked generic array creation for varargs parameter of type Predicate<String>[]
    [javac]   public static final MapillaryCacheAccess<String> metaDataCache = new MapillaryCacheAccess<>(
    [javac]                                                                    ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/Caches.java:85: warning: [unchecked] unchecked generic array creation for varargs parameter of type Predicate<BufferedImageCacheEntry>[]
    [javac]   public static final MapillaryCacheAccess<BufferedImageCacheEntry> FULL_IMAGE_CACHE = new MapillaryCacheAccess<>(
    [javac]                                                                                        ^
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/Caches.java:112: warning: [unchecked] Possible heap pollution from parameterized vararg type Predicate<V>
    [javac]     public MapillaryCacheAccess(CacheAccess<String, V> cacheAccess, Predicate<V>... validators) {
    [javac]                                                        ^
    [javac]   where V is a type-variable:
    [javac]     V extends Object declared in class MapillaryCacheAccess
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/model/MapObject.java:70: error: cannot find symbol
    [javac]     final ImageIcon cachedIcon = MapObjectIconCache.getInstance().get(objectTypeID);
    [javac]                                  ^
    [javac]   symbol:   variable MapObjectIconCache
    [javac]   location: class MapObject
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/model/MapObject.java:96: error: cannot find symbol
    [javac]       MapObjectIconCache.getInstance().put(objectTypeID, downloadedIcon);
    [javac]       ^
    [javac]   symbol:   variable MapObjectIconCache
    [javac]   location: class MapObject
    [javac] /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonMapObjectDecoder.java:58: warning: [unchecked] unchecked call to setLayer(T) as a member of the raw type DataLayer
    [javac]       ((DataLayer) primitive).setLayer(tags.get(MapillaryMapFeatureUtils.MapFeatureProperties.OBJECT_TYPE.toString()));
    [javac]                                       ^
    [javac]   where T is a type-variable:
    [javac]     T extends Object declared in interface DataLayer
    [javac] 3 errors
    [javac] 15 warnings

comment:8 by taylor.smock, 4 years ago

Can you do me a favor and check and see what commit is being built?
MapObject was removed in 3ed910fbb7b6981ba703280634ac976e3978b17d (June 28, 2021), and there are no current references to MapObjectIconCache.

EDIT: It should be 17d5b3d13536333cf10992bd82b65344817d056f, which jives with change 2 from the job (CachesTest: Ensure that preferences are initialized).

Last edited 4 years ago by taylor.smock (previous) (diff)

comment:9 by Don-vip, 4 years ago

We're using SVN mirroring:

$ svn info
Path: .
Working Copy Root Path: /var/lib/jenkins/jobs/JOSM-Plugins/workspace/jdk/JDK11/Mapillary
URL: https://github.com/JOSM/Mapillary/trunk
Relative URL: ^/trunk
Repository Root: https://github.com/JOSM/Mapillary
Repository UUID: 77b9bbf0-a831-6d07-d42b-ce57b7db7bff
Revision: 3144
Node Kind: directory
Schedule: normal
Last Changed Author: taylor.smock
Last Changed Rev: 3139
Last Changed Date: 2021-07-15 15:23:32 +0200 (Thu, 15 Jul 2021)

comment:10 by Don-vip, 4 years ago

------------------------------------------------------------------------
r3139 | taylor.smock | 2021-07-15 15:23:32 +0200 (Thu, 15 Jul 2021) | 4 lines

CachesTest: Ensure that preferences are initialized

Signed-off-by: Taylor Smock <tsmock@fb.com>

comment:11 by Don-vip, 4 years ago

Looks like deleted files are still there, I'm deleting everything and performing a new checkout...

comment:12 by Don-vip, 4 years ago

Last edited 4 years ago by Don-vip (previous) (diff)

comment:13 by taylor.smock, 4 years ago

I've been looking into it:

$ cd plugins/Mapillary
$ svn log src/main/java/org/openstreetmap/josm/plugins/mapillary/model/MapObject.java   
svn: E160013: '/JOSM/Mapillary/!svn/bc/3144/trunk/src/main/java/org/openstreetmap/josm/plugins/mapillary/model/MapObject.java' path not found
$ file src/main/java/org/openstreetmap/josm/plugins/mapillary/model/MapObject.java
src/main/java/org/openstreetmap/josm/plugins/mapillary/model/MapObject.java: Java source, ASCII text
# Um. OK.
$ svn log -v -r r3111

------------------------------------------------------------------------
r3111 | taylor.smock | 2021-06-28 16:57:40 -0600 (Mon, 28 Jun 2021) | 7 lines
Changed paths:
   M /trunk/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java
   M /trunk/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
   M /trunk/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayer.java
   A /trunk/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryVectorTileWorkarounds.java
   M /trunk/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/PointObjectLayer.java
   D /trunk/src/main/java/org/openstreetmap/josm/plugins/mapillary/model/MapObject.java
   A /trunk/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryMapFeatureUtils.java
   M /trunk/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURL.java
   M /trunk/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonMapObjectDecoder.java
   A /trunk/test/data/__files/api/v4/responses/graph/496980935069177
   A /trunk/test/data/__files/api/v4/responses/graph/496980935069177/detections.json
   A /trunk/test/data/__files/api/v4/responses/graph/496980935069177.json
   D /trunk/test/unit/org/openstreetmap/josm/plugins/mapillary/model/MapObjectTest.java
   M /trunk/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonMapObjectDecoderTest.java

Mapillary Point Objects: Add utils class

This should enable us to get images for a detection, and automatically
show the image(s).

Signed-off-by: Taylor Smock <tsmock@fb.com>

------------------------------------------------------------------------

It looks like subversion didn't delete the file. I'll have to figure out what is going on here.

I did try deleting and then checking everything out locally, and it didn't work. :crosses fingers for jenkins:

EDIT:

$ rm -rf src
$ svn revert -R src
$ ant clean dist
Last edited 4 years ago by taylor.smock (previous) (diff)

in reply to:  12 ; comment:14 by taylor.smock, 4 years ago

Replying to Don-vip:

New job: https://josm.openstreetmap.de/jenkins/job/JOSM-Plugins/2051/

Should be better now.

Doesn't look like it. At least If I'm looking at the right job.

That being said,

$ cd plugins/
$ rm -rf Mapillary
$ svn up

worked for me.

in reply to:  14 comment:15 by Don-vip, 4 years ago

Replying to taylor.smock:

Doesn't look like it. At least If I'm looking at the right job.

It hasn't started yet :)

comment:16 by Don-vip, 4 years ago

Resolution: fixed
Status: reopenedclosed

OK now it fails on another plugin. Thanks!

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.