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

Unified Diff: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/utilities/general/JsonUtilities.java

Issue 538253002: Use primitive int/boolean where possible in the Java client. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/utilities/general/JsonUtilities.java
diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/utilities/general/JsonUtilities.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/utilities/general/JsonUtilities.java
index 46cc7d0936fad0d688d3c0dbb1dcded1f2804b6a..20b8824dcd69bd55889126069a0901328e0a940f 100644
--- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/utilities/general/JsonUtilities.java
+++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/utilities/general/JsonUtilities.java
@@ -43,6 +43,20 @@ public class JsonUtilities {
return booleanArray;
}
+ public static int[] decodeIntArray(JsonArray jsonArray) {
+ if (jsonArray == null) {
+ return new int[0];
+ }
+ int i = 0;
+ int[] intArray = new int[jsonArray.size()];
+ Iterator<JsonElement> iterator = jsonArray.iterator();
+ while (iterator.hasNext()) {
+ intArray[i] = iterator.next().getAsInt();
+ i++;
+ }
+ return intArray;
+ }
+
public static Integer[] decodeIntegerArray(JsonArray jsonArray) {
if (jsonArray == null) {
return new Integer[0];

Powered by Google App Engine
This is Rietveld 408576698