code: JSONArray getPlatformPluginsForUpdate(VersionNumber from, VersionNumber to) {
          Jenkins jenkins = Jenkins.get();
          JSONArray pluginCategories = JSONArray.fromObject(getPlatformPluginList().toString());
          for (Iterator<?> categoryIterator = pluginCategories.iterator(); categoryIterator.hasNext();) {
              Object category = categoryIterator.next();
              if (category instanceof JSONObject) {
                  JSONObject cat = (JSONObject)category;
                  JSONArray plugins = cat.getJSONArray("plugins");
                  
                  nextPlugin: for (Iterator<?> pluginIterator = plugins.iterator(); pluginIterator.hasNext();) {
                      Object pluginData = pluginIterator.next();
                      if (pluginData instanceof JSONObject) {
                          JSONObject plugin = (JSONObject)pluginData;
                          if (plugin.has("added")) {
                              String sinceVersion = plugin.getString("added");
                              if (sinceVersion != null) {
                                  VersionNumber v = new VersionNumber(sinceVersion);
                                  if(v.compareTo(to) <= 0 && v.compareTo(from) > 0) {
                                      // This plugin is valid, we'll leave "suggested" state
                                      // to match the experience during install
                                      // but only add it if it's currently uninstalled
                                      String pluginName = plugin.getString("name");
                                      if (null == jenkins.getPluginManager().getPlugin(pluginName)) {
                                          // Also check that a compatible version exists in an update site
                                          boolean foundCompatibleVersion = false;
                                          for (UpdateSite site : jenkins.getUpdateCenter().getSiteList()) {
                                              UpdateSite.Plugin sitePlug = site.getPlugin(pluginName);
                                              if (sitePlug != null
                                                      && !sitePlug.isForNewerHudson() && !sitePlug.isForNewerJava()
                                                      && !sitePlug.isNeededDependenciesForNewerJenkins()) {
                                                  foundCompatibleVersion = true;
                                                  break;
                                              }
                                          }
                                          if (foundCompatibleVersion) {
                                              continue nextPlugin;
                                          }
                                      }
                                  }
                              }
                          }
                      }
                      
                      pluginIterator.remove();
                  }
                  
                  if (plugins.isEmpty()) {
                      categoryIterator.remove();
                  }
              }
          }
          return pluginCategories;
      }
docs: /*package