Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: pkg/analysis_server/tool/spec/generated/java/types/KytheEntry.java

Issue 3006693002: Add an integration test for kythe support with bug fixes (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/integration/test_all.dart ('k') | pkg/analyzer_plugin/doc/api.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/tool/spec/generated/java/types/KytheEntry.java
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/KytheEntry.java b/pkg/analysis_server/tool/spec/generated/java/types/KytheEntry.java
index a224a70abf5d30424e901436ebea7a6e0e25fd17..92fabffc587d2fae2a70135aeac0a1ef8353c69e 100644
--- a/pkg/analysis_server/tool/spec/generated/java/types/KytheEntry.java
+++ b/pkg/analysis_server/tool/spec/generated/java/types/KytheEntry.java
@@ -45,27 +45,27 @@ public class KytheEntry {
public static final List<KytheEntry> EMPTY_LIST = Lists.newArrayList();
/**
- * The ticket of the source node (must not be empty).
+ * The ticket of the source node.
*/
private final KytheVName source;
/**
- * An edge label (may be empty). The schema defines which labels are meaningful.
+ * An edge label. The schema defines which labels are meaningful.
*/
private final String kind;
/**
- * The ticket of the target node (may be empty).
+ * The ticket of the target node.
*/
private final KytheVName target;
/**
- * A fact label (must not be empty). The schema defines which fact labels are meaningful.
+ * A fact label. The schema defines which fact labels are meaningful.
*/
private final String fact;
/**
- * The String value of the fact (may be empty).
+ * The String value of the fact.
*/
private final int[] value;
@@ -96,10 +96,10 @@ public class KytheEntry {
public static KytheEntry fromJson(JsonObject jsonObject) {
KytheVName source = KytheVName.fromJson(jsonObject.get("source").getAsJsonObject());
- String kind = jsonObject.get("kind").getAsString();
- KytheVName target = KytheVName.fromJson(jsonObject.get("target").getAsJsonObject());
+ String kind = jsonObject.get("kind") == null ? null : jsonObject.get("kind").getAsString();
+ KytheVName target = jsonObject.get("target") == null ? null : KytheVName.fromJson(jsonObject.get("target").getAsJsonObject());
String fact = jsonObject.get("fact").getAsString();
- int[] value = JsonUtilities.decodeIntArray(jsonObject.get("value").getAsJsonArray());
+ int[] value = jsonObject.get("value") == null ? null : JsonUtilities.decodeIntArray(jsonObject.get("value").getAsJsonArray());
return new KytheEntry(source, kind, target, fact, value);
}
@@ -116,35 +116,35 @@ public class KytheEntry {
}
/**
- * A fact label (must not be empty). The schema defines which fact labels are meaningful.
+ * A fact label. The schema defines which fact labels are meaningful.
*/
public String getFact() {
return fact;
}
/**
- * An edge label (may be empty). The schema defines which labels are meaningful.
+ * An edge label. The schema defines which labels are meaningful.
*/
public String getKind() {
return kind;
}
/**
- * The ticket of the source node (must not be empty).
+ * The ticket of the source node.
*/
public KytheVName getSource() {
return source;
}
/**
- * The ticket of the target node (may be empty).
+ * The ticket of the target node.
*/
public KytheVName getTarget() {
return target;
}
/**
- * The String value of the fact (may be empty).
+ * The String value of the fact.
*/
public int[] getValue() {
return value;
@@ -164,14 +164,20 @@ public class KytheEntry {
public JsonObject toJson() {
JsonObject jsonObject = new JsonObject();
jsonObject.add("source", source.toJson());
- jsonObject.addProperty("kind", kind);
- jsonObject.add("target", target.toJson());
+ if (kind != null) {
+ jsonObject.addProperty("kind", kind);
+ }
+ if (target != null) {
+ jsonObject.add("target", target.toJson());
+ }
jsonObject.addProperty("fact", fact);
- JsonArray jsonArrayValue = new JsonArray();
- for (int elt : value) {
- jsonArrayValue.add(new JsonPrimitive(elt));
+ if (value != null) {
+ JsonArray jsonArrayValue = new JsonArray();
+ for (int elt : value) {
+ jsonArrayValue.add(new JsonPrimitive(elt));
+ }
+ jsonObject.add("value", jsonArrayValue);
}
- jsonObject.add("value", jsonArrayValue);
return jsonObject;
}
« no previous file with comments | « pkg/analysis_server/test/integration/test_all.dart ('k') | pkg/analyzer_plugin/doc/api.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698