SDK Updater: Cleanup a bunch of todos

This commit is contained in:
Raphael
2009-06-25 20:00:05 -07:00
parent 426ecc9efd
commit 6183584988
6 changed files with 24 additions and 31 deletions

View File

@@ -180,7 +180,9 @@ public final class SdkManager {
writer.write(String.format("0x%04x\n", i));
}
} finally {
writer.close();
if (writer != null) {
writer.close();
}
}
}

View File

@@ -122,7 +122,7 @@ public class PlatformPackage extends Package {
File platforms = new File(osSdkRoot, SdkConstants.FD_PLATFORMS);
File folder = new File(platforms, String.format("android-%s", getVersion())); //$NON-NLS-1$
// TODO find similar existing platform in platforms folder
return folder;
}

View File

@@ -18,6 +18,7 @@ package com.android.sdklib.internal.repository;
import com.android.prefs.AndroidLocation;
import com.android.prefs.AndroidLocation.AndroidLocationException;
import com.android.sdklib.ISdkLog;
import java.io.File;
import java.io.FileInputStream;
@@ -68,7 +69,7 @@ public class RepoSources {
* Loads all user sources. This <em>replaces</em> all existing user sources
* by the ones from the property file.
*/
public void loadUserSources() {
public void loadUserSources(ISdkLog log) {
// Remove all existing user sources
for (Iterator<RepoSource> it = mSources.iterator(); it.hasNext(); ) {
@@ -100,14 +101,14 @@ public class RepoSources {
}
} catch (NumberFormatException e) {
// TODO print to log
e.printStackTrace();
log.error(e, null);
} catch (AndroidLocationException e) {
// TODO print to log
e.printStackTrace();
log.error(e, null);
} catch (IOException e) {
// TODO print to log
e.printStackTrace();
log.error(e, null);
} finally {
if (fis != null) {
try {
@@ -121,8 +122,9 @@ public class RepoSources {
/**
* Saves all the user sources.
* @param log
*/
public void saveUserSources() {
public void saveUserSources(ISdkLog log) {
FileOutputStream fos = null;
try {
String folder = AndroidLocation.getFolder();
@@ -144,11 +146,11 @@ public class RepoSources {
props.store( fos, "## User Sources for Android tool"); //$NON-NLS-1$
} catch (AndroidLocationException e) {
// TODO print to log
e.printStackTrace();
log.error(e, null);
} catch (IOException e) {
// TODO print to log
e.printStackTrace();
log.error(e, null);
} finally {
if (fos != null) {
try {