private BundleDescription[] getPluginModels() { ArrayList list = new ArrayList(); State state = TargetPlatformHelper.getState(); IProductPlugin[] plugins = product.getPlugins(); for (int i = 0; i < plugins.length; i++) { BundleDescription bundle = null; String v = plugins[i].getVersion(); if (v != null && v.length() > 0) { bundle = state.getBundle(plugins[i].getId(), Version.parseVersion(v)); } // if there's no version, just grab a bundle like before if (bundle == null) { bundle = state.getBundle(plugins[i].getId(), null); } if (bundle != null) { list.add(bundle); } } Object[] bundleArray = list.toArray(new BundleDescription[list.size()]); return (BundleDescription[]) bundleArray; }