Fixed field/method order so that javac output matches apt output.

This commit is contained in:
Ioannis Tsakpinis 2014-09-15 01:31:22 +03:00
parent d17c19fe01
commit e4fc386372
2 changed files with 9 additions and 10 deletions

View File

@ -158,7 +158,7 @@ public class TypeInfo {
}
private static Collection<TypeInfo> getTypeInfos(TypeMap type_map, VariableElement param) {
List<? extends AnnotationMirror> annotations = param.getAnnotationMirrors();
List<? extends AnnotationMirror> annotations = Utils.getSortedAnnotations(param.getAnnotationMirrors());
GLvoid void_annotation = param.getAnnotation(GLvoid.class);
Map<Class, TypeInfo> types = new HashMap<Class, TypeInfo>();
@ -175,8 +175,7 @@ public class TypeInfo {
if ( types.containsKey(inverse_type) ) {
TypeInfo inverse_type_info = types.get(inverse_type);
String inverse_auto_type = inverse_type_info.getAutoType();
auto_type = signedness == Signedness.UNSIGNED ? auto_type + " : " + inverse_auto_type
: inverse_auto_type + " : " + auto_type;
auto_type = signedness == Signedness.UNSIGNED ? auto_type + " : " + inverse_auto_type : inverse_auto_type + " : " + auto_type;
auto_type = UNSIGNED_PARAMETER_NAME + " ? " + auto_type;
signedness = Signedness.BOTH;
types.remove(inverse_type);

View File

@ -496,11 +496,11 @@ public class Utils {
}
public static Collection<VariableElement> getFields(TypeElement d) {
return ElementFilter.fieldsIn(new HashSet(d.getEnclosedElements()));
return ElementFilter.fieldsIn(new LinkedHashSet<Element>(d.getEnclosedElements()));
}
public static Collection<ExecutableElement> getMethods(TypeElement d) {
return ElementFilter.methodsIn(new HashSet(d.getEnclosedElements()));
return ElementFilter.methodsIn(new LinkedHashSet<Element>(d.getEnclosedElements()));
}
}