Commits

Anonymous committed 6458d82

Fix a few FindBugs issues.

Comments (0)

Files changed (3)

core/src/org/netbeans/modules/android/core/sdk/DalvikPlatform.java

       while (platformTarget != null && !platformTarget.isPlatform()) {
         platformTarget = platformTarget.getParent();
       }
-      // TODO: handle null
+      if (platformTarget == null) {
+        throw new IllegalStateException("Cannot find platform.jar for " + androidTarget);
+      }
       File platformJar = FileUtil.normalizeFile(new File(platformTarget.getPath(IAndroidTarget.ANDROID_JAR)));
       URL archiveRoot = FileUtil.getArchiveRoot(platformJar.toURI().toURL());
       return archiveRoot;
     }
 
-    private static List<URL> findPlatformJar(final FileObject folderFO)
-        throws MalformedURLException {
-      File folder = FileUtil.toFile(folderFO);
-      File platformJar = FileUtil.normalizeFile(new File(folder, PLATFORM_JAR));
-      return Collections.singletonList(FileUtil.getArchiveRoot(platformJar.toURI().toURL()));
-    }
-
     private static List<URL> findTargetLibraries(IAndroidTarget target) {
       if (target == null) {
         return Collections.emptyList();

core/src/org/netbeans/modules/android/core/ui/SdkManagerAction.java

 
   private void runSdkManager(String sdkLocation) {
     try {
-      Process process = new ExternalProcessBuilder(
+      /*Process process = */new ExternalProcessBuilder(
           sdkLocation + File.separatorChar + SdkConstants.OS_SDK_TOOLS_FOLDER + SdkConstants.androidCmdName())
           .call();
       // TODO do I need to read stderr/out?

project/src/org/netbeans/modules/android/project/ui/wizards/PanelProjectLocationVisual.java

             String formatter = NbBundle.getMessage(PanelProjectLocationVisual.class,"TXT_JavaApplication");
             while ((projectName=validFreeProjectName(projectLocation, formatter, baseCount))==null)
                 baseCount++;                
-            settings.putProperty (NewAndroidProjectWizardIterator.PROP_NAME_INDEX, new Integer(baseCount));
+            settings.putProperty (NewAndroidProjectWizardIterator.PROP_NAME_INDEX, Integer.valueOf(baseCount));
         }
         this.projectNameTextField.setText (projectName);                
         this.projectNameTextField.selectAll();
     }
     
     private String validFreeProjectName (final File parentFolder, final String formater, final int index) {
-        String name = MessageFormat.format (formater, new Object[]{new Integer (index)});                
+        String name = MessageFormat.format (formater, new Object[]{Integer.valueOf(index)});                
         File file = new File (parentFolder, name);
         return file.exists() ? null : name;
     }