catch NoClassDefError in Platform.deleteFile() (still unclear of its cause)

This commit is contained in:
Ben Fry
2021-02-26 21:11:19 -05:00
parent 758e3d4c02
commit 740e4b512e
2 changed files with 23 additions and 11 deletions
+13 -5
View File
@@ -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;
+10 -6
View File
@@ -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