Jogamp
Streamline Composed Pipeline's interfaces and implementations (Trace* Debug*)
authorSven Gothel <sgothel@jausoft.com>
Mon, 12 Oct 2015 06:13:43 +0000 (08:13 +0200)
committerSven Gothel <sgothel@jausoft.com>
Mon, 12 Oct 2015 06:13:43 +0000 (08:13 +0200)
Only add the required direct interfaces / implementations
to interface / class derivations, not polluting overview in IDEs.

Aligns w/ commit bf76b6b77f078178fc5e6a42c70d354369004b94

src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java

index 9381d31..9f885e5 100644 (file)
@@ -391,35 +391,16 @@ public class BuildComposablePipeline {
 
             final PrintWriter output = new PrintWriter(new BufferedWriter(new FileWriter(file)));
 
-            final List<Class<?>> baseInterfaces = Arrays.asList(baseInterfaceClass.getInterfaces());
-            final HashSet<Class<?>> clazzList = new HashSet<Class<?>>();
-            clazzList.add(baseInterfaceClass);
-            clazzList.addAll(baseInterfaces);
-            final int ifNamesNumber = clazzList.size();
-
-            // keep original order ..
-            clazzList.clear();
-            final String[] ifNames = new String[ifNamesNumber];
-            {
-                int i = 0;
-
-                for (final Iterator<Class<?>> iter = baseInterfaces.iterator(); iter.hasNext();) {
-                    final Class<?> ifClass = iter.next();
-                    if (!clazzList.contains(ifClass)) {
-                        ifNames[i++] = ifClass.getName();
-                        clazzList.add(ifClass);
-                    }
-                }
+            final HashSet<Class<?>> importClazzList = new HashSet<Class<?>>();
+            importClazzList.add(baseInterfaceClass);
+            final String[] ifNames = new String[] { baseInterfaceClass.getName() };
 
-                if ( !clazzList.contains(baseInterfaceClass) ) {
-                    ifNames[i++] = baseInterfaceClass.getName();
-                    clazzList.add(baseInterfaceClass);
-                }
-            }
+            final List<Class<?>> baseInterfaces = Arrays.asList(baseInterfaceClass.getInterfaces());
+            importClazzList.addAll(baseInterfaces);
 
-            clazzList.add(downstreamClass);
+            importClazzList.add(downstreamClass);
             if (null != prologClassOpt) {
-                clazzList.add(prologClassOpt);
+                importClazzList.add(prologClassOpt);
             }
 
             final ArrayList<String> imports = new ArrayList<String>();
@@ -427,7 +408,7 @@ public class BuildComposablePipeline {
             imports.add("com.jogamp.opengl.*");
             imports.add("com.jogamp.gluegen.runtime.*");
             imports.add(Buffer.class.getPackage().getName()+".*");
-            for (final Class<?> clasS : clazzList) {
+            for (final Class<?> clasS : importClazzList) {
                 imports.add(clasS.getName());
             }
 
http://JogAmp.org git info: FAQ, tutorial and man pages.