diff options
Diffstat (limited to 'guava-gwt/src-super/java')
11 files changed, 7 insertions, 186 deletions
diff --git a/guava-gwt/src-super/java/nio/charset/Charset.gwt.xml b/guava-gwt/src-super/java/nio/charset/Charset.gwt.xml deleted file mode 100644 index d23fb8c..0000000 --- a/guava-gwt/src-super/java/nio/charset/Charset.gwt.xml +++ /dev/null @@ -1,4 +0,0 @@ -<module> - <source path=""/> - <inherits name="java.nio.charset.Charset"/> -</module>
\ No newline at end of file diff --git a/guava-gwt/src-super/java/nio/charset/Charset.java b/guava-gwt/src-super/java/nio/charset/Charset.java deleted file mode 100644 index 1463333..0000000 --- a/guava-gwt/src-super/java/nio/charset/Charset.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2012 The Guava Authors - * - * 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 java.nio.charset; - -import java.util.Collections; -import java.util.SortedMap; -import java.util.TreeMap; - -/** - * A minimal GWT emulation of {@link Charset}. - * - * @author Gregory Kick - */ -public abstract class Charset implements Comparable<Charset> { - private static final Charset UTF_8 = new Charset("UTF-8") {}; - - private static final SortedMap<String, Charset> AVAILABLE_CHARSETS = - new TreeMap<String, Charset>(); - static { - AVAILABLE_CHARSETS.put(UTF_8.name(), UTF_8); - } - - public static SortedMap<String, Charset> availableCharsets() { - return Collections.unmodifiableSortedMap(AVAILABLE_CHARSETS); - } - - public static Charset forName(String charsetName) { - if (charsetName == null) { - throw new IllegalArgumentException("Null charset name"); - } - int length = charsetName.length(); - if (length == 0) { - throw new IllegalCharsetNameException(charsetName); - } - for (int i = 0; i < length; i++) { - char c = charsetName.charAt(i); - if ((c >= 'A' && c <= 'Z') - || (c >= 'a' && c <= 'z') - || (c >= '0' && c <= '9') - || (c == '-' && i != 0) - || (c == ':' && i != 0) - || (c == '_' && i != 0) - || (c == '.' && i != 0)) { - continue; - } - throw new IllegalCharsetNameException(charsetName); - } - Charset charset = AVAILABLE_CHARSETS.get(charsetName.toUpperCase()); - if (charset != null) { - return charset; - } - throw new UnsupportedCharsetException(charsetName); - } - - private final String name; - - private Charset(String name) { - this.name = name; - } - - public final String name() { - return name; - } - - public final int compareTo(Charset that) { - return this.name.compareToIgnoreCase(that.name); - } - - public final int hashCode() { - return name.hashCode(); - } - - public final boolean equals(Object o) { - if (o == this) { - return true; - } else if (o instanceof Charset) { - Charset that = (Charset) o; - return this.name.equals(that.name); - } else { - return false; - } - } - - public final String toString() { - return name; - } -} diff --git a/guava-gwt/src-super/java/nio/charset/IllegalCharsetNameException.java b/guava-gwt/src-super/java/nio/charset/IllegalCharsetNameException.java deleted file mode 100644 index 19755e2..0000000 --- a/guava-gwt/src-super/java/nio/charset/IllegalCharsetNameException.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2012 The Guava Authors - * - * 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 java.nio.charset; - -/** - * GWT emulation of {@link IllegalCharsetNameException}. - * - * @author Gregory Kick - */ -public class IllegalCharsetNameException extends IllegalArgumentException { - private final String charsetName; - - public IllegalCharsetNameException(String charsetName) { - super(String.valueOf(charsetName)); - this.charsetName = charsetName; - } - - public String getCharsetName() { - return charsetName; - } -} diff --git a/guava-gwt/src-super/java/nio/charset/UnsupportedCharsetException.java b/guava-gwt/src-super/java/nio/charset/UnsupportedCharsetException.java deleted file mode 100644 index f489a1d..0000000 --- a/guava-gwt/src-super/java/nio/charset/UnsupportedCharsetException.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2012 The Guava Authors - * - * 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 java.nio.charset; - -/** - * GWT emulation of {@link UnsupportedCharsetException}. - * - * @author Gregory Kick - */ -public class UnsupportedCharsetException extends IllegalArgumentException { - private final String charsetName; - - public UnsupportedCharsetException(String charsetName) { - super(String.valueOf(charsetName)); - this.charsetName = charsetName; - } - - public String getCharsetName() { - return charsetName; - } -} diff --git a/guava-gwt/src-super/java/util/super/java/util/concurrent/Callable.java b/guava-gwt/src-super/java/util/super/java/util/concurrent/Callable.java index 607d3f7..548f3a6 100644 --- a/guava-gwt/src-super/java/util/super/java/util/concurrent/Callable.java +++ b/guava-gwt/src-super/java/util/super/java/util/concurrent/Callable.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 The Guava Authors + * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/guava-gwt/src-super/java/util/super/java/util/concurrent/ConcurrentHashMap.java b/guava-gwt/src-super/java/util/super/java/util/concurrent/ConcurrentHashMap.java index 886d8f7..77544b5 100644 --- a/guava-gwt/src-super/java/util/super/java/util/concurrent/ConcurrentHashMap.java +++ b/guava-gwt/src-super/java/util/super/java/util/concurrent/ConcurrentHashMap.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 The Guava Authors + * Copyright (C) 2009 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/guava-gwt/src-super/java/util/super/java/util/concurrent/ConcurrentMap.java b/guava-gwt/src-super/java/util/super/java/util/concurrent/ConcurrentMap.java index 49c05ce..61a8a04 100644 --- a/guava-gwt/src-super/java/util/super/java/util/concurrent/ConcurrentMap.java +++ b/guava-gwt/src-super/java/util/super/java/util/concurrent/ConcurrentMap.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 The Guava Authors + * Copyright (C) 2009 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/guava-gwt/src-super/java/util/super/java/util/concurrent/ExecutionException.java b/guava-gwt/src-super/java/util/super/java/util/concurrent/ExecutionException.java index c1fc0f4..b25f476 100644 --- a/guava-gwt/src-super/java/util/super/java/util/concurrent/ExecutionException.java +++ b/guava-gwt/src-super/java/util/super/java/util/concurrent/ExecutionException.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 The Guava Authors + * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ package java.util.concurrent; /** * Emulation of ExecutionException. * - * @author Charles Fry + * @author fry@google.com (Charles Fry) */ public class ExecutionException extends Exception { protected ExecutionException() { } diff --git a/guava-gwt/src-super/java/util/super/java/util/concurrent/TimeUnit.java b/guava-gwt/src-super/java/util/super/java/util/concurrent/TimeUnit.java index 52f3fb4..2ce1de3 100644 --- a/guava-gwt/src-super/java/util/super/java/util/concurrent/TimeUnit.java +++ b/guava-gwt/src-super/java/util/super/java/util/concurrent/TimeUnit.java @@ -1,8 +1,4 @@ /* - * This file is a modified version of - * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/TimeUnit.java - * which contained the following notice: - * * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at * http://creativecommons.org/publicdomain/zero/1.0/ diff --git a/guava-gwt/src-super/java/util/super/java/util/concurrent/atomic/AtomicInteger.java b/guava-gwt/src-super/java/util/super/java/util/concurrent/atomic/AtomicInteger.java index d9c16a6..ac98dcf 100644 --- a/guava-gwt/src-super/java/util/super/java/util/concurrent/atomic/AtomicInteger.java +++ b/guava-gwt/src-super/java/util/super/java/util/concurrent/atomic/AtomicInteger.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 The Guava Authors + * Copyright (C) 2009 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/guava-gwt/src-super/java/util/super/java/util/concurrent/atomic/AtomicLong.java b/guava-gwt/src-super/java/util/super/java/util/concurrent/atomic/AtomicLong.java index fdd1b34..8696422 100644 --- a/guava-gwt/src-super/java/util/super/java/util/concurrent/atomic/AtomicLong.java +++ b/guava-gwt/src-super/java/util/super/java/util/concurrent/atomic/AtomicLong.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 The Guava Authors + * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |