diff options
author | Xavier Ducrohet <xav@android.com> | 2011-02-15 15:25:02 -0800 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2011-02-15 15:25:02 -0800 |
commit | 1a21ba528b0d13b4c32b26037638015b02e8e338 (patch) | |
tree | 549744559b4bceede9fa3042d3efb4b19682c2a6 /eclipse | |
parent | b39ad7572e10eb35cda0dfb3836086f5da8db6f2 (diff) | |
parent | 9e22afa04b05b54958448bd13a924018e2f7570a (diff) | |
download | sdk-1a21ba528b0d13b4c32b26037638015b02e8e338.zip sdk-1a21ba528b0d13b4c32b26037638015b02e8e338.tar.gz sdk-1a21ba528b0d13b4c32b26037638015b02e8e338.tar.bz2 |
Merge "Fix issue setting Javadoc to classpath container"
Diffstat (limited to 'eclipse')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java index 0f6b508..c5f1fff 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java @@ -67,6 +67,8 @@ import java.util.regex.Pattern; */ public class AndroidClasspathContainerInitializer extends ClasspathContainerInitializer { + public static final String NULL_API_URL = "<null>"; //$NON-NLS-1$ + public static final String SOURCES_ZIP = "/sources.zip"; //$NON-NLS-1$ public static final String COM_ANDROID_IDE_ECLIPSE_ADT_SOURCE = @@ -530,8 +532,7 @@ public class AndroidClasspathContainerInitializer extends ClasspathContainerInit } } IClasspathAttribute[] attributes = null; - if (apiURL != null) { - + if (apiURL != null && !NULL_API_URL.equals(apiURL)) { IClasspathAttribute cpAttribute = JavaCore.newClasspathAttribute( IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, apiURL); attributes = new IClasspathAttribute[] { @@ -824,12 +825,22 @@ public class AndroidClasspathContainerInitializer extends ClasspathContainerInit getAndroidSourceProperty(target), null); } IClasspathAttribute[] extraAttributtes = entry.getExtraAttributes(); + if (extraAttributtes.length == 0) { + ProjectHelper.saveStringProperty(root, PROPERTY_ANDROID_API, + NULL_API_URL); + } for (int j = 0; j < extraAttributtes.length; j++) { IClasspathAttribute extraAttribute = extraAttributtes[j]; + String value = extraAttribute.getValue(); + if ((value == null || value.trim().length() == 0) + && IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME + .equals(extraAttribute.getName())) { + value = NULL_API_URL; + } if (IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME .equals(extraAttribute.getName())) { ProjectHelper.saveStringProperty(root, - PROPERTY_ANDROID_API, extraAttribute.getValue()); + PROPERTY_ANDROID_API, value); } } |