diff options
author | Raphael Moll <ralf@android.com> | 2013-02-08 11:38:41 -0800 |
---|---|---|
committer | Raphael Moll <ralf@android.com> | 2013-02-08 11:39:21 -0800 |
commit | a2db8d5214e6d9ed238f34db41dd8bb6a83af34b (patch) | |
tree | 2d08b12644ceb2df7536894d42ce1cf8a5910f9b /eclipse/plugins | |
parent | e1aaef279c83a93d211f5d7f9fcc4bea0136c128 (diff) | |
download | sdk-a2db8d5214e6d9ed238f34db41dd8bb6a83af34b.zip sdk-a2db8d5214e6d9ed238f34db41dd8bb6a83af34b.tar.gz sdk-a2db8d5214e6d9ed238f34db41dd8bb6a83af34b.tar.bz2 |
Fix sdkcommon/lint API usage in ADT.
Change-Id: I4672ec7504daf1bf1e5c0880e5aa2003c082e7da
Diffstat (limited to 'eclipse/plugins')
4 files changed, 17 insertions, 10 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java index 223e5e5..697a0bc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java @@ -23,6 +23,7 @@ import static org.eclipse.ui.IWorkbenchPage.MATCH_INPUT; import com.android.SdkConstants; import com.android.annotations.NonNull; import com.android.annotations.Nullable; +import com.android.ide.common.sdk.SdkVersionInfo; import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor; import com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart; import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode; @@ -989,7 +990,7 @@ public class AdtUtils { * @return the highest known API number */ public static int getHighestKnownApiLevel() { - return SdkConstants.HIGHEST_KNOWN_API; + return SdkVersionInfo.HIGHEST_KNOWN_API; } /** diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java index d7a0758..365c73d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java @@ -25,6 +25,7 @@ import static org.eclipse.jdt.core.dom.SingleMemberAnnotation.VALUE_PROPERTY; import com.android.annotations.NonNull; import com.android.annotations.Nullable; +import com.android.ide.common.sdk.SdkVersionInfo; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtUtils; import com.android.ide.eclipse.adt.internal.editors.IconFactory; @@ -409,7 +410,7 @@ class AddSuppressAnnotation implements IMarkerResolution2 { // @TargetApi is only valid on methods and classes, not fields etc && (body instanceof MethodDeclaration || body instanceof TypeDeclaration)) { - String apiString = LintUtils.getBuildCode(api); + String apiString = SdkVersionInfo.getBuildCode(api); if (apiString == null) { apiString = Integer.toString(api); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java index 0d751cb..0d8fd33 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java @@ -22,6 +22,7 @@ import static com.android.SdkConstants.DOT_XML; import com.android.annotations.NonNull; import com.android.annotations.Nullable; +import com.android.ide.common.sdk.SdkVersionInfo; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtUtils; import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor; @@ -186,7 +187,7 @@ class AddSuppressAttribute implements ICompletionProposal { if (matcher.find()) { api = Integer.parseInt(matcher.group(1)); String targetApi; - String buildCode = LintUtils.getBuildCode(api); + String buildCode = SdkVersionInfo.getBuildCode(api); if (buildCode != null) { targetApi = buildCode.toLowerCase(Locale.US); fixes.add(new AddSuppressAttribute(editor, id, marker, element, diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java index 4fc2fbe..48681d0 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java @@ -17,7 +17,6 @@ package com.android.ide.eclipse.adt.internal.wizards.templates; import static com.android.SdkConstants.CURRENT_PLATFORM; import static com.android.SdkConstants.FD_TOOLS; -import static com.android.SdkConstants.HIGHEST_KNOWN_API; import static com.android.SdkConstants.PLATFORM_WINDOWS; import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_MIN_API; import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_MIN_BUILD_API; @@ -25,6 +24,7 @@ import static com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHan import com.android.annotations.NonNull; import com.android.annotations.Nullable; +import com.android.ide.common.sdk.SdkVersionInfo; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtUtils; import com.android.ide.eclipse.adt.internal.lint.EclipseLintClient; @@ -329,14 +329,16 @@ public class TemplateHandlerTest extends SdkLoadingTestCase { } for (int minSdk = 1; - minSdk <= HIGHEST_KNOWN_API; - minSdk++) { + minSdk <= SdkVersionInfo.HIGHEST_KNOWN_API; + minSdk++) { // Don't bother checking *every* single minSdk, just pick some interesting ones if (!isInterestingApiLevel(minSdk)) { continue; } - for (int targetSdk = minSdk; targetSdk <= HIGHEST_KNOWN_API; targetSdk++) { + for (int targetSdk = minSdk; + targetSdk <= SdkVersionInfo.HIGHEST_KNOWN_API; + targetSdk++) { if (!isInterestingApiLevel(targetSdk)) { continue; } @@ -440,14 +442,16 @@ public class TemplateHandlerTest extends SdkLoadingTestCase { } for (int minSdk = 1; - minSdk <= HIGHEST_KNOWN_API; - minSdk++) { + minSdk <= SdkVersionInfo.HIGHEST_KNOWN_API; + minSdk++) { // Don't bother checking *every* single minSdk, just pick some interesting ones if (!isInterestingApiLevel(minSdk)) { continue; } - for (int targetSdk = minSdk; targetSdk <= HIGHEST_KNOWN_API; targetSdk++) { + for (int targetSdk = minSdk; + targetSdk <= SdkVersionInfo.HIGHEST_KNOWN_API; + targetSdk++) { if (!isInterestingApiLevel(targetSdk)) { continue; } |