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
commitdc2efba17781c35adddf6591d48c71e3ed0d62ac (patch)
tree9ed92d7da9a1c49acc72f79f01aef77290cea3c9 /src/java/com/sun/gluegen
parentddfed940a721e41ecbad85e2ed7b35725c072c94 (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 d62a685..b52047b 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);
}
}