gvn sync: XXX
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@284 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/super/com/google/gwt/emul/java/util/Arrays.java b/user/super/com/google/gwt/emul/java/util/Arrays.java
index 9e7511a..e3532ff 100644
--- a/user/super/com/google/gwt/emul/java/util/Arrays.java
+++ b/user/super/com/google/gwt/emul/java/util/Arrays.java
@@ -70,12 +70,12 @@
}
var v = new Array();
- for(var i = 0; i < size; ++i){
+ for (var i = 0; i < size; ++i) {
v[i] = array[i];
}
- if(compare != null) {
- var f = function(a,b) {
+ if (compare != null) {
+ var f = function (a,b) {
var c = compare.@java.util.Comparator::compare(Ljava/lang/Object;Ljava/lang/Object;)(a,b);
return c;
}
@@ -84,7 +84,7 @@
v.sort();
}
- for(i = 0; i < size; ++i){
+ for (i = 0; i < size; ++i) {
array[i] = v[i];
}
diff --git a/user/test/com/google/gwt/emultest/java/util/StackTest.java b/user/test/com/google/gwt/emultest/java/util/StackTest.java
index 824d081..1466630 100644
--- a/user/test/com/google/gwt/emultest/java/util/StackTest.java
+++ b/user/test/com/google/gwt/emultest/java/util/StackTest.java
@@ -1,4 +1,19 @@
-// Copyright 2006 Google Inc. All Rights Reserved.
+/*
+ * Copyright 2006 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
package com.google.gwt.emultest.java.util;
import com.google.gwt.junit.client.GWTTestCase;
@@ -6,13 +21,24 @@
import java.util.EmptyStackException;
import java.util.Stack;
+/**
+ * Unit tests for java.util.Stack.
+ */
public class StackTest extends GWTTestCase {
public static final int TEST_SEARCH_SIZE = 10;
public static final int TEST_SIZE = 10;
public static Stack testStack = new Stack();
- /** Checks for emptiness of stack by peeking and popping */
+ static {
+ testStack.push("1");
+ testStack.push("2");
+ testStack.push("3");
+ }
+
+ /**
+ * Checks for emptiness of stack by peeking and popping.
+ */
public void checkEmptiness(Stack s) {
assertTrue(s.empty());
try {
@@ -28,12 +54,16 @@
}
}
- /** Sets module name so that javascript compiler can operate */
+ /**
+ * Sets module name so that javascript compiler can operate.
+ */
public String getModuleName() {
return "com.google.gwt.emultest.EmulSuite";
}
- /** Tests clone on Stacks */
+ /**
+ * Tests clone on Stacks.
+ */
public void testClone() {
Stack large = createLargeStack();
Stack cloned = (Stack) large.clone();
@@ -60,7 +90,9 @@
checkLargeStack(large, TEST_SIZE);
}
- /** tests empty and tries to get emptyStackException as desired */
+ /**
+ * tests empty and tries to get emptyStackException as desired.
+ */
public void testEmptyAndEmptyStackException() {
Stack s = new Stack();
String item = "empty1";
@@ -71,7 +103,9 @@
checkEmptiness(s);
}
- /** Tests pop and peek */
+ /**
+ * Tests pop and peek.
+ */
public void testPopAndPeek() {
int x = testStack.size();
Object item = testStack.peek();
@@ -79,7 +113,9 @@
assertEquals(x - 1, testStack.size());
}
- /** Tests push and peek */
+ /**
+ * Tests push and peek.
+ */
public void testPushAndPeek() {
int x = testStack.size();
Object item = "4";
@@ -137,10 +173,4 @@
return large;
}
- static {
- testStack.push("1");
- testStack.push("2");
- testStack.push("3");
- }
-
}