diff options
author | Tor Norbye <tnorbye@google.com> | 2013-02-08 12:00:14 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2013-02-08 12:00:14 -0800 |
commit | 917a2810dccee2abf456ed6b1fde9b73f15ba7db (patch) | |
tree | 0ed6d60ab6991bdc75ebb8f1d138531004c0f38c /eclipse/plugins | |
parent | 830e676782b3cdd75f67093035f24a77d9ef2dc7 (diff) | |
download | sdk-917a2810dccee2abf456ed6b1fde9b73f15ba7db.zip sdk-917a2810dccee2abf456ed6b1fde9b73f15ba7db.tar.gz sdk-917a2810dccee2abf456ed6b1fde9b73f15ba7db.tar.bz2 |
Track tools/base API changes
Change-Id: I97f785fdeafebf7c87d180e6b9905b08f7e3b72e
Diffstat (limited to 'eclipse/plugins')
8 files changed, 37 insertions, 16 deletions
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 365c73d..b047b1b 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 @@ -32,7 +32,6 @@ import com.android.ide.eclipse.adt.internal.editors.IconFactory; import com.android.tools.lint.checks.AnnotationDetector; import com.android.tools.lint.checks.ApiDetector; import com.android.tools.lint.detector.api.Issue; -import com.android.tools.lint.detector.api.LintUtils; import com.android.tools.lint.detector.api.Scope; import org.eclipse.core.resources.IMarker; @@ -346,7 +345,8 @@ class AddSuppressAnnotation implements IMarkerResolution2 { } Issue issue = EclipseLintClient.getRegistry().getIssue(id); - boolean isClassDetector = issue != null && issue.getScope().contains(Scope.CLASS_FILE); + boolean isClassDetector = issue != null && issue.getImplementation().getScope().contains( + Scope.CLASS_FILE); // Don't offer to suppress (with an annotation) the annotation checks if (issue == AnnotationDetector.ISSUE) { 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 0d8fd33..b77b475 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 @@ -29,7 +29,6 @@ import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor; import com.android.ide.eclipse.adt.internal.editors.IconFactory; import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities; import com.android.tools.lint.checks.ApiDetector; -import com.android.tools.lint.detector.api.LintUtils; import com.google.common.collect.Lists; import org.eclipse.core.resources.IMarker; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java index f6b18e0..45ae2c5 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java @@ -105,6 +105,7 @@ import java.util.List; import java.util.Map; import java.util.WeakHashMap; +import lombok.ast.TypeReference; import lombok.ast.ecj.EcjTreeConverter; import lombok.ast.grammar.ParseProblem; import lombok.ast.grammar.Source; @@ -614,8 +615,8 @@ public class EclipseLintClient extends LintClient implements IDomParser { return ""; } - String summary = issue.getDescription(); - String explanation = issue.getExplanationAsSimpleText(); + String summary = issue.getDescription(Issue.OutputFormat.TEXT); + String explanation = issue.getExplanation(Issue.OutputFormat.TEXT); StringBuilder sb = new StringBuilder(summary.length() + explanation.length() + 20); try { @@ -1213,6 +1214,19 @@ public class EclipseLintClient extends LintClient implements IDomParser { @NonNull lombok.ast.Node compilationUnit) { } + @Override + @Nullable + public lombok.ast.Node resolve(@NonNull JavaContext context, + @NonNull lombok.ast.Node node) { + return null; + } + + @Override + @Nullable + public TypeReference getType(@NonNull JavaContext context, @NonNull lombok.ast.Node node) { + return null; + } + /* Handle for creating positions cheaply and returning full fledged locations later */ private class LocationHandle implements Handle { private File mFile; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java index feb6bb5..401703e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java @@ -37,6 +37,7 @@ import com.android.tools.lint.checks.TypographyDetector; import com.android.tools.lint.checks.UseCompoundDrawableDetector; import com.android.tools.lint.checks.UselessViewDetector; import com.android.tools.lint.detector.api.Issue; +import com.android.tools.lint.detector.api.Issue.OutputFormat; import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; @@ -109,7 +110,7 @@ abstract class LintFix implements ICompletionProposal { public String getAdditionalProposalInfo() { Issue issue = EclipseLintClient.getRegistry().getIssue(mId); if (issue != null) { - return issue.getExplanationAsHtml(); + return issue.getExplanation(OutputFormat.HTML); } return null; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java index 22fe23b..ce5fd55 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java @@ -27,6 +27,7 @@ import com.android.tools.lint.client.api.Configuration; import com.android.tools.lint.client.api.DefaultConfiguration; import com.android.tools.lint.client.api.IssueRegistry; import com.android.tools.lint.detector.api.Issue; +import com.android.tools.lint.detector.api.Issue.OutputFormat; import com.android.tools.lint.detector.api.Project; import com.android.tools.lint.detector.api.Severity; import com.android.utils.SdkUtils; @@ -488,11 +489,12 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi sb.append('\n').append('\n'); sb.append("Issue Explanation:"); sb.append('\n'); - if (issue.getExplanation() != null) { + String explanation = issue.getExplanation(Issue.OutputFormat.TEXT); + if (explanation != null && !explanation.isEmpty()) { sb.append('\n'); - sb.append(issue.getExplanationAsSimpleText()); + sb.append(explanation); } else { - sb.append(issue.getDescription()); + sb.append(issue.getDescription(Issue.OutputFormat.TEXT)); } if (issue.getMoreInfo() != null) { @@ -543,7 +545,8 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi public String getAdditionalProposalInfo() { return "Provides more information about this issue." + "<br><br>" //$NON-NLS-1$ - + EclipseLintClient.getRegistry().getIssue(mId).getExplanationAsHtml(); + + EclipseLintClient.getRegistry().getIssue(mId).getExplanation( + OutputFormat.HTML); } @Override diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java index 95e9f18..bd1eb72 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java @@ -140,7 +140,7 @@ final class LintJob extends Job { if (issue == null) { continue; } - if (issue.isAdequate(scope)) { + if (issue.getImplementation().isAdequate(scope)) { marker.delete(); } } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java index 6e18837..02af2fd 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java @@ -15,6 +15,9 @@ */ package com.android.ide.eclipse.adt.internal.preferences; +import static com.android.tools.lint.detector.api.Issue.OutputFormat.RAW; +import static com.android.tools.lint.detector.api.Issue.OutputFormat.TEXT; + import com.android.annotations.NonNull; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.AdtUtils; @@ -448,8 +451,8 @@ public class LintPreferencePage extends PropertyPage implements IWorkbenchPrefer Object data = item != null ? item.getData() : null; if (data instanceof Issue) { Issue issue = (Issue) data; - String summary = issue.getDescription(); - String explanation = issue.getExplanation(); + String summary = issue.getDescription(Issue.OutputFormat.TEXT); + String explanation = issue.getExplanation(Issue.OutputFormat.TEXT); StringBuilder sb = new StringBuilder(summary.length() + explanation.length() + 20); sb.append(summary); @@ -568,7 +571,7 @@ public class LintPreferencePage extends PropertyPage implements IWorkbenchPrefer || issue.getCategory().getName().toLowerCase(Locale.US).startsWith(filter) || issue.getCategory().getFullName().toLowerCase(Locale.US).startsWith(filter) || issue.getId().toLowerCase(Locale.US).contains(filter) - || issue.getDescription().toLowerCase(Locale.US).contains(filter); + || issue.getDescription(RAW).toLowerCase(Locale.US).contains(filter); } private class ContentProvider extends TreeNodeContentProvider { @@ -712,7 +715,7 @@ public class LintPreferencePage extends PropertyPage implements IWorkbenchPrefer case 0: return issue.getId(); case 1: - return issue.getDescription(); + return issue.getDescription(TEXT); } return null; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java index 5d9c0ef..f187a3f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java @@ -235,7 +235,8 @@ public final class Sdk { final ArrayList<String> logMessages = new ArrayList<String>(); ILogger log = new ILogger() { @Override - public void error(Throwable throwable, String errorFormat, Object... arg) { + public void error(@Nullable Throwable throwable, @Nullable String errorFormat, + Object... arg) { if (errorFormat != null) { logMessages.add(String.format("Error: " + errorFormat, arg)); } |