diff options
author | Elliott Hughes <enh@google.com> | 2010-04-13 15:23:01 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2010-04-13 15:23:01 -0700 |
commit | 52554837a05839f6143c50b973b39ecc9cc30611 (patch) | |
tree | a277bd5715d65a2e695d7c783a2239e5118fce44 /annotation | |
parent | 3106a99ccbe2e2a25bb66266d0ee42d98dd18099 (diff) | |
download | libcore-52554837a05839f6143c50b973b39ecc9cc30611.zip libcore-52554837a05839f6143c50b973b39ecc9cc30611.tar.gz libcore-52554837a05839f6143c50b973b39ecc9cc30611.tar.bz2 |
Remove "Messages" from the annotation module.
Change-Id: I6253fa192bb45fc06db99937aca30ee4dd0bb201
Diffstat (limited to 'annotation')
4 files changed, 5 insertions, 173 deletions
diff --git a/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java b/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java index 0ff79ec..75f1bed 100644 --- a/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java +++ b/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java @@ -19,8 +19,6 @@ package java.lang.annotation; import java.lang.reflect.Method; -import org.apache.harmony.annotation.internal.nls.Messages; - /** * Indicates that an annotation type has changed since it was compiled or * serialized. @@ -46,7 +44,7 @@ public class AnnotationTypeMismatchException extends RuntimeException { * so it may not be human-readable. */ public AnnotationTypeMismatchException(Method element, String foundType) { - super(Messages.getString("annotation.1", element, foundType)); //$NON-NLS-1$ + super("The annotation element " + element + " doesn't match the type " + foundType); this.element = element; this.foundType = foundType; } diff --git a/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java b/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java index a5d2068..9b7aa6a 100644 --- a/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java +++ b/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java @@ -17,8 +17,6 @@ package java.lang.annotation; -import org.apache.harmony.annotation.internal.nls.Messages; - /** * Indicates that an element of an annotation type was accessed that was added * after the type was compiled or serialized. This does not apply to new @@ -43,9 +41,10 @@ public class IncompleteAnnotationException extends RuntimeException { * @param elementName * the name of the incomplete element. */ - public IncompleteAnnotationException( - Class<? extends Annotation> annotationType, String elementName) { - super(Messages.getString("annotation.0", elementName, annotationType.getName())); //$NON-NLS-1$ + public IncompleteAnnotationException(Class<? extends Annotation> annotationType, + String elementName) { + super("The element " + elementName + " is not complete for the annotation " + + annotationType.getName()); this.annotationType = annotationType; this.elementName = elementName; } diff --git a/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/Messages.java b/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/Messages.java deleted file mode 100644 index 91f3548..0000000 --- a/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/Messages.java +++ /dev/null @@ -1,146 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - */ - -/* - * THE FILE HAS BEEN AUTOGENERATED BY MSGTOOL TOOL. - * All changes made to this file manually will be overwritten - * if this tool runs again. Better make changes in the template file. - */ - -// BEGIN android-note -// Redundant code has been removed and is now called from MsgHelp. -// END android-note - -package org.apache.harmony.annotation.internal.nls; - - -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -// BEGIN android-changed -import org.apache.harmony.luni.util.MsgHelp; -// END android-changed - -/** - * This class retrieves strings from a resource bundle and returns them, - * formatting them with MessageFormat when required. - * <p> - * It is used by the system classes to provide national language support, by - * looking up messages in the <code> - * org.apache.harmony.annotation.internal.nls.messages - * </code> - * resource bundle. Note that if this file is not available, or an invalid key - * is looked up, or resource bundle support is not available, the key itself - * will be returned as the associated message. This means that the <em>KEY</em> - * should a reasonable human-readable (english) string. - * - */ -public class Messages { - - // BEGIN android-changed - private static final String sResource = - "org.apache.harmony.annotation.internal.nls.messages"; - // END android-changed - - /** - * Retrieves a message which has no arguments. - * - * @param msg - * String the key to look up. - * @return String the message for that key in the system message bundle. - */ - static public String getString(String msg) { - // BEGIN android-changed - return MsgHelp.getString(sResource, msg); - // END android-changed - } - - /** - * Retrieves a message which takes 1 argument. - * - * @param msg - * String the key to look up. - * @param arg - * Object the object to insert in the formatted output. - * @return String the message for that key in the system message bundle. - */ - static public String getString(String msg, Object arg) { - return getString(msg, new Object[] { arg }); - } - - /** - * Retrieves a message which takes 1 integer argument. - * - * @param msg - * String the key to look up. - * @param arg - * int the integer to insert in the formatted output. - * @return String the message for that key in the system message bundle. - */ - static public String getString(String msg, int arg) { - return getString(msg, new Object[] { Integer.toString(arg) }); - } - - /** - * Retrieves a message which takes 1 character argument. - * - * @param msg - * String the key to look up. - * @param arg - * char the character to insert in the formatted output. - * @return String the message for that key in the system message bundle. - */ - static public String getString(String msg, char arg) { - return getString(msg, new Object[] { String.valueOf(arg) }); - } - - /** - * Retrieves a message which takes 2 arguments. - * - * @param msg - * String the key to look up. - * @param arg1 - * Object an object to insert in the formatted output. - * @param arg2 - * Object another object to insert in the formatted output. - * @return String the message for that key in the system message bundle. - */ - static public String getString(String msg, Object arg1, Object arg2) { - return getString(msg, new Object[] { arg1, arg2 }); - } - - /** - * Retrieves a message which takes several arguments. - * - * @param msg - * String the key to look up. - * @param args - * Object[] the objects to insert in the formatted output. - * @return String the message for that key in the system message bundle. - */ - static public String getString(String msg, Object[] args) { - // BEGIN android-changed - return MsgHelp.getString(sResource, msg, args); - // END android-changed - } - - // BEGIN android-note - // Duplicate code was dropped in favor of using MsgHelp. - // END android-note -} diff --git a/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/messages.properties b/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/messages.properties deleted file mode 100644 index 613c54d..0000000 --- a/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/messages.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# - -# messages for EN locale -annotation.0=The element, {0}, is not complete for the annotation {1}. -annotation.1=The annotation element, {0}, doesn't match the type {1}. |