From 740e4b512ed8c40d770e2884db3251774962fbaf Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 26 Feb 2021 21:11:19 -0500 Subject: [PATCH] catch NoClassDefError in Platform.deleteFile() (still unclear of its cause) --- app/src/processing/app/Platform.java | 18 +++++++++++++----- todo.txt | 16 ++++++++++------ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/app/src/processing/app/Platform.java b/app/src/processing/app/Platform.java index 1e12dc733..51ac0bab6 100644 --- a/app/src/processing/app/Platform.java +++ b/app/src/processing/app/Platform.java @@ -385,12 +385,20 @@ public class Platform { * @throws IOException */ static public boolean deleteFile(File file) throws IOException { - FileUtils fu = FileUtils.getInstance(); - if (fu.hasTrash()) { - fu.moveToTrash(new File[] { file }); - return true; + try { + FileUtils fu = FileUtils.getInstance(); + if (fu.hasTrash()) { + fu.moveToTrash(new File[]{file}); + return true; + } + } catch (Throwable t) { + // On macOS getting NoClassDefFoundError inside JNA on Big Sur. + // (Can't find com.sun.jna.platform.mac.MacFileUtils$FileManager) + // Just adding a catch-all here so that it does the fall-through below. + System.err.println(t.getMessage()); + } - } else if (file.isDirectory()) { + if (file.isDirectory()) { Util.removeDir(file); return true; diff --git a/todo.txt b/todo.txt index 61fcbcb5a..b1d990eed 100755 --- a/todo.txt +++ b/todo.txt @@ -9,6 +9,13 @@ X https://github.com/fathominfo/processing-p5js-mode/issues/26 X implement auto-download for JNA updates X “Exception in thread "Contribution Uninstaller" NullPointerException” during Remove X https://github.com/processing/processing4/issues/174 +X catch NoClassDefError in Platform.deleteFile() (still unclear of its cause) + +earlier +o further streamline the downloader +o https://github.com/processing/processing4/issues/47 +o next video release +o https://github.com/processing/processing-video/milestone/1 windows/scaling @@ -26,12 +33,9 @@ _ include JNA so that sketches can also scale properly? _ what happens re: getting scaled/high-res graphics? _ make that a preference? (and double the size by default?) -earlier -o further streamline the downloader -o https://github.com/processing/processing4/issues/47 -o next video release -o https://github.com/processing/processing-video/milestone/1 - +_ need to set a nicer default font +_ increases export size, but impact is so worth it +_ new FloatList(float...) already fixed in 4.x? (confirm/close on release) _ HDPI support GNOME desktop