summaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-08-01 02:31:15 -0700
committerSven Gothel <[email protected]>2009-08-01 02:31:15 -0700
commitc83fc5cdcc615b4ee88ac2e0eb8737970fb2b8c3 (patch)
tree8333d982f7f7155a1c5572fe84444742b407c50c /src/java/com/sun/gluegen
parent22c78ff7b99a0ba42cbd019a3517fbeb4c6890a1 (diff)
Retain interface order in Custom Pipeline
Diffstat (limited to 'src/java/com/sun/gluegen')
-rw-r--r--src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java b/src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java
index d62a68573..b52047bbf 100644
--- a/src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java
+++ b/src/java/com/sun/gluegen/opengl/BuildComposablePipeline.java
@@ -330,15 +330,29 @@ public class BuildComposablePipeline
PrintWriter output = new PrintWriter(new BufferedWriter(new FileWriter(file)));
+ List baseInterfaces = Arrays.asList(baseInterfaceClass.getInterfaces());
HashSet clazzList = new HashSet();
clazzList.add(baseInterfaceClass);
- clazzList.addAll(Arrays.asList(baseInterfaceClass.getInterfaces()));
+ clazzList.addAll(baseInterfaces);
+ int ifNamesNumber = clazzList.size();
- String[] ifNames = new String[clazzList.size()];
+ // keep original order ..
+ clazzList.clear();
+ String[] ifNames = new String[ifNamesNumber];
{
int i=0;
- for (Iterator iter=clazzList.iterator(); iter.hasNext(); ) {
- ifNames[i++] = new String(((Class)iter.next()).getName());
+
+ for (Iterator iter=baseInterfaces.iterator(); iter.hasNext(); ) {
+ Class ifClass = (Class)iter.next();
+ if(!clazzList.contains(ifClass)) {
+ ifNames[i++] = new String(ifClass.getName());
+ clazzList.add(ifClass);
+ }
+ }
+
+ if(null!=baseInterfaceClass && !clazzList.contains(baseInterfaceClass)) {
+ ifNames[i++] = new String(baseInterfaceClass.getName());
+ clazzList.add(baseInterfaceClass);
}
}