Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Generator.java to fix the flaky errors #727

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/main/java/org/bytedeco/javacpp/tools/Generator.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.nio.ShortBuffer;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
Expand Down Expand Up @@ -2083,6 +2084,12 @@ boolean methods(Class<?> cls) {
}

Method[] methods = cls.getDeclaredMethods();
Arrays.sort(methods, new Comparator<Method>() {
@Override
public int compare(Method m1, Method m2) {
return m1.getName().compareTo(m2.getName());
}
});
MethodInformation[] methodInfos = new MethodInformation[methods.length];
for (int i = 0; i < methods.length; i++) {
methodInfos[i] = methodInformation(methods[i]);
Expand Down Expand Up @@ -3635,6 +3642,12 @@ static Method[] functionMethods(Class<?> cls, boolean[] callbackAllocators) {
return null;
}
Method[] methods = cls.getDeclaredMethods();
Arrays.sort(methods, new Comparator<Method>() {
@Override
public int compare(Method m1, Method m2) {
return m1.getName().compareTo(m2.getName());
}
});
Method[] functionMethods = new Method[3];
for (int i = 0; i < methods.length; i++) {
String methodName = methods[i].getName();
Expand Down