зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1049105: Make annotation processor compile with Xlint:all r=kats
This commit is contained in:
Родитель
40a0c89526
Коммит
d9eab8b56d
|
@ -209,7 +209,7 @@ public class CodeGenerator {
|
|||
|
||||
public void generateConstructor(AnnotatableEntity aCtorTuple) {
|
||||
// Unpack the tuple and extract some useful fields from the Method..
|
||||
Constructor theCtor = aCtorTuple.getConstructor();
|
||||
Constructor<?> theCtor = aCtorTuple.getConstructor();
|
||||
String CMethodName = mCClassName;
|
||||
|
||||
generateMemberCommon(theCtor, mCClassName, mClassToWrap);
|
||||
|
@ -295,7 +295,7 @@ public class CodeGenerator {
|
|||
}
|
||||
|
||||
Method m;
|
||||
Constructor c;
|
||||
Constructor<?> c;
|
||||
|
||||
Class<?> returnType;
|
||||
|
||||
|
@ -305,7 +305,7 @@ public class CodeGenerator {
|
|||
returnType = m.getReturnType();
|
||||
localReferencesNeeded = Utils.enumerateReferenceArguments(m.getParameterTypes());
|
||||
} else {
|
||||
c = (Constructor) aMethod;
|
||||
c = (Constructor<?>) aMethod;
|
||||
returnType = Void.class;
|
||||
localReferencesNeeded = Utils.enumerateReferenceArguments(c.getParameterTypes());
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ public class CodeGenerator {
|
|||
return argumentContent;
|
||||
}
|
||||
|
||||
private void writeCtorBody(String implementationSignature, Constructor theCtor,
|
||||
private void writeCtorBody(String implementationSignature, Constructor<?> theCtor,
|
||||
boolean aIsThreaded, boolean aNoThrow) {
|
||||
Class<?>[] argumentTypes = theCtor.getParameterTypes();
|
||||
|
||||
|
|
|
@ -48,10 +48,10 @@ public class AnnotatableEntity {
|
|||
}
|
||||
return (Field) mMember;
|
||||
}
|
||||
public Constructor getConstructor() {
|
||||
public Constructor<?> getConstructor() {
|
||||
if (mEntityType != ENTITY_TYPE.CONSTRUCTOR) {
|
||||
throw new UnsupportedOperationException("Attempt to cast to unsupported member type.");
|
||||
}
|
||||
return (Constructor) mMember;
|
||||
return (Constructor<?>) mMember;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public class AlphabeticAnnotatableEntityComparator<T extends Member> implements
|
|||
return lName.compareTo(rName);
|
||||
}
|
||||
|
||||
private static int compare(Constructor aLhs, Constructor aRhs) {
|
||||
private static int compare(Constructor<?> aLhs, Constructor<?> aRhs) {
|
||||
// The names will be the same, so we need to compare signatures to find their uniqueness..
|
||||
String lName = Utils.getTypeSignatureString(aLhs);
|
||||
String rName = Utils.getTypeSignatureString(aRhs);
|
||||
|
|
|
@ -44,7 +44,7 @@ public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
|
|||
System.arraycopy(aCtors, 0, objs, offset, aCtors.length);
|
||||
|
||||
// Sort the elements to ensure determinism.
|
||||
Arrays.sort(objs, new AlphabeticAnnotatableEntityComparator());
|
||||
Arrays.sort(objs, new AlphabeticAnnotatableEntityComparator<Member>());
|
||||
mObjects = objs;
|
||||
|
||||
// Check for "Wrap ALL the things" flag.
|
||||
|
|
|
@ -303,7 +303,7 @@ public class Utils {
|
|||
* @param aConstructor The Constructor to generate a signature for.
|
||||
* @return The canonical JNI type signature for this method.
|
||||
*/
|
||||
protected static String getTypeSignatureStringForConstructor(Constructor aConstructor) {
|
||||
protected static String getTypeSignatureStringForConstructor(Constructor<?> aConstructor) {
|
||||
Class<?>[] arguments = aConstructor.getParameterTypes();
|
||||
return getTypeSignatureInternal(arguments, Void.class);
|
||||
}
|
||||
|
@ -314,11 +314,11 @@ public class Utils {
|
|||
} else if (aMember instanceof Field) {
|
||||
return getTypeSignatureStringForField((Field) aMember);
|
||||
} else {
|
||||
return getTypeSignatureStringForConstructor((Constructor) aMember);
|
||||
return getTypeSignatureStringForConstructor((Constructor<?>) aMember);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getTypeSignatureString(Constructor aConstructor) {
|
||||
public static String getTypeSignatureString(Constructor<?> aConstructor) {
|
||||
Class<?>[] arguments = aConstructor.getParameterTypes();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append('(');
|
||||
|
|
Загрузка…
Ссылка в новой задаче