diff --git a/querysync/java/com/google/idea/blaze/qsync/query/BUILD b/querysync/java/com/google/idea/blaze/qsync/query/BUILD index 748a93a2d86..4a4787147c1 100644 --- a/querysync/java/com/google/idea/blaze/qsync/query/BUILD +++ b/querysync/java/com/google/idea/blaze/qsync/query/BUILD @@ -20,6 +20,7 @@ java_library( deps = [ ":querysummary_java_proto", "//shared", + "//shared:proto", "//third_party/auto_value", "//third_party/bazel/src/main/protobuf:build_java_proto", "@com_google_guava_guava//jar", diff --git a/querysync/java/com/google/idea/blaze/qsync/query/QuerySummary.java b/querysync/java/com/google/idea/blaze/qsync/query/QuerySummary.java index b655f8e357f..e80f8381722 100644 --- a/querysync/java/com/google/idea/blaze/qsync/query/QuerySummary.java +++ b/querysync/java/com/google/idea/blaze/qsync/query/QuerySummary.java @@ -34,6 +34,7 @@ import com.google.devtools.build.lib.query2.proto.proto2api.Build; import com.google.devtools.build.lib.query2.proto.proto2api.Build.Target; import com.google.idea.blaze.common.Label; +import com.google.idea.blaze.common.proto.ProtoStringInterner; import com.google.idea.blaze.qsync.query.Query.SourceFile; import java.io.BufferedInputStream; import java.io.File; @@ -135,7 +136,8 @@ public static QuerySummary create(InputStream protoInputStream) throws IOExcepti Map ruleMap = Maps.newHashMap(); Set packagesWithErrors = Sets.newHashSet(); Build.Target target; - while ((target = Target.parseDelimitedFrom(protoInputStream)) != null) { + ProtoStringInterner interner = new ProtoStringInterner(); + while ((target = interner.intern(Target.parseDelimitedFrom(protoInputStream))) != null) { switch (target.getType()) { case SOURCE_FILE: Query.SourceFile sourceFile = @@ -335,7 +337,8 @@ public Builder putAllPackagesWithErrors(Set packagesWithErrors) { } public QuerySummary build() { - return QuerySummary.create(builder.build()); + ProtoStringInterner interner = new ProtoStringInterner(); + return QuerySummary.create(interner.intern(builder.build())); } } }