aboutsummaryrefslogtreecommitdiffstats
path: root/lint/cli
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-08-01 11:03:56 -0700
committerTor Norbye <tnorbye@google.com>2012-08-01 14:32:44 -0700
commit8dcd0726088eee54368e032e7dc6b31a450b4ee1 (patch)
treef8f4af2c8d1fde403997212ddabfe89c59e4dcab /lint/cli
parent2de64c74ebc0976a2954cde07bb205069bd36bb6 (diff)
downloadsdk-8dcd0726088eee54368e032e7dc6b31a450b4ee1.zip
sdk-8dcd0726088eee54368e032e7dc6b31a450b4ee1.tar.gz
sdk-8dcd0726088eee54368e032e7dc6b31a450b4ee1.tar.bz2
Fix lint-on-save for .class file detectors in Java files
This changeset fixes the lint-on-save behavior in Java files such that the classfile based checks are run after the .class files are up to date. It also makes lint-on-save work when Project > Build Automatically is turned off, by adding a new resource listener, and it modifies the IFileListener interface to make resource listening more efficient; in particular, it passes the flag mask such that listeners can ignore events such as markers getting added or removed from a file without the content changing. It also makes some improvements to the lint infrastructure. First, it adds an indirection in the LintClient such that reading bytes from files can be customized by the client (to for example add caching or to read contents from memory not yet flushed to disk). It also allows inner classes to share the contents of the source file between each context (while debugging the above I noticed that each inner class node had its own class context and therefore would re-read the source file repeatedly.) Change-Id: Ib9572cebe1269fe05c3af1369610525ea3b44061
Diffstat (limited to 'lint/cli')
-rw-r--r--lint/cli/src/com/android/tools/lint/Main.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/lint/cli/src/com/android/tools/lint/Main.java b/lint/cli/src/com/android/tools/lint/Main.java
index 5e51106..fbb0b16 100644
--- a/lint/cli/src/com/android/tools/lint/Main.java
+++ b/lint/cli/src/com/android/tools/lint/Main.java
@@ -1112,7 +1112,7 @@ public class Main extends LintClient {
@Override
public @NonNull String readFile(@NonNull File file) {
try {
- return LintUtils.getEncodedString(file);
+ return LintUtils.getEncodedString(this, file);
} catch (IOException e) {
return ""; //$NON-NLS-1$
}