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

@ -442,11 +442,11 @@ public class Utils {
writer.print("\t\t");
}
writer.print("ByteBuffer " + return_annotation.value() + " = APIUtil.getBufferByte(" + type_map.getAPIUtilParam(true) + return_annotation.maxLength());
/*
Params that use the return buffer will advance its position while filling it. When we return, the position will be
at the right spot for grabbing the returned string bytes. We only have to make sure that the original buffer was
large enough to hold everything, so that no re-allocations happen while filling.
*/
/*
Params that use the return buffer will advance its position while filling it. When we return, the position will be
at the right spot for grabbing the returned string bytes. We only have to make sure that the original buffer was
large enough to hold everything, so that no re-allocations happen while filling.
*/
final String offset = getStringOffset(method, null);
if ( offset != null ) {
writer.print(" + " + offset);
@ -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()));
}
}