Javadoc-style metadata is now unsupported; it was deprecated.
We no longer compute metadata, and all metadata methods return empty arrays. The actual APIs will remain in place for another release cycle or two to give library writers a changes to migrate Generators.
Review by: jat
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@5153 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/core/ext/typeinfo/HasMetaData.java b/dev/core/src/com/google/gwt/core/ext/typeinfo/HasMetaData.java
index b1b9615..f2b4ef2 100644
--- a/dev/core/src/com/google/gwt/core/ext/typeinfo/HasMetaData.java
+++ b/dev/core/src/com/google/gwt/core/ext/typeinfo/HasMetaData.java
@@ -29,31 +29,12 @@
package com.google.gwt.core.ext.typeinfo;
/**
- * Manages doc comment metadata for an AST item. The structure of the metadata
- * attempts to mirror the way in which tags and values were originally declared.
- *
- * <p>
- * For example, for the following declaration
- *
- * <pre>
- * /**
- * * @myTag value1 value2
- * * @myTag value3 value4
- * * ...
- * </pre>
- *
- * a call to <code>getMetaData("myTag")</code> would return this array of
- * string arrays
- *
- * <pre>
- *[0][0] = value1
- *[0][1] = value2
- *[1][0] = value3
- *[1][1] = value4
- * </pre>
- *
- * </p>
+ * @deprecated Formerly used to manage Javadoc-comment style metadata. Replaced
+ * by Java 1.5 annotations. All implementations now return empty
+ * arrays. This interface and all implementations methods will be
+ * removed in a future release.
*/
+@Deprecated
public interface HasMetaData {
/**
* Adds additional metadata.
diff --git a/dev/core/src/com/google/gwt/core/ext/typeinfo/JAbstractMethod.java b/dev/core/src/com/google/gwt/core/ext/typeinfo/JAbstractMethod.java
index 925ddb6..4b11ccf 100644
--- a/dev/core/src/com/google/gwt/core/ext/typeinfo/JAbstractMethod.java
+++ b/dev/core/src/com/google/gwt/core/ext/typeinfo/JAbstractMethod.java
@@ -24,6 +24,7 @@
/**
* Common superclass for {@link JMethod} and {@link JConstructor}.
*/
+@SuppressWarnings("deprecation")
public abstract class JAbstractMethod implements HasAnnotations, HasMetaData,
HasTypeParameters {
@@ -31,8 +32,6 @@
private boolean isVarArgs = false;
- private final HasMetaData metaData = new MetaData();
-
private int modifierBits;
private final String name;
@@ -46,7 +45,6 @@
JAbstractMethod(JAbstractMethod srcMethod) {
this.annotations = new Annotations(srcMethod.annotations);
this.isVarArgs = srcMethod.isVarArgs;
- MetaData.copy(this, srcMethod.metaData);
this.modifierBits = srcMethod.modifierBits;
this.name = srcMethod.name;
}
@@ -63,9 +61,9 @@
}
}
- @SuppressWarnings("deprecation")
- public void addMetaData(String tagName, String[] values) {
- metaData.addMetaData(tagName, values);
+ @Deprecated
+ public final void addMetaData(String tagName, String[] values) {
+ throw new UnsupportedOperationException();
}
public void addModifierBits(int bits) {
@@ -94,14 +92,14 @@
*/
public abstract JClassType getEnclosingType();
- @SuppressWarnings("deprecation")
- public String[][] getMetaData(String tagName) {
- return metaData.getMetaData(tagName);
+ @Deprecated
+ public final String[][] getMetaData(String tagName) {
+ return TypeOracle.NO_STRING_ARR_ARR;
}
- @SuppressWarnings("deprecation")
- public String[] getMetaDataTags() {
- return metaData.getMetaDataTags();
+ @Deprecated
+ public final String[] getMetaDataTags() {
+ return TypeOracle.NO_STRINGS;
}
public String getName() {
diff --git a/dev/core/src/com/google/gwt/core/ext/typeinfo/JArrayType.java b/dev/core/src/com/google/gwt/core/ext/typeinfo/JArrayType.java
index f238f41..6972d61 100644
--- a/dev/core/src/com/google/gwt/core/ext/typeinfo/JArrayType.java
+++ b/dev/core/src/com/google/gwt/core/ext/typeinfo/JArrayType.java
@@ -44,12 +44,6 @@
}
@Override
- public void addMetaData(String tagName, String[] values) {
- throw new UnsupportedOperationException("modifying a "
- + getClass().getSimpleName());
- }
-
- @Override
public void addModifierBits(int bits) {
throw new UnsupportedOperationException("modifying a "
+ getClass().getSimpleName());
@@ -131,16 +125,6 @@
}
@Override
- public String[][] getMetaData(String tagName) {
- return TypeOracle.NO_STRING_ARR_ARR;
- }
-
- @Override
- public String[] getMetaDataTags() {
- return TypeOracle.NO_STRINGS;
- }
-
- @Override
public JMethod getMethod(String name, JType[] paramTypes)
throws NotFoundException {
return getOracle().getJavaLangObject().getMethod(name, paramTypes);
diff --git a/dev/core/src/com/google/gwt/core/ext/typeinfo/JClassType.java b/dev/core/src/com/google/gwt/core/ext/typeinfo/JClassType.java
index 9ce3961..d3ab066 100644
--- a/dev/core/src/com/google/gwt/core/ext/typeinfo/JClassType.java
+++ b/dev/core/src/com/google/gwt/core/ext/typeinfo/JClassType.java
@@ -25,6 +25,7 @@
/**
* Type used to represent any non-primitive type.
*/
+@SuppressWarnings("deprecation")
public abstract class JClassType extends JType implements HasAnnotations,
HasMetaData {
@@ -333,7 +334,10 @@
public abstract void addImplementedInterface(JClassType intf);
- public abstract void addMetaData(String tagName, String[] values);
+ @Deprecated
+ public final void addMetaData(String tagName, String[] values) {
+ throw new UnsupportedOperationException();
+ }
public abstract void addModifierBits(int bits);
@@ -344,7 +348,7 @@
if (isParameterized != null && isParameterized.getBaseType() == type) {
return isParameterized;
}
-
+
JRawType isRaw = supertype.isRawType();
if (isRaw != null && isRaw.getBaseType() == type) {
return isRaw.asParameterizedByWildcards();
@@ -381,9 +385,15 @@
public abstract JClassType[] getImplementedInterfaces();
- public abstract String[][] getMetaData(String tagName);
+ @Deprecated
+ public final String[][] getMetaData(String tagName) {
+ return TypeOracle.NO_STRING_ARR_ARR;
+ }
- public abstract String[] getMetaDataTags();
+ @Deprecated
+ public final String[] getMetaDataTags() {
+ return TypeOracle.NO_STRINGS;
+ }
public abstract JMethod getMethod(String name, JType[] paramTypes)
throws NotFoundException;
diff --git a/dev/core/src/com/google/gwt/core/ext/typeinfo/JDelegatingClassType.java b/dev/core/src/com/google/gwt/core/ext/typeinfo/JDelegatingClassType.java
index cbb866a..9897459 100644
--- a/dev/core/src/com/google/gwt/core/ext/typeinfo/JDelegatingClassType.java
+++ b/dev/core/src/com/google/gwt/core/ext/typeinfo/JDelegatingClassType.java
@@ -36,12 +36,6 @@
}
@Override
- public final void addMetaData(String tagName, String[] values) {
- throw new UnsupportedOperationException("modifying a "
- + getClass().getSimpleName());
- }
-
- @Override
public final void addModifierBits(int bits) {
throw new UnsupportedOperationException("modifying a "
+ getClass().getSimpleName());
@@ -132,16 +126,6 @@
return baseType.getJNISignature();
}
- @Override
- public String[][] getMetaData(String tagName) {
- return baseType.getMetaData(tagName);
- }
-
- @Override
- public String[] getMetaDataTags() {
- return baseType.getMetaDataTags();
- }
-
/**
* Subclasses will generally need to echo modified methods.
*/
diff --git a/dev/core/src/com/google/gwt/core/ext/typeinfo/JField.java b/dev/core/src/com/google/gwt/core/ext/typeinfo/JField.java
index d5e7958..943ca7f 100644
--- a/dev/core/src/com/google/gwt/core/ext/typeinfo/JField.java
+++ b/dev/core/src/com/google/gwt/core/ext/typeinfo/JField.java
@@ -21,14 +21,13 @@
/**
* Represents a field declaration.
*/
+@SuppressWarnings("deprecation")
public class JField implements HasAnnotations, HasMetaData {
private final Annotations annotations;
private final JClassType enclosingType;
- private final HasMetaData metaData = new MetaData();
-
private int modifierBits;
private final String name;
@@ -54,13 +53,11 @@
this.modifierBits = srcField.modifierBits;
this.name = srcField.name;
this.type = srcField.type;
-
- MetaData.copy(this, srcField);
}
- @SuppressWarnings("deprecation")
- public void addMetaData(String tagName, String[] values) {
- metaData.addMetaData(tagName, values);
+ @Deprecated
+ public final void addMetaData(String tagName, String[] values) {
+ throw new UnsupportedOperationException();
}
public void addModifierBits(int modifierBits) {
@@ -75,14 +72,14 @@
return enclosingType;
}
- @SuppressWarnings("deprecation")
- public String[][] getMetaData(String tagName) {
- return metaData.getMetaData(tagName);
+ @Deprecated
+ public final String[][] getMetaData(String tagName) {
+ return TypeOracle.NO_STRING_ARR_ARR;
}
- @SuppressWarnings("deprecation")
- public String[] getMetaDataTags() {
- return metaData.getMetaDataTags();
+ @Deprecated
+ public final String[] getMetaDataTags() {
+ return TypeOracle.NO_STRINGS;
}
public String getName() {
diff --git a/dev/core/src/com/google/gwt/core/ext/typeinfo/JParameter.java b/dev/core/src/com/google/gwt/core/ext/typeinfo/JParameter.java
index 332969f..f6f6f7f 100644
--- a/dev/core/src/com/google/gwt/core/ext/typeinfo/JParameter.java
+++ b/dev/core/src/com/google/gwt/core/ext/typeinfo/JParameter.java
@@ -21,12 +21,11 @@
/**
* Represents a parameter in a declaration.
*/
+@SuppressWarnings("deprecation")
public class JParameter implements HasAnnotations, HasMetaData {
private final Annotations annotations;
- private final HasMetaData metaData = new MetaData();
-
private final String name;
private JType type;
@@ -53,12 +52,11 @@
this.type = srcParam.type;
this.name = srcParam.name;
this.annotations = new Annotations(srcParam.annotations);
- MetaData.copy(this, srcParam);
}
- @SuppressWarnings("deprecation")
- public void addMetaData(String tagName, String[] values) {
- metaData.addMetaData(tagName, values);
+ @Deprecated
+ public final void addMetaData(String tagName, String[] values) {
+ throw new UnsupportedOperationException();
}
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
@@ -69,14 +67,14 @@
return enclosingMethod;
}
- @SuppressWarnings("deprecation")
- public String[][] getMetaData(String tagName) {
- return metaData.getMetaData(tagName);
+ @Deprecated
+ public final String[][] getMetaData(String tagName) {
+ return TypeOracle.NO_STRING_ARR_ARR;
}
- @SuppressWarnings("deprecation")
- public String[] getMetaDataTags() {
- return metaData.getMetaDataTags();
+ @Deprecated
+ public final String[] getMetaDataTags() {
+ return TypeOracle.NO_STRINGS;
}
public String getName() {
diff --git a/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java b/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java
index 718adee..8430ccd 100644
--- a/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java
+++ b/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java
@@ -46,8 +46,6 @@
private final Members members = new Members(this);
- private final HasMetaData metaData = new MetaData();
-
private int modifierBits;
private final String name;
@@ -101,11 +99,6 @@
interfaces = Lists.add(interfaces, intf);
}
- @SuppressWarnings("deprecation")
- public void addMetaData(String tagName, String[] values) {
- metaData.addMetaData(tagName, values);
- }
-
public void addModifierBits(int bits) {
modifierBits |= bits;
}
@@ -178,16 +171,6 @@
return "L" + packageName + typeName + ";";
}
- @SuppressWarnings("deprecation")
- public String[][] getMetaData(String tagName) {
- return metaData.getMetaData(tagName);
- }
-
- @SuppressWarnings("deprecation")
- public String[] getMetaDataTags() {
- return metaData.getMetaDataTags();
- }
-
@Override
public JMethod getMethod(String name, JType[] paramTypes)
throws NotFoundException {
diff --git a/dev/core/src/com/google/gwt/core/ext/typeinfo/MetaData.java b/dev/core/src/com/google/gwt/core/ext/typeinfo/MetaData.java
deleted file mode 100644
index b5006c3..0000000
--- a/dev/core/src/com/google/gwt/core/ext/typeinfo/MetaData.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright 2007 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.core.ext.typeinfo;
-
-import com.google.gwt.dev.util.collect.Lists;
-import com.google.gwt.dev.util.collect.Maps;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-class MetaData implements HasMetaData {
-
- /**
- * Copy metadata from one metadata container to another. Perhaps overly
- * paranoid but HasMetaData elements are mutable.
- *
- * @param dest
- * @param src
- */
- @SuppressWarnings("deprecation")
- static void copy(HasMetaData dest, HasMetaData src) {
- String[] tagNames = src.getMetaDataTags();
- for (String tagName : tagNames) {
- String[][] tagValueSets = src.getMetaData(tagName);
- for (String[] tagValues : tagValueSets) {
- dest.addMetaData(tagName, tagValues);
- }
- }
- }
-
- private Map<String, List<String[]>> tagNameToStringArrayList = Maps.create();
-
- @SuppressWarnings("unchecked")
- public void addMetaData(String tagName, String[] values) {
- List<String[]> list = tagNameToStringArrayList.get(tagName);
- if (list == null) {
- list = (List) Lists.create((Object) values);
- tagNameToStringArrayList = Maps.put(tagNameToStringArrayList, tagName,
- list);
- } else {
- List<String[]> newList = Lists.add(list, values);
- if (newList != list) {
- tagNameToStringArrayList = Maps.put(tagNameToStringArrayList, tagName,
- newList);
- }
- }
- }
-
- public String[][] getMetaData(String tagName) {
- List<String[]> list = tagNameToStringArrayList.get(tagName);
- if (list != null) {
- return list.toArray(TypeOracle.NO_STRING_ARR_ARR);
- } else {
- return TypeOracle.NO_STRING_ARR_ARR;
- }
- }
-
- public String[] getMetaDataTags() {
- return tagNameToStringArrayList.keySet().toArray(TypeOracle.NO_STRINGS);
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- final Set<String> keys = tagNameToStringArrayList.keySet();
- String[] tags = keys.toArray(TypeOracle.NO_STRINGS);
- Arrays.sort(tags);
- for (int i = 0; i < tags.length; i++) {
- sb.append(tags[i]);
- sb.append(" => ");
-
- boolean isFirstList = true;
- List<String[]> stringArrayList = tagNameToStringArrayList.get(tags[i]);
- for (String[] values : stringArrayList) {
- if (isFirstList) {
- isFirstList = false;
- } else {
- sb.append(", ");
- }
- sb.append('[');
- boolean needComma = false;
- for (int j = 0; j < values.length; j++) {
- if (needComma) {
- sb.append(", ");
- } else {
- needComma = true;
- }
- sb.append(values[j]);
- }
- sb.append(']');
- }
- }
- return sb.toString();
- }
-
-}
diff --git a/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java b/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java
index cee006a..0318998 100644
--- a/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java
+++ b/dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java
@@ -15,14 +15,10 @@
*/
package com.google.gwt.core.ext.typeinfo;
-import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.typeinfo.JWildcardType.BoundType;
-import com.google.gwt.dev.generator.GenUtil;
import com.google.gwt.dev.jjs.InternalCompilerException;
import com.google.gwt.dev.shell.JsValueGlue;
import com.google.gwt.dev.util.collect.HashMap;
-import com.google.gwt.dev.util.collect.HashSet;
import com.google.gwt.dev.util.collect.IdentityHashMap;
import org.apache.commons.collections.map.AbstractReferenceMap;
@@ -145,15 +141,6 @@
static final String[][] NO_STRING_ARR_ARR = new String[0][];
static final String[] NO_STRINGS = new String[0];
- static String combine(String[] strings, int startIndex) {
- StringBuffer sb = new StringBuffer();
- for (int i = startIndex; i < strings.length; i++) {
- String s = strings[i];
- sb.append(s);
- }
- return sb.toString();
- }
-
static String[] modifierBitsToNames(int bits) {
List<String> strings = new ArrayList<String>();
@@ -287,11 +274,10 @@
*
* TODO: make not public?
*/
- public void finish(TreeLogger logger) {
+ public void finish() {
JClassType[] newTypes = recentTypes.toArray(NO_JCLASSES);
computeHierarchyRelationships(newTypes);
computeSingleJsoImplData(newTypes);
- consumeTypeArgMetaData(logger, newTypes);
recentTypes.clear();
}
@@ -713,181 +699,6 @@
}
}
- private void consumeTypeArgMetaData(TreeLogger logger, JClassType[] types) {
- if (GenUtil.warnAboutMetadata()) {
- logger = logger.branch(
- TreeLogger.DEBUG,
- "Scanning source for uses of the deprecated "
- + TAG_TYPEARGS
- + " javadoc annotation; please use Java parameterized types instead",
- null);
- }
- for (int i = 0; i < types.length; i++) {
- JClassType type = types[i];
- // CTORS not supported yet
-
- TreeLogger branch = logger.branch(TreeLogger.DEBUG, "Type "
- + type.getQualifiedSourceName(), null);
-
- consumeTypeArgMetaData(branch, type.getMethods());
- consumeTypeArgMetaData(branch, type.getFields());
- }
- }
-
- private void consumeTypeArgMetaData(TreeLogger logger, JField[] fields) {
- TreeLogger branch;
- for (int i = 0; i < fields.length; i++) {
- JField field = fields[i];
-
- String[][] tokensArray = field.getMetaData(TAG_TYPEARGS);
- if (tokensArray.length == 0) {
- // No tag.
- continue;
- }
-
- try {
- String msg = "Field " + field.getName();
- branch = logger.branch(TreeLogger.TRACE, msg, null);
-
- if (tokensArray.length > 1) {
- // Too many.
- branch.log(TreeLogger.WARN, "Metadata error on field '"
- + field.getName() + "' in type '" + field.getEnclosingType()
- + "': expecting at most one " + TAG_TYPEARGS
- + " (the last one will be used)", null);
- }
-
- // (1) Parse it.
- // (2) Update the field's type.
- // If it wasn't a valid parameterized type, parse() would've thrown.
- //
- JType fieldType = field.getType();
- String[] token = tokensArray[tokensArray.length - 1];
- JType resultingType = determineActualType(branch, fieldType, token, 0);
-
- if (GenUtil.warnAboutMetadata()) {
- branch.log(TreeLogger.WARN, "Deprecated use of " + TAG_TYPEARGS
- + " for field " + field.getName() + "; Please use "
- + resultingType.getParameterizedQualifiedSourceName()
- + " as the field's type", null);
- }
-
- field.setType(resultingType);
- } catch (UnableToCompleteException e) {
- // Continue; the problem will have been logged.
- //
- }
- }
- }
-
- private void consumeTypeArgMetaData(TreeLogger logger, JMethod[] methods) {
- TreeLogger branch;
- for (int i = 0; i < methods.length; i++) {
- JMethod method = methods[i];
-
- String[][] tokensArray = method.getMetaData(TAG_TYPEARGS);
- if (tokensArray.length == 0) {
- // No tag.
- continue;
- }
- try {
- String msg = "Method " + method.getReadableDeclaration();
- branch = logger.branch(TreeLogger.TRACE, msg, null);
-
- // Okay, parse each one and correlate it to a part of the decl.
- //
- boolean returnTypeHandled = false;
- Set<JParameter> paramsAlreadySet = new HashSet<JParameter>();
- for (int j = 0; j < tokensArray.length; j++) {
- String[] tokens = tokensArray[j];
- // It is either referring to the return type or a parameter type.
- //
- if (tokens.length == 0) {
- // Expecting at least something.
- //
- branch.log(TreeLogger.WARN,
- "Metadata error: expecting tokens after " + TAG_TYPEARGS, null);
- throw new UnableToCompleteException();
- }
-
- // See if the first token is a parameter name.
- //
- JParameter param = method.findParameter(tokens[0]);
- if (param != null) {
- if (!paramsAlreadySet.contains(param)) {
- // These are type args for a param.
- //
- JType resultingType = determineActualType(branch,
- param.getType(), tokens, 1);
- param.setType(resultingType);
-
- if (GenUtil.warnAboutMetadata()) {
- branch.log(TreeLogger.WARN, "Deprecated use of " + TAG_TYPEARGS
- + " for parameter " + param.getName() + "; Please use "
- + resultingType.getParameterizedQualifiedSourceName()
- + " as the parameter's type", null);
- }
- paramsAlreadySet.add(param);
- } else {
- // This parameter type has already been set.
- //
- msg = "Metadata error: duplicate attempt to specify type args for parameter '"
- + param.getName() + "'";
- branch.log(TreeLogger.WARN, msg, null);
- throw new UnableToCompleteException();
- }
- } else {
- // It's either referring to the return type or a bad param name.
- //
- if (!returnTypeHandled) {
- JType resultingType = determineActualType(branch,
- method.getReturnType(), tokens, 0);
- method.setReturnType(resultingType);
-
- if (GenUtil.warnAboutMetadata()) {
- branch.log(TreeLogger.WARN, "Deprecated use of " + TAG_TYPEARGS
- + " for the return type; Please use "
- + resultingType.getParameterizedQualifiedSourceName()
- + " as the method's return type", null);
- }
- returnTypeHandled = true;
- } else {
- // The return type has already been set.
- //
- msg = "Metadata error: duplicate attempt to specify type args for the return type";
- branch.log(TreeLogger.WARN, msg, null);
- }
- }
- }
- } catch (UnableToCompleteException e) {
- // Continue; will already have been logged.
- //
- }
- }
- }
-
- /*
- * Given a declared type and some number of type arguments determine what the
- * actual type should be.
- */
- private JType determineActualType(TreeLogger logger, JType declType,
- String[] tokens, int startIndex) throws UnableToCompleteException {
- // These are type args for a param.
- //
- JType leafType = declType.getLeafType();
- String typeName = leafType.getQualifiedSourceName();
- JType resultingType = parseTypeArgTokens(logger, typeName, tokens,
- startIndex);
- JArrayType arrayType = declType.isArray();
- if (arrayType != null) {
- arrayType.setLeafType(resultingType);
-
- return declType;
- }
-
- return resultingType;
- }
-
private JType parseImpl(String type) throws NotFoundException,
ParseException, BadTypeArgsException {
if (type.endsWith("[]")) {
@@ -1014,23 +825,6 @@
return typeArgs;
}
- private JType parseTypeArgTokens(TreeLogger logger, String maybeRawType,
- String[] tokens, int startIndex) throws UnableToCompleteException {
- String munged = combine(tokens, startIndex).trim();
- String toParse = maybeRawType + munged;
- JType parameterizedType;
- try {
- parameterizedType = parse(toParse);
- } catch (IllegalArgumentException e) {
- logger.log(TreeLogger.WARN, e.getMessage(), e);
- throw new UnableToCompleteException();
- } catch (TypeOracleException e) {
- logger.log(TreeLogger.WARN, e.getMessage(), e);
- throw new UnableToCompleteException();
- }
- return parameterizedType;
- }
-
private void removeSingleJsoImplData(JClassType... types) {
JClassType jsoType = findType(JsValueGlue.JSO_CLASS);
if (jsoType == null) {
diff --git a/dev/core/src/com/google/gwt/dev/generator/GenUtil.java b/dev/core/src/com/google/gwt/dev/generator/GenUtil.java
index 2f8176f..b52f043 100644
--- a/dev/core/src/com/google/gwt/dev/generator/GenUtil.java
+++ b/dev/core/src/com/google/gwt/dev/generator/GenUtil.java
@@ -21,12 +21,11 @@
public class GenUtil {
/**
- * If <code>true</code>, the default, generators should warn when a client
- * uses old-style javadoc metadata rather than Java 1.5 annotations. If
- * <code>false</code>, generators should not warn.
+ * @deprecated All metadata has been removed, use Java Annotations instead.
*/
+ @Deprecated
public static boolean warnAboutMetadata() {
- return System.getProperty("gwt.nowarn.metadata") == null;
+ return false;
}
/**
diff --git a/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java b/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java
index a82b705..10a7660 100644
--- a/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java
+++ b/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java
@@ -92,7 +92,7 @@
public CompilerImpl() {
super(new INameEnvironmentImpl(),
DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- getCompilerOptions(true), new ICompilerRequestorImpl(),
+ getCompilerOptions(), new ICompilerRequestorImpl(),
new DefaultProblemFactory(Locale.getDefault()));
}
@@ -193,8 +193,7 @@
return new JdtCompiler().doCompile(units);
}
- public static CompilerOptions getCompilerOptions(
- boolean enableDocCommentSupport) {
+ public static CompilerOptions getCompilerOptions() {
Map<String, String> settings = new HashMap<String, String>();
settings.put(CompilerOptions.OPTION_LineNumberAttribute,
CompilerOptions.GENERATE);
@@ -220,11 +219,6 @@
settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_1_6);
- // This is needed by TypeOracleBuilder to parse metadata.
- if (enableDocCommentSupport) {
- settings.put(CompilerOptions.OPTION_DocCommentSupport,
- CompilerOptions.ENABLED);
- }
return new CompilerOptions(settings);
}
diff --git a/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java b/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java
index ff51cf7..e735dc5 100644
--- a/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java
+++ b/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java
@@ -16,7 +16,6 @@
package com.google.gwt.dev.javac;
import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.typeinfo.HasMetaData;
import com.google.gwt.core.ext.typeinfo.HasTypeParameters;
import com.google.gwt.core.ext.typeinfo.JAbstractMethod;
import com.google.gwt.core.ext.typeinfo.JAnnotationMethod;
@@ -40,7 +39,6 @@
import com.google.gwt.core.ext.typeinfo.JWildcardType.BoundType;
import com.google.gwt.dev.javac.CompilationUnit.State;
import com.google.gwt.dev.javac.impl.Shared;
-import com.google.gwt.dev.util.Empty;
import com.google.gwt.dev.util.collect.HashMap;
import com.google.gwt.dev.util.collect.HashSet;
import com.google.gwt.dev.util.collect.IdentityHashMap;
@@ -58,7 +56,6 @@
import org.eclipse.jdt.internal.compiler.ast.Expression;
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.eclipse.jdt.internal.compiler.ast.Initializer;
-import org.eclipse.jdt.internal.compiler.ast.Javadoc;
import org.eclipse.jdt.internal.compiler.ast.MemberValuePair;
import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
import org.eclipse.jdt.internal.compiler.ast.NameReference;
@@ -82,9 +79,6 @@
import org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding;
import org.eclipse.jdt.internal.compiler.lookup.WildcardBinding;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.StringReader;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.Array;
@@ -92,7 +86,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.regex.Pattern;
/**
* Builds or rebuilds a {@link com.google.gwt.core.ext.typeinfo.TypeOracle} from
@@ -101,7 +94,6 @@
public class TypeOracleMediator {
private static final JClassType[] NO_JCLASSES = new JClassType[0];
- private static final Pattern PATTERN_WHITESPACE = Pattern.compile("\\s");
/**
* Returns the binary name of a type. This is the same name that would be
@@ -141,97 +133,6 @@
return classType.getQualifiedSourceName();
}
- static boolean parseMetaDataTags(String unitSource, HasMetaData hasMetaData,
- Javadoc javadoc) {
-
- int start = javadoc.sourceStart;
- int end = javadoc.sourceEnd;
- if (start < 0 || end > unitSource.length() || start > end) {
- // Invalid.
- return false;
- }
- String comment = unitSource.substring(start, end + 1);
- BufferedReader reader = new BufferedReader(new StringReader(
- comment.toString()));
- String activeTag = null;
- final List<String> tagValues = new ArrayList<String>();
- try {
- boolean firstLine = true;
- for (String line = reader.readLine(); line != null; line = reader.readLine()) {
- if (firstLine) {
- firstLine = false;
- int commentStart = line.indexOf("/**");
- if (commentStart == -1) {
- // Malformed.
- return false;
- }
- line = line.substring(commentStart + 3);
- }
-
- if (activeTag == null && line.indexOf('@') < 0) {
- continue;
- }
-
- String[] tokens = PATTERN_WHITESPACE.split(line);
- boolean canIgnoreStar = true;
- for (int i = 0; i < tokens.length; i++) {
- String token = tokens[i];
-
- // Check for the end.
- if (token.endsWith("*/")) {
- token = token.substring(0, token.length() - 2);
- }
-
- // Check for an ignored leading star.
- if (canIgnoreStar && token.startsWith("*")) {
- token = token.substring(1);
- canIgnoreStar = false;
- }
-
- // Decide what to do with whatever is left.
- if (token.length() > 0) {
- canIgnoreStar = false;
- if (token.startsWith("@")) {
- // A new tag has been introduced.
- // Subsequent tokens will attach to it.
- // Make sure we finish the previously active tag before moving on.
- //
- if (activeTag != null) {
- finishTag(hasMetaData, activeTag, tagValues);
- }
- activeTag = token.substring(1);
- } else if (activeTag != null) {
- // Attach this item to the active tag.
- //
- tagValues.add(token);
- } else {
- // Just ignore it.
- //
- }
- }
- }
- }
- } catch (IOException e) {
- return false;
- }
-
- // To catch the last batch of values, if any.
- //
- finishTag(hasMetaData, activeTag, tagValues);
- return true;
- }
-
- @SuppressWarnings("deprecation")
- private static void finishTag(HasMetaData hasMetaData, String tagName,
- List<String> tagValues) {
- // Add the values even if the list is empty, because the presence of the
- // tag itself might be important.
- //
- String[] values = tagValues.toArray(Empty.STRINGS);
- hasMetaData.addMetaData(tagName, values);
- tagValues.clear();
- }
-
/**
* Returns the value associated with a JDT constant.
*/
@@ -404,8 +305,7 @@
for (CompiledClass compiledClass : compiledClasses) {
if (unresolvedTypes.remove(compiledClass.getRealClassType())) {
TypeDeclaration typeDeclaration = compiledClass.getTypeDeclaration();
- if (!resolveTypeDeclaration(cudLogger, unit.getSource(),
- typeDeclaration)) {
+ if (!resolveTypeDeclaration(cudLogger, typeDeclaration)) {
logger.log(TreeLogger.WARN,
"Unexpectedly unable to fully resolve type "
+ compiledClass.getSourceName());
@@ -418,7 +318,7 @@
sourceMapper.clear();
tvMapper.clear();
- typeOracle.finish(logger);
+ typeOracle.finish();
}
public TypeOracle getTypeOracle() {
@@ -473,7 +373,8 @@
identifierToValue.put(identifier, elementValue);
}
- return AnnotationProxyFactory.create(clazz, Maps.normalize(identifierToValue));
+ return AnnotationProxyFactory.create(clazz,
+ Maps.normalize(identifierToValue));
}
private JRealClassType createType(CompiledClass compiledClass) {
@@ -903,8 +804,8 @@
return true;
}
- private boolean resolveField(TreeLogger logger, String unitSource,
- JClassType enclosingType, FieldDeclaration jfield) {
+ private boolean resolveField(TreeLogger logger, JClassType enclosingType,
+ FieldDeclaration jfield) {
if (jfield instanceof Initializer) {
// Pretend we didn't see this.
@@ -942,23 +843,15 @@
}
field.setType(fieldType);
- // Get tags.
- //
- if (jfield.javadoc != null) {
- if (!parseMetaDataTags(unitSource, field, jfield.javadoc)) {
- return false;
- }
- }
-
return true;
}
- private boolean resolveFields(TreeLogger logger, String unitSource,
- JClassType type, FieldDeclaration[] jfields) {
+ private boolean resolveFields(TreeLogger logger, JClassType type,
+ FieldDeclaration[] jfields) {
if (jfields != null) {
for (int i = 0; i < jfields.length; i++) {
FieldDeclaration jfield = jfields[i];
- if (!resolveField(logger, unitSource, type, jfield)) {
+ if (!resolveField(logger, type, jfield)) {
return false;
}
}
@@ -966,8 +859,8 @@
return true;
}
- private boolean resolveMethod(TreeLogger logger, String unitSource,
- JClassType enclosingType, AbstractMethodDeclaration jmethod) {
+ private boolean resolveMethod(TreeLogger logger, JClassType enclosingType,
+ AbstractMethodDeclaration jmethod) {
if (jmethod instanceof Clinit) {
// Pretend we didn't see this.
@@ -1053,23 +946,15 @@
return false;
}
- // Get tags.
- //
- if (jmethod.javadoc != null) {
- if (!parseMetaDataTags(unitSource, method, jmethod.javadoc)) {
- return false;
- }
- }
-
return true;
}
- private boolean resolveMethods(TreeLogger logger, String unitSource,
- JClassType type, AbstractMethodDeclaration[] jmethods) {
+ private boolean resolveMethods(TreeLogger logger, JClassType type,
+ AbstractMethodDeclaration[] jmethods) {
if (jmethods != null) {
for (int i = 0; i < jmethods.length; i++) {
AbstractMethodDeclaration jmethod = jmethods[i];
- if (!resolveMethod(logger, unitSource, type, jmethod)) {
+ if (!resolveMethod(logger, type, jmethod)) {
return false;
}
}
@@ -1371,7 +1256,7 @@
return null;
}
- private boolean resolveTypeDeclaration(TreeLogger logger, String unitSource,
+ private boolean resolveTypeDeclaration(TreeLogger logger,
TypeDeclaration clazz) {
SourceTypeBinding binding = clazz.binding;
assert (binding.constantPoolName() != null);
@@ -1443,7 +1328,7 @@
// Resolve fields.
//
FieldDeclaration[] fields = clazz.fields;
- if (!resolveFields(logger, unitSource, jtype, fields)) {
+ if (!resolveFields(logger, jtype, fields)) {
return false;
}
@@ -1459,18 +1344,10 @@
// bounds resolution for generic methods must happen after the resolution
// of methods is complete.
AbstractMethodDeclaration[] methods = clazz.methods;
- if (!resolveMethods(logger, unitSource, jtype, methods)) {
+ if (!resolveMethods(logger, jtype, methods)) {
return false;
}
- // Get tags.
- //
- if (clazz.javadoc != null) {
- if (!parseMetaDataTags(unitSource, jtype, clazz.javadoc)) {
- return false;
- }
- }
-
return true;
}
diff --git a/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java b/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java
index fcdf196..de70859 100644
--- a/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java
+++ b/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java
@@ -447,7 +447,7 @@
IErrorHandlingPolicy pol = DefaultErrorHandlingPolicies.proceedWithAllProblems();
IProblemFactory probFact = new DefaultProblemFactory(Locale.getDefault());
ICompilerRequestor req = new ICompilerRequestorImpl();
- CompilerOptions options = JdtCompiler.getCompilerOptions(true);
+ CompilerOptions options = JdtCompiler.getCompilerOptions();
// This is only needed by TypeOracleBuilder to parse metadata.
options.docCommentSupport = false;
diff --git a/dev/core/test/com/google/gwt/core/ext/typeinfo/JDelegatingClassTypeTestBase.java b/dev/core/test/com/google/gwt/core/ext/typeinfo/JDelegatingClassTypeTestBase.java
index da56a75..88aec30 100644
--- a/dev/core/test/com/google/gwt/core/ext/typeinfo/JDelegatingClassTypeTestBase.java
+++ b/dev/core/test/com/google/gwt/core/ext/typeinfo/JDelegatingClassTypeTestBase.java
@@ -50,8 +50,6 @@
validateAnnotations(preSubMethod.getAnnotations(),
postSubMethod.getAnnotations());
- validateMetaData(preSubMethod, postSubMethod);
-
JParameter[] preSubParams = preSubMethod.getParameters();
JParameter[] postSubParams = postSubMethod.getParameters();
@@ -63,7 +61,6 @@
validateAnnotations(preSubParam.getAnnotations(),
postSubParam.getAnnotations());
- validateMetaData(preSubParam, postSubParam);
assertEquals(substitution.getSubstitution(preSubParam.getType()),
postSubParam.getType());
@@ -234,28 +231,6 @@
}
}
- @SuppressWarnings("deprecation")
- protected static void validateMetaData(HasMetaData md1, HasMetaData md2) {
- validateMetaDataTags(md1, md2);
-
- String[] md1TagNames = md1.getMetaDataTags();
- String[] md2TagNames = md2.getMetaDataTags();
-
- for (int i = 0; i < md1TagNames.length; ++i) {
- assertEquals(md1TagNames[i], md2TagNames[i]);
-
- String[][] md1TagValues = md1.getMetaData(md1TagNames[i]);
- String[][] md2TagValues = md2.getMetaData(md2TagNames[i]);
-
- assertTrue(Arrays.deepEquals(md1TagValues, md2TagValues));
- }
- }
-
- @SuppressWarnings("deprecation")
- protected static void validateMetaDataTags(HasMetaData md1, HasMetaData md2) {
- assertEquals(md1.getMetaDataTags().length, md2.getMetaDataTags().length);
- }
-
protected static void validateMethodSubstitution(JMethod preSubMethod,
JMethod postSubMethod, Substitution substitution) {
@@ -302,8 +277,6 @@
validateAnnotations(preSubstitution.getAnnotations(),
postSubstituion.getAnnotations());
- validateMetaData(preSubstitution, postSubstituion);
-
assertEquals(preSubstitution.getName(), postSubstituion.getName());
// assertEquals(preSubstitution.getSubstitution(substitution),
// postSubstituion);
@@ -493,28 +466,6 @@
/**
* Test method for
- * {@link com.google.gwt.core.ext.typeinfo.JDelegatingClassType#getMetaData(java.lang.String)}.
- */
- public void testGetMetaData() throws NotFoundException {
- JDelegatingClassType testType = getTestType();
- JClassType baseType = testType.getBaseType();
-
- validateMetaData(baseType, testType);
- }
-
- /**
- * Test method for
- * {@link com.google.gwt.core.ext.typeinfo.JDelegatingClassType#getMetaDataTags()}.
- */
- public void testGetMetaDataTags() throws NotFoundException {
- JDelegatingClassType testType = getTestType();
- JClassType baseType = testType.getBaseType();
-
- validateMetaDataTags(baseType, testType);
- }
-
- /**
- * Test method for
* {@link com.google.gwt.core.ext.typeinfo.JDelegatingClassType#getMethod(java.lang.String, com.google.gwt.core.ext.typeinfo.JType[])}.
*/
public void testGetMethod() throws NotFoundException {
diff --git a/dev/core/test/com/google/gwt/dev/javac/TypeOracleMediatorTest.java b/dev/core/test/com/google/gwt/dev/javac/TypeOracleMediatorTest.java
index d2a3687..98377eb 100644
--- a/dev/core/test/com/google/gwt/dev/javac/TypeOracleMediatorTest.java
+++ b/dev/core/test/com/google/gwt/dev/javac/TypeOracleMediatorTest.java
@@ -59,21 +59,6 @@
public abstract String getSource();
}
- private static void assertEqualArraysUnordered(Object[] expected,
- Object[] actual) {
- assertEquals(expected.length, actual.length);
- for (Object element : expected) {
- boolean matched = false;
- for (Object element2 : actual) {
- if (element.equals(element2)) {
- matched = true;
- break;
- }
- }
- assertTrue(matched);
- }
- }
-
private static void assertIsAssignable(JClassType from, JClassType to) {
assertTrue("'" + from + "' should be assignable to '" + to + "'",
from.isAssignableTo(to));
@@ -501,90 +486,6 @@
}
};
- protected CheckedMockCompilationUnit CU_MetaData = new CheckedMockCompilationUnit(
- "test", "MetaData") {
-
- public void check(JClassType type) throws NotFoundException {
- {
- String[] tags = type.getMetaDataTags();
- assertEqualArraysUnordered(new String[] {"gwt.tag1"}, tags);
- String[][] md = type.getMetaData("gwt.tag1");
- assertEquals("tagValueA", md[0][0]);
- assertEquals("tagValueB", md[0][1]);
- assertEquals("tagValueC", md[1][0]);
- assertEquals("tagValueD", md[1][1]);
- }
-
- {
- JMethod method = type.getOverloads("foo")[0]; // will succeed
- String[] tags = method.getMetaDataTags();
- assertEqualArraysUnordered(new String[] {"gwt.tag2", "gwt.tag3"}, tags);
-
- String[][] mdNotThere = method.getMetaData("not there");
- assertNotNull(mdNotThere);
- assertEquals(0, mdNotThere.length);
-
- String[][] mdTag2 = method.getMetaData("gwt.tag2");
- assertEquals(2, mdTag2.length);
- assertEquals(3, mdTag2[0].length);
- assertEquals("tagValueV", mdTag2[0][0]);
- assertEquals("tagValueW", mdTag2[0][1]);
- assertEquals("tagValueX", mdTag2[0][2]);
- assertEquals(2, mdTag2[1].length);
- assertEquals("tagValueY", mdTag2[1][0]);
- assertEquals("tagValueZ", mdTag2[1][1]);
-
- String[][] mdTag3 = method.getMetaData("gwt.tag3");
- assertEquals(1, mdTag3.length);
- assertEquals(0, mdTag3[0].length);
- }
-
- {
- JField field = type.getField("bar");
- String[] tags = field.getMetaDataTags();
- assertEqualArraysUnordered(new String[] {"gwt.tag4"}, tags);
-
- String[][] mdTag4 = field.getMetaData("gwt.tag4");
- assertEquals(2, mdTag4.length);
- assertEquals(2, mdTag4[0].length);
- assertEquals("tagValueQ", mdTag4[0][0]);
- assertEquals("tagValueR", mdTag4[0][1]);
- assertEquals(1, mdTag4[1].length);
- assertEquals("tagValueS", mdTag4[1][0]);
- }
-
- {
- JField field = type.getField("noMd");
- String[] tags = field.getMetaDataTags();
- assertEquals(0, tags.length);
- }
- }
-
- public String getSource() {
- StringBuffer sb = new StringBuffer();
- sb.append("package test;\n");
- sb.append("/**\n");
- sb.append(" * Class metadata.\n");
- sb.append(" * @gwt.tag1 tagValueA tagValueB\n");
- sb.append(" * @gwt.tag1 tagValueC tagValueD\n");
- sb.append(" */\n");
- sb.append("public class MetaData {\n");
- sb.append(" /**\n");
- sb.append(" * Method metadata.\n");
- sb.append(" * @gwt.tag2 tagValueV tagValueW tagValueX\n");
- sb.append(" * @gwt.tag2 tagValueY tagValueZ\n");
- sb.append(" * @gwt.tag3*/\n");
- sb.append(" private void foo(int x) { };\n");
- sb.append("\n");
- sb.append(" /**@gwt.tag4 tagValueQ tagValueR\n"); // funny start
- sb.append(" * @gwt.tag4 tagValueS*/\n"); // funny end
- sb.append(" private Object bar = null;\n");
- sb.append(" private Object noMd = null;\n");
- sb.append("}\n");
- return sb.toString();
- }
- };
-
protected CheckedMockCompilationUnit CU_MethodsAndParams = new CheckedMockCompilationUnit(
"test", "Methods") {
@@ -920,14 +821,6 @@
assertEquals(3, types.length);
}
- public void testMetaData() throws TypeOracleException {
- units.add(CU_Object);
- units.add(CU_MetaData);
- compileAndRefresh();
- JClassType[] types = typeOracle.getTypes();
- assertEquals(2, types.length);
- }
-
public void testMethodsAndParams() throws TypeOracleException {
units.add(CU_Object);
units.add(CU_Throwable);
diff --git a/dev/core/test/com/google/gwt/dev/javac/impl/JdtBehaviorTest.java b/dev/core/test/com/google/gwt/dev/javac/impl/JdtBehaviorTest.java
index af83fca..793189a 100644
--- a/dev/core/test/com/google/gwt/dev/javac/impl/JdtBehaviorTest.java
+++ b/dev/core/test/com/google/gwt/dev/javac/impl/JdtBehaviorTest.java
@@ -58,7 +58,7 @@
public CompilerImpl(INameEnvironment environment,
ICompilerRequestor requestor) {
super(environment, DefaultErrorHandlingPolicies.proceedWithAllProblems(),
- JdtCompiler.getCompilerOptions(false), requestor,
+ JdtCompiler.getCompilerOptions(), requestor,
new DefaultProblemFactory(Locale.getDefault()));
}
}
diff --git a/user/src/com/google/gwt/benchmarks/BenchmarkReport.java b/user/src/com/google/gwt/benchmarks/BenchmarkReport.java
index 637b0c5..8a4bfdb 100644
--- a/user/src/com/google/gwt/benchmarks/BenchmarkReport.java
+++ b/user/src/com/google/gwt/benchmarks/BenchmarkReport.java
@@ -19,11 +19,8 @@
import com.google.gwt.benchmarks.client.impl.Trial;
import com.google.gwt.benchmarks.rebind.BenchmarkGenerator;
import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.typeinfo.HasAnnotations;
-import com.google.gwt.core.ext.typeinfo.HasMetaData;
import com.google.gwt.core.ext.typeinfo.JClassType;
import com.google.gwt.core.ext.typeinfo.JMethod;
-import com.google.gwt.core.ext.typeinfo.TypeOracle;
import com.google.gwt.dev.util.Util;
import com.google.gwt.util.tools.Utility;
@@ -203,8 +200,6 @@
*/
private class ReportXml {
- private Map<String, Element> categoryElementMap = new HashMap<String, Element>();
-
private Date date = new Date();
private String version = "unknown";
@@ -221,8 +216,7 @@
TestCase test = entry.getKey();
List<BenchmarkResults> results = entry.getValue();
BenchmarkXml xml = new BenchmarkXml(test, results);
- Element categoryElement = getCategoryElement(doc, report,
- xml.metaData.getCategory().getClassName());
+ Element categoryElement = getCategoryElement(doc, report);
categoryElement.appendChild(xml.toElement(doc));
}
@@ -238,31 +232,15 @@
*
* @return The matching category element
*/
- private Element getCategoryElement(Document doc, Element report, String name) {
- Element e = categoryElementMap.get(name);
-
- if (e != null) {
- return e;
- }
-
+ private Element getCategoryElement(Document doc, Element report) {
Element categoryElement = doc.createElement("category");
- categoryElementMap.put(name, categoryElement);
- CategoryImpl category = testCategories.get(name);
- categoryElement.setAttribute("name", category.getName());
- categoryElement.setAttribute("description", category.getDescription());
-
+ categoryElement.setAttribute("name", "");
+ categoryElement.setAttribute("description", "");
report.appendChild(categoryElement);
-
return categoryElement;
}
}
- private static final String GWT_BENCHMARK_CATEGORY = "gwt.benchmark.category";
-
- private static final String GWT_BENCHMARK_DESCRIPTION = "gwt.benchmark.description";
-
- private static final String GWT_BENCHMARK_NAME = "gwt.benchmark.name";
-
private static File findSourceFile(JClassType clazz) {
final char separator = File.separator.charAt(0);
String filePath = clazz.getPackage().getName().replace('.', separator)
@@ -285,37 +263,12 @@
return path.split(File.pathSeparator);
}
- private static String getSimpleMetaData(HasMetaData hasMetaData, String name) {
- String[][] allValues = hasMetaData.getMetaData(name);
-
- if (allValues == null) {
- return null;
- }
-
- StringBuffer result = new StringBuffer();
-
- for (int i = 0; i < allValues.length; ++i) {
- String[] values = allValues[i];
- for (int j = 0; j < values.length; ++j) {
- result.append(values[j]);
- result.append(" ");
- }
- }
-
- String resultString = result.toString().trim();
- return resultString.equals("") ? null : resultString;
- }
-
private Parser parser = new Parser();
- private Map<String, CategoryImpl> testCategories = new HashMap<String, CategoryImpl>();
-
private Map<String, Map<String, MetaData>> testMetaData = new HashMap<String, Map<String, MetaData>>();
private Map<TestCase, List<BenchmarkResults>> testResults = new HashMap<TestCase, List<BenchmarkResults>>();
- private TypeOracle typeOracle;
-
public BenchmarkReport() {
}
@@ -324,19 +277,10 @@
* (category, name, description, etc...) is recorded from the TypeOracle.
*
* @param logger to log the process
- * @param deprecationBranch to log usages of old-style metadata
* @param benchmarkClass The benchmark class to record. Must not be
* <code>null</code>.
- * @param typeOracle The <code>TypeOracle</code> for the compilation session
- * must not be <code>null</code>.
*/
- public void addBenchmark(TreeLogger logger, TreeLogger deprecationBranch,
- JClassType benchmarkClass, TypeOracle typeOracle) {
-
- this.typeOracle = typeOracle;
- String categoryType = getBenchmarkCategory(deprecationBranch,
- benchmarkClass);
-
+ public void addBenchmark(TreeLogger logger, JClassType benchmarkClass) {
Map<String, JMethod> zeroArgMethods = BenchmarkGenerator.getNotOverloadedTestMethods(benchmarkClass);
Map<String, JMethod> parameterizedMethods = BenchmarkGenerator.getParameterizedTestMethods(
benchmarkClass, TreeLogger.NULL);
@@ -354,14 +298,6 @@
// Add all of the benchmark methods
for (JMethod method : testMethods) {
String methodName = method.getName();
- String methodCategoryType = getBenchmarkCategory(deprecationBranch,
- method);
- if (methodCategoryType == null) {
- methodCategoryType = categoryType;
- }
- CategoryImpl methodCategory = getCategory(deprecationBranch,
- methodCategoryType);
-
String methodSource = parser.getMethod(logger, method);
StringBuffer sourceBuffer = (methodSource == null) ? null
: new StringBuffer(methodSource);
@@ -370,8 +306,8 @@
getComment(sourceBuffer, summary, comment);
MetaData metaData = new MetaData(benchmarkClass.toString(), methodName,
- (sourceBuffer != null) ? sourceBuffer.toString() : null,
- methodCategory, methodName, summary.toString());
+ (sourceBuffer != null) ? sourceBuffer.toString() : null, methodName,
+ summary.toString());
metaDataMap.put(methodName, metaData);
}
}
@@ -433,58 +369,6 @@
// docOut.close();
}
- private <T extends HasMetaData & HasAnnotations> String getBenchmarkCategory(
- TreeLogger deprecationBranch, T element) {
- String category = getSimpleMetaData(element, GWT_BENCHMARK_CATEGORY);
- if (category != null && deprecationBranch != null) {
- deprecationBranch.log(TreeLogger.WARN, GWT_BENCHMARK_CATEGORY + " has "
- + "been deprecated with no replacement.", null);
- }
- return category;
- }
-
- private CategoryImpl getCategory(TreeLogger deprecationBranch, String name) {
- CategoryImpl c = testCategories.get(name);
-
- if (c != null) {
- return c;
- }
-
- c = getCategoryMetaData(deprecationBranch, name);
- testCategories.put(name, c);
- return c;
- }
-
- private CategoryImpl getCategoryMetaData(TreeLogger deprecationBranch,
- String typeName) {
- if (typeName == null) {
- return new CategoryImpl(null, "", "");
- }
-
- JClassType categoryType = typeOracle.findType(typeName);
-
- if (categoryType == null) {
- return new CategoryImpl(typeName, "", "");
- }
-
- String categoryName = getSimpleMetaData(categoryType, GWT_BENCHMARK_NAME);
- String categoryDescription = getSimpleMetaData(categoryType,
- GWT_BENCHMARK_DESCRIPTION);
-
- if ((categoryName != null || categoryDescription != null)
- && deprecationBranch != null) {
- deprecationBranch.log(TreeLogger.WARN, GWT_BENCHMARK_NAME + " and "
- + GWT_BENCHMARK_DESCRIPTION + " have been deprecated with no "
- + "replacement", null);
- }
-
- categoryName = categoryName == null ? "" : categoryName;
- categoryDescription = categoryDescription == null ? ""
- : categoryDescription;
-
- return new CategoryImpl(typeName, categoryName, categoryDescription);
- }
-
/**
* Parses out the JavaDoc comment from a string of source code. Returns the
* first sentence summary in <code>summary</code> and the body of the entire
diff --git a/user/src/com/google/gwt/benchmarks/CategoryImpl.java b/user/src/com/google/gwt/benchmarks/CategoryImpl.java
deleted file mode 100644
index b1bf1de..0000000
--- a/user/src/com/google/gwt/benchmarks/CategoryImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2008 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.benchmarks;
-
-/**
- * Benchmark Category information. Part of the overall MetaData for a Benchmark.
- * It is the backing store for com.google.gwt.junit.client.Category.
- */
-class CategoryImpl {
-
- private String className;
- private String description;
- private String name;
-
- public CategoryImpl(String className, String name, String description) {
- this.className = className;
- this.name = name;
- this.description = description;
- }
-
- public String getClassName() {
- return className;
- }
-
- public String getDescription() {
- return description;
- }
-
- public String getName() {
- return name;
- }
-}
diff --git a/user/src/com/google/gwt/benchmarks/MetaData.java b/user/src/com/google/gwt/benchmarks/MetaData.java
index 7e57c9b..816837e 100644
--- a/user/src/com/google/gwt/benchmarks/MetaData.java
+++ b/user/src/com/google/gwt/benchmarks/MetaData.java
@@ -20,8 +20,6 @@
*/
class MetaData {
- private CategoryImpl category;
-
private String className;
private String methodName;
@@ -33,11 +31,10 @@
private String testName;
public MetaData(String className, String methodName, String sourceCode,
- CategoryImpl category, String testName, String testDescription) {
+ String testName, String testDescription) {
this.className = className;
this.methodName = methodName;
this.sourceCode = sourceCode;
- this.category = category;
this.testName = testName;
this.testDescription = testDescription;
}
@@ -53,10 +50,6 @@
return md.className.equals(className) && md.methodName.equals(methodName);
}
- public CategoryImpl getCategory() {
- return category;
- }
-
public String getClassName() {
return className;
}
diff --git a/user/src/com/google/gwt/benchmarks/rebind/BenchmarkGenerator.java b/user/src/com/google/gwt/benchmarks/rebind/BenchmarkGenerator.java
index 4c5863f..1abd4be 100644
--- a/user/src/com/google/gwt/benchmarks/rebind/BenchmarkGenerator.java
+++ b/user/src/com/google/gwt/benchmarks/rebind/BenchmarkGenerator.java
@@ -16,7 +16,6 @@
package com.google.gwt.benchmarks.rebind;
import com.google.gwt.benchmarks.BenchmarkShell;
-import com.google.gwt.benchmarks.client.Benchmark;
import com.google.gwt.benchmarks.client.IterationTimeLimit;
import com.google.gwt.benchmarks.client.RangeEnum;
import com.google.gwt.benchmarks.client.RangeField;
@@ -32,7 +31,6 @@
import com.google.gwt.core.ext.typeinfo.JField;
import com.google.gwt.core.ext.typeinfo.JMethod;
import com.google.gwt.core.ext.typeinfo.JParameter;
-import com.google.gwt.dev.generator.GenUtil;
import com.google.gwt.dev.generator.ast.ForLoop;
import com.google.gwt.dev.generator.ast.MethodCall;
import com.google.gwt.dev.generator.ast.Statement;
@@ -63,8 +61,6 @@
private static final String BEGIN_PREFIX = "begin";
- private static final String BENCHMARK_CLASS = Benchmark.class.getName();
-
private static final String BENCHMARK_PARAM_META = "gwt.benchmark.param";
private static final String BENCHMARK_RESULTS_CLASS = BenchmarkResults.class.getName();
@@ -235,24 +231,15 @@
});
}
- private TreeLogger deprecationBranch;
-
@Override
public void writeSource() throws UnableToCompleteException {
super.writeSource();
- if (GenUtil.warnAboutMetadata()) {
- deprecationBranch = logger.branch(TreeLogger.TRACE,
- "Scanning Benchmarks for deprecated annotations; please see "
- + BENCHMARK_CLASS + " for more information", null);
- }
-
generateEmptyFunc(getSourceWriter());
implementZeroArgTestMethods();
implementParameterizedTestMethods();
generateAsyncCode();
- BenchmarkShell.getReport().addBenchmark(logger, deprecationBranch,
- getRequestedClass(), getTypeOracle());
+ BenchmarkShell.getReport().addBenchmark(logger, getRequestedClass());
}
/**
@@ -486,58 +473,6 @@
return defaultTimeout;
}
- private Map<String, String> getParamMetaData(JMethod method, MutableLong bound)
- throws UnableToCompleteException {
- String[][] allValues = method.getMetaData(BENCHMARK_PARAM_META);
-
- if (allValues == null || allValues.length == 0) {
- return getAnnotationMetaData(method, bound);
- }
-
- if (deprecationBranch != null) {
- deprecationBranch.log(TreeLogger.WARN, "Deprecated use of "
- + BENCHMARK_PARAM_META + " at " + method.getEnclosingType() + " in "
- + method + "; please use the new Benchmark JDK 1.5 annotations in "
- + "com.google.gwt.benchmark.client", null);
- }
-
- Map<String, String> params = new HashMap<String, String>();
-
- for (int i = 0; i < allValues.length; ++i) {
- String[] values = allValues[i];
- StringBuffer result = new StringBuffer();
- for (int j = 0; j < values.length; ++j) {
- result.append(values[j]);
- result.append(" ");
- }
- String expr = result.toString();
- String[] lhsAndRhs = expr.split("=");
- String paramName = lhsAndRhs[0].trim();
- String[] nameExprs = paramName.split(" ");
- if (nameExprs.length > 1 && nameExprs[1].equals("-limit")) {
- paramName = nameExprs[0];
- // Make sure this is the last parameter
- JParameter[] parameters = method.getParameters();
- if (!parameters[parameters.length - 1].getName().equals(paramName)) {
- JClassType cls = method.getEnclosingType();
- String msg = "Error at "
- + cls
- + "."
- + method.getName()
- + ": only the last parameter of a method can be marked with the -limit flag";
- logger.log(TreeLogger.ERROR, msg, null);
- throw new UnableToCompleteException();
- }
-
- bound.value = getDefaultTimeout();
- }
- String paramValue = lhsAndRhs[1].trim();
- params.put(paramName, paramValue);
- }
-
- return params;
- }
-
private void implementParameterizedTestMethods()
throws UnableToCompleteException {
@@ -562,7 +497,8 @@
sw.println();
MutableLong bound = new MutableLong();
- Map<String, String> metaDataByParams = getParamMetaData(method, bound);
+ Map<String, String> metaDataByParams = getAnnotationMetaData(method,
+ bound);
validateParams(method, metaDataByParams);
JParameter[] methodParams = method.getParameters();
@@ -614,19 +550,12 @@
Statements testBench = genBenchTarget(beginMethod, endMethod, paramNames,
new Statement(new MethodCall(method.getName(), paramNames)));
- StringBuffer recordResultsCode = new StringBuffer(
- BENCHMARK_RESULTS_CLASS
- + " results = __getOrCreateTestResult();\n"
- + TRIAL_CLASS
- + " trial = new "
- + TRIAL_CLASS
- + "();\n"
- + "trial.setRunTimeMillis( "
- + testTimingName
- + " - "
- + setupTimingName
- + " );\n"
- + "java.util.Map<String, String> variables = trial.getVariables();\n");
+ StringBuffer recordResultsCode = new StringBuffer(BENCHMARK_RESULTS_CLASS
+ + " results = __getOrCreateTestResult();\n" + TRIAL_CLASS
+ + " trial = new " + TRIAL_CLASS + "();\n"
+ + "trial.setRunTimeMillis( " + testTimingName + " - "
+ + setupTimingName + " );\n"
+ + "java.util.Map<String, String> variables = trial.getVariables();\n");
for (String paramName : paramNames) {
recordResultsCode.append("variables.put( \"").append(paramName).append(
diff --git a/user/src/com/google/gwt/i18n/rebind/AbstractLocalizableImplCreator.java b/user/src/com/google/gwt/i18n/rebind/AbstractLocalizableImplCreator.java
index 5f89f40..b562788 100644
--- a/user/src/com/google/gwt/i18n/rebind/AbstractLocalizableImplCreator.java
+++ b/user/src/com/google/gwt/i18n/rebind/AbstractLocalizableImplCreator.java
@@ -52,8 +52,8 @@
AbstractGeneratorClassCreator {
static String generateConstantOrMessageClass(TreeLogger logger,
- TreeLogger deprecatedLogger, GeneratorContext context, GwtLocale locale,
- JClassType targetClass) throws UnableToCompleteException {
+ GeneratorContext context, GwtLocale locale, JClassType targetClass)
+ throws UnableToCompleteException {
TypeOracle oracle = context.getTypeOracle();
JClassType constantsClass;
JClassType messagesClass;
@@ -95,11 +95,9 @@
resourceList = ResourceFactory.getBundle(logger, targetClass, locale,
assignableToConstants);
} catch (MissingResourceException e) {
- throw error(
- logger,
+ throw error(logger,
"Localization failed; there must be at least one resource accessible through"
- + " the classpath in package '"
- + packageName
+ + " the classpath in package '" + packageName
+ "' whose base name is '"
+ ResourceFactory.getResourceName(targetClass) + "'");
} catch (IllegalArgumentException e) {
@@ -124,18 +122,15 @@
// Now that we have all the information set up, process the class
if (constantsWithLookupClass.isAssignableFrom(targetClass)) {
ConstantsWithLookupImplCreator c = new ConstantsWithLookupImplCreator(
- logger, deprecatedLogger, writer, targetClass, resourceList,
- context.getTypeOracle());
+ logger, writer, targetClass, resourceList, context.getTypeOracle());
c.emitClass(logger, generatedLocale);
} else if (constantsClass.isAssignableFrom(targetClass)) {
- ConstantsImplCreator c = new ConstantsImplCreator(logger,
- deprecatedLogger, writer, targetClass, resourceList,
- context.getTypeOracle());
+ ConstantsImplCreator c = new ConstantsImplCreator(logger, writer,
+ targetClass, resourceList, context.getTypeOracle());
c.emitClass(logger, generatedLocale);
} else {
- MessagesImplCreator messages = new MessagesImplCreator(logger,
- deprecatedLogger, writer, targetClass, resourceList,
- context.getTypeOracle());
+ MessagesImplCreator messages = new MessagesImplCreator(logger, writer,
+ targetClass, resourceList, context.getTypeOracle());
messages.emitClass(logger, generatedLocale);
}
context.commit(logger, pw);
@@ -242,11 +237,6 @@
private ResourceList resourceList;
/**
- * Logger to use for deprecated warnings.
- */
- private TreeLogger deprecatedLogger;
-
- /**
* True if the class being generated uses Constants-style annotations/quoting.
*/
private boolean isConstants;
@@ -254,16 +244,13 @@
/**
* Constructor for <code>AbstractLocalizableImplCreator</code>.
*
- * @param deprecatedLogger logger to use for deprecated warnings.
* @param writer writer
* @param targetClass current target
* @param resourceList backing resource
*/
- public AbstractLocalizableImplCreator(TreeLogger logger,
- TreeLogger deprecatedLogger, SourceWriter writer, JClassType targetClass,
- ResourceList resourceList, boolean isConstants) {
+ public AbstractLocalizableImplCreator(TreeLogger logger, SourceWriter writer,
+ JClassType targetClass, ResourceList resourceList, boolean isConstants) {
super(writer, targetClass);
- this.deprecatedLogger = deprecatedLogger;
this.resourceList = resourceList;
this.isConstants = isConstants;
try {
@@ -322,31 +309,6 @@
if (key != null) {
return key.value();
}
- String[][] id = method.getMetaData(LocalizableGenerator.GWT_KEY);
- if (id.length > 0) {
- warnOnMetadata(method);
- if (id[0].length == 0) {
- logger.log(TreeLogger.WARN, method
- + " had a mislabeled gwt.key, using default key", null);
- } else {
- String tag = id[0][0];
- return tag;
- }
- }
return AnnotationsResource.getKey(logger, keyGenerator, method, isConstants);
}
-
- /**
- * Issue a warning about deprecated metadata.
- *
- * @param method method to warn about
- */
- void warnOnMetadata(JMethod method) {
- if (deprecatedLogger != null) {
- deprecatedLogger.log(TreeLogger.WARN, "Deprecated metadata found on "
- + method.getEnclosingType().getSimpleSourceName() + "."
- + method.getName() + ";svn use annotations instead", null);
- }
- }
-
}
diff --git a/user/src/com/google/gwt/i18n/rebind/ConstantsImplCreator.java b/user/src/com/google/gwt/i18n/rebind/ConstantsImplCreator.java
index d971ecd..b407d69 100644
--- a/user/src/com/google/gwt/i18n/rebind/ConstantsImplCreator.java
+++ b/user/src/com/google/gwt/i18n/rebind/ConstantsImplCreator.java
@@ -46,17 +46,16 @@
* Constructor for <code>ConstantsImplCreator</code>.
*
* @param logger logger to print errors
- * @param deprecatedLogger logger to use for deprecated warnings
* @param writer <code>Writer</code> to print to
* @param localizableClass class/interface to conform to
* @param resourceList resource bundle used to generate the class
* @param oracle types
* @throws UnableToCompleteException
*/
- public ConstantsImplCreator(TreeLogger logger, TreeLogger deprecatedLogger, SourceWriter writer,
- JClassType localizableClass, ResourceList resourceList,
- TypeOracle oracle) throws UnableToCompleteException {
- super(logger, deprecatedLogger, writer, localizableClass, resourceList, true);
+ public ConstantsImplCreator(TreeLogger logger, SourceWriter writer,
+ JClassType localizableClass, ResourceList resourceList, TypeOracle oracle)
+ throws UnableToCompleteException {
+ super(logger, writer, localizableClass, resourceList, true);
try {
JClassType stringClass = oracle.getType(String.class.getName());
JClassType mapClass = oracle.getType(Map.class.getName());
@@ -94,7 +93,8 @@
protected void checkConstantMethod(TreeLogger logger, JMethod method)
throws UnableToCompleteException {
if (method.getParameters().length > 0) {
- throw error(logger, "Methods in interfaces extending Constant must have no parameters");
+ throw error(logger,
+ "Methods in interfaces extending Constant must have no parameters");
}
checkReturnType(logger, method);
}
@@ -108,10 +108,10 @@
throws UnableToCompleteException {
JType returnType = method.getReturnType();
JPrimitiveType primitive = returnType.isPrimitive();
- if (primitive != null && (primitive == JPrimitiveType.BOOLEAN
- || primitive == JPrimitiveType.DOUBLE
- || primitive == JPrimitiveType.FLOAT
- || primitive == JPrimitiveType.INT)) {
+ if (primitive != null
+ && (primitive == JPrimitiveType.BOOLEAN
+ || primitive == JPrimitiveType.DOUBLE
+ || primitive == JPrimitiveType.FLOAT || primitive == JPrimitiveType.INT)) {
return;
}
JArrayType arrayType = returnType.isArray();
@@ -131,16 +131,18 @@
JParameterizedType paramType = returnType.isParameterized();
if (paramType != null) {
JClassType[] typeArgs = paramType.getTypeArgs();
- if (typeArgs.length != 2 || !typeArgs[0].getQualifiedSourceName().equals("java.lang.String")
+ if (typeArgs.length != 2
+ || !typeArgs[0].getQualifiedSourceName().equals("java.lang.String")
|| !typeArgs[1].getQualifiedSourceName().equals("java.lang.String")) {
throw error(logger,
- "Map Methods in interfaces extending Constant must be raw or <String, String>");
+ "Map Methods in interfaces extending Constant must be raw or <String, String>");
}
}
return;
}
- throw error(logger, "Methods in interfaces extending Constant must have a return type of "
- + "String/int/float/boolean/double/String[]/Map");
+ throw error(logger,
+ "Methods in interfaces extending Constant must have a return type of "
+ + "String/int/float/boolean/double/String[]/Map");
}
@Override
diff --git a/user/src/com/google/gwt/i18n/rebind/ConstantsWithLookupImplCreator.java b/user/src/com/google/gwt/i18n/rebind/ConstantsWithLookupImplCreator.java
index 0e4aa9c..89813c9 100644
--- a/user/src/com/google/gwt/i18n/rebind/ConstantsWithLookupImplCreator.java
+++ b/user/src/com/google/gwt/i18n/rebind/ConstantsWithLookupImplCreator.java
@@ -34,26 +34,22 @@
class ConstantsWithLookupImplCreator extends ConstantsImplCreator {
final JMethod[] allInterfaceMethods;
- private final Map<String, AbstractMethodCreator> namesToMethodCreators =
- new HashMap<String, AbstractMethodCreator>();
+ private final Map<String, AbstractMethodCreator> namesToMethodCreators = new HashMap<String, AbstractMethodCreator>();
/**
* Constructor for <code>ConstantsWithLookupImplCreator</code>.
*
* @param logger logger to print errors
- * @param deprecatedLogger logger to use for deprecated warnings
* @param writer <code>Writer</code> to print to
* @param localizableClass class/interface to conform to
* @param resourceList resource bundle used to generate the class
* @param oracle types
* @throws UnableToCompleteException
*/
- ConstantsWithLookupImplCreator(TreeLogger logger,
- TreeLogger deprecatedLogger, SourceWriter writer,
- JClassType localizableClass, ResourceList resourceList,
- TypeOracle oracle) throws UnableToCompleteException {
- super(logger, deprecatedLogger, writer, localizableClass, resourceList,
- oracle);
+ ConstantsWithLookupImplCreator(TreeLogger logger, SourceWriter writer,
+ JClassType localizableClass, ResourceList resourceList, TypeOracle oracle)
+ throws UnableToCompleteException {
+ super(logger, writer, localizableClass, resourceList, oracle);
try {
// Boolean
@@ -122,12 +118,13 @@
// Map - use erased type for matching
JType mapType = oracle.parse(Map.class.getName()).getErasedType();
- namesToMethodCreators.put("getMap", new LookupMethodCreator(this, mapType) {
- @Override
- public String getReturnTypeName() {
- return ConstantsMapMethodCreator.GENERIC_STRING_MAP_TYPE;
- }
- });
+ namesToMethodCreators.put("getMap",
+ new LookupMethodCreator(this, mapType) {
+ @Override
+ public String getReturnTypeName() {
+ return ConstantsMapMethodCreator.GENERIC_STRING_MAP_TYPE;
+ }
+ });
// String
JType stringType = oracle.parse(String.class.getName());
@@ -188,7 +185,8 @@
checkConstantMethod(logger, method);
} else {
if (params.length != 1
- || !params[0].getType().getQualifiedSourceName().equals("java.lang.String")) {
+ || !params[0].getType().getQualifiedSourceName().equals(
+ "java.lang.String")) {
throw error(logger, method + " must have a single String argument.");
}
checkReturnType(logger, method);
diff --git a/user/src/com/google/gwt/i18n/rebind/LocalizableGenerator.java b/user/src/com/google/gwt/i18n/rebind/LocalizableGenerator.java
index 0003bab..eb18c77 100644
--- a/user/src/com/google/gwt/i18n/rebind/LocalizableGenerator.java
+++ b/user/src/com/google/gwt/i18n/rebind/LocalizableGenerator.java
@@ -24,7 +24,6 @@
import com.google.gwt.core.ext.typeinfo.JClassType;
import com.google.gwt.core.ext.typeinfo.NotFoundException;
import com.google.gwt.core.ext.typeinfo.TypeOracle;
-import com.google.gwt.dev.generator.GenUtil;
import com.google.gwt.i18n.client.Constants;
import com.google.gwt.i18n.client.ConstantsWithLookup;
import com.google.gwt.i18n.client.Messages;
@@ -45,7 +44,7 @@
public static final String CONSTANTS_WITH_LOOKUP_NAME = ConstantsWithLookup.class.getName();
public static final String MESSAGES_NAME = Messages.class.getName();
-
+
private static long lastReloadCount = -1;
/**
* The token representing the locale property controlling Localization.
@@ -75,20 +74,20 @@
// property. Basically,
//
// 1) If the locale is specified by the user using a request parameter
- // or a meta tag, AND
+ // or a meta tag, AND
// 2) The locale matches or is a parent of one of the locales
- // exposed in the application's gwt.xml file, THEN
+ // exposed in the application's gwt.xml file, THEN
//
// the value returned by getPropertyValue() will be:
//
// a) the locale specified by the user, OR
// b) the parent locale, if an exact match between the user-specified
- // locale and the exposed locales cannot be found
+ // locale and the exposed locales cannot be found
//
// If the locale is not specified by the user as a request parameter
// or via a meta tag, or if the locale is formatted incorrectly,
// getPropertyValue() will return "default".
- locale = propertyOracle.getPropertyValue(logger, PROP_LOCALE);
+ locale = propertyOracle.getPropertyValue(logger, PROP_LOCALE);
} catch (BadPropertyValueException e) {
logger.log(TreeLogger.ERROR, "Could not parse specified locale", e);
throw new UnableToCompleteException();
@@ -113,17 +112,11 @@
throw new UnableToCompleteException();
}
- TreeLogger deprecatedLogger = null;
- if (GenUtil.warnAboutMetadata()) {
- deprecatedLogger = logger.branch(TreeLogger.TRACE,
- "Checking for deprecated metadata", null);
- }
-
GwtLocale locale = LocaleUtils.getLocaleFactory().fromString(localeName);
// Link current locale and interface type to correct implementation class.
String generatedClass = AbstractLocalizableImplCreator.generateConstantOrMessageClass(
- logger, deprecatedLogger , context, locale, targetClass);
+ logger, context, locale, targetClass);
if (generatedClass != null) {
return generatedClass;
}
diff --git a/user/src/com/google/gwt/i18n/rebind/MessagesImplCreator.java b/user/src/com/google/gwt/i18n/rebind/MessagesImplCreator.java
index 53eb9a5..7db1b1f 100644
--- a/user/src/com/google/gwt/i18n/rebind/MessagesImplCreator.java
+++ b/user/src/com/google/gwt/i18n/rebind/MessagesImplCreator.java
@@ -30,7 +30,7 @@
* standard <code>AbstractGeneratorClassCreator</code>.
*/
class MessagesImplCreator extends AbstractLocalizableImplCreator {
-
+
/**
* Constructor for <code>MessagesImplCreator</code>.
*
@@ -39,15 +39,12 @@
* @param resourceList resource bundle used to generate the class
* @param oracle types
* @param logger logger to print errors
- * @param deprecatedLogger logger for deprecated metadata warnings
* @throws UnableToCompleteException
*/
- public MessagesImplCreator(TreeLogger logger, TreeLogger deprecatedLogger,
- SourceWriter writer, JClassType localizableClass,
- ResourceList resourceList, TypeOracle oracle)
+ public MessagesImplCreator(TreeLogger logger, SourceWriter writer,
+ JClassType localizableClass, ResourceList resourceList, TypeOracle oracle)
throws UnableToCompleteException {
- super(logger, deprecatedLogger, writer, localizableClass, resourceList,
- false);
+ super(logger, writer, localizableClass, resourceList, false);
try {
JClassType stringClass = oracle.getType(String.class.getName());
register(stringClass, new MessagesMethodCreator(this));
diff --git a/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java b/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
index 273ef04..340ed28 100644
--- a/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
+++ b/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
@@ -29,7 +29,6 @@
import com.google.gwt.core.ext.typeinfo.JType;
import com.google.gwt.core.ext.typeinfo.NotFoundException;
import com.google.gwt.core.ext.typeinfo.TypeOracle;
-import com.google.gwt.dev.generator.GenUtil;
import com.google.gwt.dev.generator.NameFactory;
import com.google.gwt.dev.javac.TypeOracleMediator;
import com.google.gwt.dev.util.Util;
@@ -66,7 +65,6 @@
* as well as the necessary type and field serializers.
*/
class ProxyCreator {
- private static final String ENTRY_POINT_TAG = "gwt.defaultEntryPoint";
private static final Map<JPrimitiveType, ResponseReader> JPRIMITIVETYPE_TO_RESPONSEREADER = new HashMap<JPrimitiveType, ResponseReader>();
@@ -206,14 +204,6 @@
throws UnableToCompleteException {
TypeOracle typeOracle = context.getTypeOracle();
- TreeLogger javadocAnnotationDeprecationBranch = null;
- if (GenUtil.warnAboutMetadata()) {
- javadocAnnotationDeprecationBranch = logger.branch(TreeLogger.TRACE,
- "Scanning this RemoteService for deprecated annotations; "
- + "Please see " + RemoteServiceRelativePath.class.getName()
- + " for more information.", null);
- }
-
JClassType serviceAsync = typeOracle.findType(serviceIntf.getQualifiedSourceName()
+ "Async");
if (serviceAsync == null) {
@@ -293,7 +283,7 @@
generateProxyFields(srcWriter, typesSentFromBrowser,
serializationPolicyStrongName, remoteServiceInterfaceName);
- generateProxyContructor(javadocAnnotationDeprecationBranch, srcWriter);
+ generateProxyContructor(srcWriter);
generateProxyMethods(srcWriter, typesSentFromBrowser,
syncMethToAsyncMethMap);
@@ -312,14 +302,12 @@
* using the default address for the
* {@link com.google.gwt.user.client.rpc.RemoteService RemoteService}.
*/
- private void generateProxyContructor(
- TreeLogger javadocAnnotationDeprecationBranch, SourceWriter srcWriter) {
+ private void generateProxyContructor(SourceWriter srcWriter) {
srcWriter.println("public " + getProxySimpleName() + "() {");
srcWriter.indent();
srcWriter.println("super(GWT.getModuleBaseURL(),");
srcWriter.indent();
- srcWriter.println(getRemoteServiceRelativePath(javadocAnnotationDeprecationBranch)
- + ", ");
+ srcWriter.println(getRemoteServiceRelativePath() + ", ");
srcWriter.println("SERIALIZATION_POLICY, ");
srcWriter.println("SERIALIZER);");
srcWriter.outdent();
@@ -564,21 +552,10 @@
return name[1];
}
- private String getRemoteServiceRelativePath(
- TreeLogger javadocAnnotationDeprecationBranch) {
- String[][] metaData = serviceIntf.getMetaData(ENTRY_POINT_TAG);
- if (metaData.length != 0) {
- if (javadocAnnotationDeprecationBranch != null) {
- javadocAnnotationDeprecationBranch.log(TreeLogger.WARN,
- "Deprecated use of " + ENTRY_POINT_TAG + "; Please use "
- + RemoteServiceRelativePath.class.getName() + " instead", null);
- }
- return metaData[0][0];
- } else {
- RemoteServiceRelativePath moduleRelativeURL = serviceIntf.getAnnotation(RemoteServiceRelativePath.class);
- if (moduleRelativeURL != null) {
- return "\"" + moduleRelativeURL.value() + "\"";
- }
+ private String getRemoteServiceRelativePath() {
+ RemoteServiceRelativePath moduleRelativeURL = serviceIntf.getAnnotation(RemoteServiceRelativePath.class);
+ if (moduleRelativeURL != null) {
+ return "\"" + moduleRelativeURL.value() + "\"";
}
return null;
diff --git a/user/src/com/google/gwt/user/rebind/ui/ImageBundleGenerator.java b/user/src/com/google/gwt/user/rebind/ui/ImageBundleGenerator.java
index 34b9c68..e3cd7f0 100644
--- a/user/src/com/google/gwt/user/rebind/ui/ImageBundleGenerator.java
+++ b/user/src/com/google/gwt/user/rebind/ui/ImageBundleGenerator.java
@@ -23,7 +23,6 @@
import com.google.gwt.core.ext.typeinfo.JMethod;
import com.google.gwt.core.ext.typeinfo.NotFoundException;
import com.google.gwt.core.ext.typeinfo.TypeOracle;
-import com.google.gwt.dev.generator.GenUtil;
import com.google.gwt.user.client.ui.ImageBundle;
import com.google.gwt.user.client.ui.ImageBundle.Resource;
import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
@@ -51,12 +50,10 @@
/**
* Simple wrapper around JMethod that allows for unit test mocking.
*/
- /* private */interface JMethodOracle {
+ interface JMethodOracle {
Resource getAnnotation(Class<Resource> clazz);
- String[][] getMetaData(String metadataTag);
-
String getName();
String getPackageName();
@@ -87,10 +84,6 @@
return delegate.getAnnotation(clazz);
}
- public String[][] getMetaData(String metadataTag) {
- return delegate.getMetaData(metadataTag);
- }
-
public String getName() {
return delegate.getName();
}
@@ -100,10 +93,6 @@
}
}
- /* private */static final String MSG_JAVADOC_FORM_DEPRECATED = "Use of @gwt.resource in javadoc is deprecated; use the annotation ImageBundle.@Resource instead";
-
- /* private */static final String MSG_MULTIPLE_ANNOTATIONS = "You are using both the @Resource annotation and the deprecated @gwt.resource in javadoc; @Resource will be used, and @gwt.resource will be ignored";
-
/* private */static final String MSG_NO_FILE_BASED_ON_METHOD_NAME = "No matching image resource was found; any of the following filenames would have matched had they been present:";
private static final String ABSTRACTIMAGEPROTOTYPE_QNAME = "com.google.gwt.user.client.ui.AbstractImagePrototype";
@@ -116,8 +105,6 @@
private static final String IMAGEBUNDLE_QNAME = "com.google.gwt.user.client.ui.ImageBundle";
- private static final String METADATA_TAG = "gwt.resource";
-
/* private */static String msgCannotFindImageFromMetaData(String imgResName) {
return "Unable to find image resource '" + imgResName + "'";
}
@@ -415,30 +402,10 @@
}
/**
- * Attempts to get the image name (verbatim) from old-school javadoc metadata.
+ * Attempts to get the image name from an annotation.
*
- * @return the string specified in "resource" javadoc metdata tag; never
- * returns <code>null</code>
- */
- private String tryGetImageNameFromJavaDoc(JMethodOracle method) {
- String imgName = null;
- String[][] md = method.getMetaData(METADATA_TAG);
- if (md.length == 1) {
- int lastTagIndex = md.length - 1;
- int lastValueIndex = md[lastTagIndex].length - 1;
- imgName = md[lastTagIndex][lastValueIndex];
- }
- return imgName;
- }
-
- /**
- * Attempts to get the image name from either an annotation or from pre-1.5
- * javadoc metadata, logging warnings to educate the user about deprecation
- * and behaviors in the face of conflicting metadata (for example, if both
- * forms of metadata are present).
- *
- * @param logger if metadata is found but the specified resource isn't
- * available, a warning is logged
+ * @param logger if an annotation is found but the specified resource isn't
+ * available, an error is logged
* @param method the image bundle method whose associated image resource is
* being sought
* @return a resource name that is suitable to be passed into
@@ -449,27 +416,7 @@
*/
private String tryGetImageNameFromMetaData(TreeLogger logger,
JMethodOracle method) throws UnableToCompleteException {
- String imgFileName = null;
- String imgNameAnn = tryGetImageNameFromAnnotation(method);
- String imgNameJavaDoc = tryGetImageNameFromJavaDoc(method);
- if (imgNameJavaDoc != null) {
- if (imgNameAnn == null) {
- // There is JavaDoc metadata but no annotation.
- imgFileName = imgNameJavaDoc;
- if (GenUtil.warnAboutMetadata()) {
- logger.log(TreeLogger.WARN, MSG_JAVADOC_FORM_DEPRECATED, null);
- }
- } else {
- // There is both JavaDoc metadata and an annotation.
- logger.log(TreeLogger.WARN, MSG_MULTIPLE_ANNOTATIONS, null);
- imgFileName = imgNameAnn;
- }
- } else if (imgNameAnn != null) {
- // There is only an annotation.
- imgFileName = imgNameAnn;
- }
- assert (imgFileName == null || (imgNameAnn != null || imgNameJavaDoc != null));
-
+ String imgFileName = tryGetImageNameFromAnnotation(method);
if (imgFileName == null) {
// Exit early because neither an annotation nor javadoc was found.
return null;
diff --git a/user/test/com/google/gwt/user/rebind/ui/ImageBundleGeneratorTest.java b/user/test/com/google/gwt/user/rebind/ui/ImageBundleGeneratorTest.java
index 9b8a63a..9766f58 100644
--- a/user/test/com/google/gwt/user/rebind/ui/ImageBundleGeneratorTest.java
+++ b/user/test/com/google/gwt/user/rebind/ui/ImageBundleGeneratorTest.java
@@ -16,7 +16,6 @@
package com.google.gwt.user.rebind.ui;
import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.dev.generator.GenUtil;
import com.google.gwt.dev.util.UnitTestTreeLogger;
import com.google.gwt.user.client.ui.ImageBundle.Resource;
import com.google.gwt.user.rebind.ui.ImageBundleBuilder.HasRect;
@@ -217,7 +216,6 @@
try {
getImageName(logger, new String[0], "nonexistentImg", "from.metadata",
- new String[0][],
getResourceAnnotation("testResourceNotFoundGivenAnnotation"));
fail("Should have thrown");
} catch (UnableToCompleteException e) {
@@ -227,30 +225,6 @@
/**
* Tests that a message is logged and an exception is thrown when a resource
- * isn't found after being sought based on a javadoc "gwt.resource"
- * pseudo-annotation.
- */
- public void testResourceNotFoundGivenLegacyJavaDoc() {
- UnitTestTreeLogger.Builder b = new UnitTestTreeLogger.Builder();
- if (GenUtil.warnAboutMetadata()) {
- b.expectWarn(ImageBundleGenerator.MSG_JAVADOC_FORM_DEPRECATED, null);
- }
- b.expectError(
- ImageBundleGenerator.msgCannotFindImageFromMetaData("from/metadata/notfound.png"),
- null);
- UnitTestTreeLogger logger = b.createLogger();
-
- try {
- getImageName(logger, new String[0], "nonexistentImg", "from.metadata",
- new String[][] {{"notfound.png"}}, null);
- fail("Should have thrown");
- } catch (UnableToCompleteException e) {
- }
- logger.assertCorrectLogEntries();
- }
-
- /**
- * Tests that a message is logged and an exception is thrown when a resource
* isn't found after being sought based on the method name.
*/
public void testResourceNotFoundGivenNoMetaData() {
@@ -262,8 +236,7 @@
UnitTestTreeLogger logger = b.createLogger();
try {
- getImageName(logger, new String[0], "nonexistentImg", "test",
- new String[0][], null);
+ getImageName(logger, new String[0], "nonexistentImg", "test", null);
fail("Should have thrown");
} catch (UnableToCompleteException e) {
}
@@ -277,57 +250,27 @@
public void testResourcesFoundFromImageBundleInDefaultPackage()
throws UnableToCompleteException {
UnitTestTreeLogger.Builder b = new UnitTestTreeLogger.Builder();
- if (GenUtil.warnAboutMetadata()) {
- // Due to [2] below
- b.expectWarn(ImageBundleGenerator.MSG_JAVADOC_FORM_DEPRECATED, null);
- // Due to [4] below
- b.expectWarn(ImageBundleGenerator.MSG_JAVADOC_FORM_DEPRECATED, null);
- }
UnitTestTreeLogger logger = b.createLogger();
{
// [1] Find an image in the default package using the method name.
String imgName = getImageName(logger, new String[] {
- "cabbage.jpg", "lettuce.jpg",}, "cabbage", "", new String[0][], null);
+ "cabbage.jpg", "lettuce.jpg",}, "cabbage", "", null);
assertEquals("cabbage.jpg", imgName);
}
{
- // [2] Find an image in the default package using javadoc.
+ // [2] Find an image in the default package using an annotation.
String imgName = getImageName(logger, new String[] {
"car.png", "dunebuggy.gif",}, "vehicleImage", "",
- new String[][] {{"dunebuggy.gif"}}, null);
- assertEquals("dunebuggy.gif", imgName);
- }
-
- {
- // [3] Find an image in
- // the default package
- // using an annotation.
- String imgName = getImageName(logger, new String[] {
- "car.png", "dunebuggy.gif",}, "vehicleImage", "", new String[0][],
getResourceAnnotation("duneBuggyInDefaultPackage"));
assertEquals("dunebuggy.gif", imgName);
}
-
{
- // [4] Find an image in a
- // non-default package using
- // javadoc.
+ // [3] Find an image in a non-default package using an annotation.
String imgName = getImageName(logger, new String[] {
"car.png", "dunebuggy.gif", "a/b/c/dunebuggy.gif",}, "vehicleImage",
- "", new String[][] {{"a/b/c/dunebuggy.gif"}}, null);
- assertEquals("a/b/c/dunebuggy.gif", imgName);
- }
-
- {
- // [5] Find an image in a
- // non-default package using an
- // annotation.
- String imgName = getImageName(logger, new String[] {
- "car.png", "dunebuggy.gif", "a/b/c/dunebuggy.gif",}, "vehicleImage",
- "", new String[0][],
- getResourceAnnotation("duneBuggyInNonDefaultPackage"));
+ "", getResourceAnnotation("duneBuggyInNonDefaultPackage"));
assertEquals("a/b/c/dunebuggy.gif", imgName);
}
@@ -341,109 +284,41 @@
public void testResourcesFoundFromImageBundleInNonDefaultPackage()
throws UnableToCompleteException {
UnitTestTreeLogger.Builder b = new UnitTestTreeLogger.Builder();
- if (GenUtil.warnAboutMetadata()) {
- // Due to [2] below
- b.expectWarn(ImageBundleGenerator.MSG_JAVADOC_FORM_DEPRECATED, null);
- // Due to [4] below
- b.expectWarn(ImageBundleGenerator.MSG_JAVADOC_FORM_DEPRECATED, null);
- }
UnitTestTreeLogger logger = b.createLogger();
{
// [1] Find an image in the same package using the method name.
String imgName = getImageName(logger, new String[] {
- "x/y/z/europa.png", "x/y/z/io.jpg",}, "io", "x.y.z", new String[0][],
- null);
+ "x/y/z/europa.png", "x/y/z/io.jpg",}, "io", "x.y.z", null);
assertEquals("x/y/z/io.jpg", imgName);
}
{
- // [2] Find an image in the same package using javadoc.
+ // [2] Find an image in the same package using an annotation.
String imgName = getImageName(logger, new String[] {
"x/y/z/europa.png", "x/y/z/io.jpg",}, "moonImage", "x.y.z",
- new String[][] {{"io.jpg"}}, null);
+ getResourceAnnotation("ioInSamePackage"));
assertEquals("x/y/z/io.jpg", imgName);
}
{
- // [3] Find an image in the same package using an annotation.
- String imgName = getImageName(logger, new String[] {
- "x/y/z/europa.png", "x/y/z/io.jpg",}, "moonImage", "x.y.z",
- new String[0][], getResourceAnnotation("ioInSamePackage"));
- assertEquals("x/y/z/io.jpg", imgName);
- }
-
- {
- // [4] Find an image in a non-default package using javadoc.
+ // [3] Find an image in a non-default package using an annotation.
String imgName = getImageName(logger, new String[] {
"car.png", "dunebuggy.gif", "a/b/c/dunebuggy.gif",}, "vehicleImage",
- "x.y.z", new String[][] {{"a/b/c/dunebuggy.gif"}}, null);
+ "x.y.z", getResourceAnnotation("duneBuggyInNonDefaultPackage"));
assertEquals("a/b/c/dunebuggy.gif", imgName);
}
- {
- // [5] Find an image in a non-default package using an annotation.
- String imgName = getImageName(logger, new String[] {
- "car.png", "dunebuggy.gif", "a/b/c/dunebuggy.gif",}, "vehicleImage",
- "x.y.z", new String[0][],
- getResourceAnnotation("duneBuggyInNonDefaultPackage"));
- assertEquals("a/b/c/dunebuggy.gif", imgName);
- }
-
- logger.assertCorrectLogEntries();
- }
-
- /**
- * Tests that a warning is logged if both the old "gwt.resource" javadoc
- * construct is used and a resource annotation is used.
- */
- @Resource("Horse Shoes.jpg")
- public void testWarnOnUseOfAnnotationAndLegacyJavaDoc()
- throws UnableToCompleteException {
- UnitTestTreeLogger.Builder b = new UnitTestTreeLogger.Builder();
- b.expectWarn(ImageBundleGenerator.MSG_MULTIPLE_ANNOTATIONS, null);
- UnitTestTreeLogger logger = b.createLogger();
-
- Resource resAnn = getResourceAnnotation("testWarnOnUseOfAnnotationAndLegacyJavaDoc");
- String imgName = getImageName(logger, new String[] {
- "test/flypaper.gif", "test/horse shoes.jpg", "test/Horse Shoes.jpg"},
- "horseshoes", "test", new String[][] {{"Horse Shoes.jpg"}}, resAnn);
-
- assertEquals("test/Horse Shoes.jpg", imgName);
- logger.assertCorrectLogEntries();
- }
-
- /**
- * Tests that a warning is logged if the old "gwt.resource" javadoc construct
- * is used.
- */
- public void testWarnOnUseOfLegacyJavaDoc() throws UnableToCompleteException {
- UnitTestTreeLogger.Builder b = new UnitTestTreeLogger.Builder();
- if (GenUtil.warnAboutMetadata()) {
- b.expectWarn(ImageBundleGenerator.MSG_JAVADOC_FORM_DEPRECATED, null);
- }
- UnitTestTreeLogger logger = b.createLogger();
-
- String imgName = getImageName(logger, new String[] {
- "test/flypaper.gif", "test/horse shoes.jpg", "test/Horse Shoes.jpg"},
- "horseshoes", "test", new String[][] {{"Horse Shoes.jpg"}}, null);
-
- assertEquals("test/Horse Shoes.jpg", imgName);
logger.assertCorrectLogEntries();
}
private JMethodOracle createJMethodOracle(final String methodName,
- final String packageName, final String[][] resourceMetadata,
- final Resource resourceAnnotation) {
+ final String packageName, final Resource resourceAnnotation) {
return new JMethodOracle() {
public Resource getAnnotation(Class<Resource> clazz) {
return resourceAnnotation;
}
- public String[][] getMetaData(String metadataTag) {
- return resourceMetadata;
- }
-
public String getName() {
return methodName;
}
@@ -456,8 +331,7 @@
private String getImageName(UnitTestTreeLogger logger,
final String[] pretendResources, String methodName, String pkgName,
- String[][] resMetadata, final Resource resAnn)
- throws UnableToCompleteException {
+ final Resource resAnn) throws UnableToCompleteException {
ImageBundleGenerator ibg = new ImageBundleGenerator(
new ImageBundleGenerator.ResourceLocator() {
private final List<String> resList = Arrays.asList(pretendResources);
@@ -467,7 +341,7 @@
}
});
JMethodOracle methodOracle = createJMethodOracle(methodName, pkgName,
- resMetadata, resAnn);
+ resAnn);
return ibg.getImageResourceName(logger, methodOracle);
}