Skip to content

Commit

Permalink
Clean up some illegal reflective access warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunchboy committed Oct 1, 2023
1 parent 35dbcc5 commit 201e078
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Nothing so far.
actually needs Java 1.9 or later. The fact that nobody has run into
this issue suggests nobody is using such ancient versions anyway, so
this could perhaps be removed.
- Several warnings about illegal reflective access have been fixed by
giving type hints to the Clojure compiler so it can avoid reflection
in those situations.
- Removed some libraries that were not actually used any more, saving
some file size.

Expand Down
4 changes: 2 additions & 2 deletions src/beat_link_trigger/menus.clj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
(if (< (Float/valueOf (System/getProperty "java.specification.version")) 9.0)
(eval '(.setQuitHandler (com.apple.eawt.Application/getApplication) ; Use old, Mac-specific approach.
(proxy [com.apple.eawt.QuitHandler] []
(handleQuitRequestWith [e response]
(handleQuitRequestWith [e ^com.apple.eawt.QuitResponse response]
(reset! quit-response-fn
(fn [proceed?]
(if proceed?
Expand All @@ -65,7 +65,7 @@
((resolve 'beat-link-trigger.triggers/quit))))))
(eval '(.setQuitHandler (java.awt.Desktop/getDesktop) ; Java 9 or later has a cross-platform way to do it.
(proxy [java.awt.desktop.QuitHandler] []
(handleQuitRequestWith [e response]
(handleQuitRequestWith [e ^java.awt.desktop.QuitResponse response]
(reset! quit-response-fn
(fn [proceed?]
(if proceed?
Expand Down
2 changes: 1 addition & 1 deletion src/beat_link_trigger/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
mid-x (when x (Math/round (+ x (/ (or width (.getWidth window)) 2.0))))
mid-y (when y (Math/round (+ y (/ (or height (.getHeight window)) 2.0))))]
(if (or (nil? x)
(empty? (filter (fn [device]
(empty? (filter (fn [^java.awt.GraphicsDevice device]
(let [bounds (.. device getDefaultConfiguration getBounds)]
(and (.contains bounds x y)
(.contains bounds mid-x mid-y))))
Expand Down

0 comments on commit 201e078

Please sign in to comment.