diff --git a/app/src/processing/app/contrib/ContributionManager.java b/app/src/processing/app/contrib/ContributionManager.java index 90f8911b5..4638c64d5 100644 --- a/app/src/processing/app/contrib/ContributionManager.java +++ b/app/src/processing/app/contrib/ContributionManager.java @@ -638,7 +638,7 @@ public class ContributionManager { /** - * Updates all the flagged modes/tools. + * Updates all the flagged Mode and Tool folders. */ static private void updateFlagged(Base base, File root) throws Exception { // https://github.com/processing/processing/issues/6034 @@ -659,8 +659,7 @@ public class ContributionManager { List updateContribsList = new LinkedList<>(); // TODO This is bad code... This root.getName() stuff to get the folder - // type, plus "libraries.properties" (not the correct file name), - // and I have no idea what "putting this here, in just in case" means. + // type, plus "libraries.properties" (not the correct file name). // Not sure the function here so I'm not fixing it at the moment, // but this whole function could use some cleaning. [fry 180105] @@ -671,8 +670,6 @@ public class ContributionManager { propFileName = "tool.properties"; else if (type.equalsIgnoreCase("modes")) propFileName = "mode.properties"; - else if (type.equalsIgnoreCase("libraries")) //putting this here, just in case - propFileName = "libraries.properties"; for (File folder : markedForUpdate) { StringDict props = Util.readSettings(new File(folder, propFileName)); @@ -680,19 +677,15 @@ public class ContributionManager { Util.removeDir(folder); } - Iterator iter = listing.advertisedContributions.iterator(); - while (iter.hasNext()) { - AvailableContribution availableContribs = iter.next(); - if (updateContribsNames.contains(availableContribs.getName())) { - updateContribsList.add(availableContribs); + for (AvailableContribution contrib : listing.advertisedContributions) { + if (updateContribsNames.contains(contrib.getName())) { + updateContribsList.add(contrib); } } - Iterator iter2 = updateContribsList.iterator(); - while (iter2.hasNext()) { - AvailableContribution contribToUpdate = iter2.next(); - installOnStartUp(base, contribToUpdate); - listing.replaceContribution(contribToUpdate, contribToUpdate); + for (AvailableContribution contrib : updateContribsList) { + installOnStartUp(base, contrib); + listing.replaceContribution(contrib, contrib); } } diff --git a/todo.txt b/todo.txt index b8264b460..f57a95474 100755 --- a/todo.txt +++ b/todo.txt @@ -6,6 +6,9 @@ X https://github.com/processing/processing4/issues/83 X bump JDK to 11.0.8 X Make macOS notarization part of the build process X https://github.com/processing/processing4/issues/24 +X NullPointerException in ContributionManager.updateFlagged() on startup +X check for directory existence and read/write access on startup +X https://github.com/processing/processing/issues/6034 sam X Resolve rewrite of pixelDensity to settings in preproc