Skip to content

Commit

Permalink
Remove reflective access when loading OpenCV (#1727)
Browse files Browse the repository at this point in the history
  • Loading branch information
4e6 authored May 5, 2021
1 parent e61ee45 commit 46725e0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ jobs:
$ENGINE_DIST_DIR/bin/enso --run test/Database_Tests
$ENGINE_DIST_DIR/bin/enso --run test/Geo_Tests
$ENGINE_DIST_DIR/bin/enso --run test/Visualization_Tests
$ENGINE_DIST_DIR/bin/enso --run test/Image_Tests
- name: Test Engine Distribution (Windows)
shell: bash
Expand All @@ -247,6 +248,7 @@ jobs:
$ENGINE_DIST_DIR/bin/enso.bat --run test/Database_Tests
$ENGINE_DIST_DIR/bin/enso.bat --run test/Geo_Tests
$ENGINE_DIST_DIR/bin/enso.bat --run test/Visualization_Tests
$ENGINE_DIST_DIR/bin/enso.bat --run test/Image_Tests
# Publish
- name: Publish the Engine Distribution Artifact
Expand Down
3 changes: 3 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
conform to a standard format and have been tested to work.
- Made some miscellaneous fixes to the `HTTP` portion of the `Base` library that
fix a few bugs ([#1722](https://github.com/enso-org/enso/pull/1722)).
- Removed reflective access when loading the OpenCV library
([#1727](https://github.com/enso-org/enso/pull/1727)). Illegal reflective
access operations were deprecated and will be denied in future JVM releases.

## Miscellaneous

Expand Down
4 changes: 1 addition & 3 deletions std-bits/src/main/java/org/enso/image/Codecs.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.enso.image;

import org.enso.image.opencv.OpenCV;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfInt;
import org.opencv.imgcodecs.Imgcodecs;
Expand All @@ -12,8 +11,7 @@ public class Codecs {
public static final int READ_FLAG_EMPTY = -127;

static {
OpenCV.loadShared();
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
OpenCV.loadLocally();
}

/** An error occurred when reading a file. */
Expand Down
3 changes: 1 addition & 2 deletions std-bits/src/main/java/org/enso/image/data/Image.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
public class Image {

static {
OpenCV.loadShared();
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
OpenCV.loadLocally();
}

private static final byte MAX_SIGNED_BYTE = -1;
Expand Down
3 changes: 1 addition & 2 deletions std-bits/src/main/java/org/enso/image/data/Matrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
public class Matrix {

static {
OpenCV.loadShared();
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
OpenCV.loadLocally();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/Image_Tests/src/Codecs_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Standard.Test
polyglot java import java.lang.System as Java_System

fetch addr file =
Process.run_command "curl" [addr, "--silent", "--output", file.path]
Process.run "curl" [addr, "--silent", "--output", file.path]

spec =
is_ci = Java_System.getenv "CI" == "true"
Expand Down

0 comments on commit 46725e0

Please sign in to comment.