summaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-08 22:10:03 +0200
committerSven Gothel <[email protected]>2014-07-08 22:10:03 +0200
commitde53d193c86a02a3cdc46c5c8758192d957d1c67 (patch)
tree8be8e36381d6f25850b887c9ff0df7e9c2279487 /src/test/com/jogamp
parentbe2b608e22d9a2a3a80eb547bee6180c2ca22678 (diff)
Findbugs: Misc minor issues (see below)
- remove duplicate code in branch - Use Type.valueOf(primitive) - Don't use array.toString() directly - remove dead code
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java32
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/UITestCase.java2
8 files changed, 27 insertions, 43 deletions
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java
index eff2c876a..25eb25892 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java
@@ -102,7 +102,7 @@ public class NEWTGearsES2Activity extends NewtBaseActivity {
System.err.println("MemoryHog: ****** +4k: "+osizeMB+" MB +"+nsizeMB+" MB - Done");
try {
Thread.sleep(500);
- } catch (final Exception e) {};
+ } catch (final Exception e) { e.printStackTrace(); };
}
} }, "MemoryHog").start();
} else if( e.getPointerCount() == 4 ) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java
index 5f5053089..6395c1446 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java
@@ -43,7 +43,7 @@ public class TestMainVersionGLCanvasAWT extends UITestCase {
@Test
public void testMain() throws InterruptedException {
- GLCanvas.main(null);
+ GLCanvas.main(new String[0]);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java
index a0662f862..a5b5653c0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java
@@ -207,11 +207,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
try {
- if( destroyCleanOrder ) {
- f2.dispose();
- } else {
- f2.dispose();
- }
+ f2.dispose();
} catch (final Throwable t) {
throw new RuntimeException(t);
}
@@ -365,11 +361,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
try {
- if( destroyCleanOrder ) {
- f2.dispose();
- } else {
- f2.dispose();
- }
+ f2.dispose();
} catch (final Throwable t) {
throw new RuntimeException(t);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index 50d16db1b..0d1191528 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -643,20 +643,12 @@ public class MovieSimple implements GLEventListener {
// left-top
ib.put(verts[0]); ib.put(verts[4]); ib.put(verts[2]);
- if( hasEffect(EFFECT_GRADIENT_BOTTOM2TOP) ) {
- ib.put( 1); ib.put( 1); ib.put( 1); ib.put(alpha);
- } else {
- ib.put( 1); ib.put( 1); ib.put( 1); ib.put(alpha);
- }
+ ib.put( 1); ib.put( 1); ib.put( 1); ib.put(alpha);
ib.put( tc.left() *ss); ib.put( tc.top() *ts);
// right-top
ib.put(verts[3]); ib.put(verts[4]); ib.put(verts[2]);
- if( hasEffect(EFFECT_GRADIENT_BOTTOM2TOP) ) {
- ib.put( 1); ib.put( 1); ib.put( 1); ib.put(alpha);
- } else {
- ib.put( 1); ib.put( 1); ib.put( 1); ib.put(alpha);
- }
+ ib.put( 1); ib.put( 1); ib.put( 1); ib.put(alpha);
ib.put( tc.right() *ss); ib.put( tc.top() *ts);
}
interleavedVBO.seal(gl, true);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
index fa8406fa2..32e0be3e1 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
@@ -149,15 +149,15 @@ public class GLSLMiscHelper {
validateGLArrayDataServerState(gl, st, vDataArray);
return vDataArray;
}
- public static float[] vertices0 = new float[] { -2f, 2f, 0f,
- 2f, 2f, 0f,
- -2f, -2f, 0f,
- 2f, -2f, 0f };
+ public static final float[] vertices0 = new float[] { -2f, 2f, 0f,
+ 2f, 2f, 0f,
+ -2f, -2f, 0f,
+ 2f, -2f, 0f };
- public static float[] vertices1 = new float[] { -2f, 1f, 0f,
- 2f, 1f, 0f,
- -2f, -1f, 0f,
- 2f, -1f, 0f };
+ public static final float[] vertices1 = new float[] { -2f, 1f, 0f,
+ 2f, 1f, 0f,
+ -2f, -1f, 0f,
+ 2f, -1f, 0f };
public static GLArrayDataServer createColors(final GL2ES2 gl, final ShaderState st, final int shaderProgram, final int location, final float[] colors) {
if(null != st && 0 != shaderProgram) {
@@ -194,14 +194,14 @@ public class GLSLMiscHelper {
validateGLArrayDataServerState(gl, st, cDataArray);
return cDataArray;
}
- public static float[] colors0 = new float[] { 1f, 0f, 0f, 1f,
- 0f, 0f, 1f, 1f,
- 1f, 0f, 0f, 1f,
- 1f, 0f, 1f, 1f };
+ public static final float[] colors0 = new float[] { 1f, 0f, 0f, 1f,
+ 0f, 0f, 1f, 1f,
+ 1f, 0f, 0f, 1f,
+ 1f, 0f, 1f, 1f };
- public static float[] colors1 = new float[] { 1f, 0f, 1f, 1f,
- 0f, 1f, 0f, 1f,
- 1f, 0f, 1f, 1f,
- 1f, 0f, 1f, 1f };
+ public static final float[] colors1 = new float[] { 1f, 0f, 1f, 1f,
+ 0f, 1f, 0f, 1f,
+ 1f, 0f, 1f, 1f,
+ 1f, 0f, 1f, 1f };
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java
index acc53b2f9..2b6356e14 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java
@@ -33,10 +33,10 @@ import com.jogamp.newt.event.*;
class WindowEventCom1 extends WindowAdapter {
public void windowResized(final WindowEvent e) {
- e.setAttachment(new String("WindowEventCom1.windowResized: "+e));
+ e.setAttachment("WindowEventCom1.windowResized: "+e);
}
public void windowMoved(final WindowEvent e) {
- e.setAttachment(new String("WindowEventCom1.windowMoved: "+e));
+ e.setAttachment("WindowEventCom1.windowMoved: "+e);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java
index e563e768f..bc0415756 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java
@@ -35,13 +35,13 @@ class WindowEventCom2 extends WindowAdapter {
public void windowResized(final WindowEvent e) {
final String str = (String) e.getAttachment();
if(null==str) {
- e.setAttachment(new String("WindowEventCom2.windowResized: "+e));
+ e.setAttachment("WindowEventCom2.windowResized: "+e);
}
}
public void windowMoved(final WindowEvent e) {
final String str = (String) e.getAttachment();
if(null==str) {
- e.setAttachment(new String("WindowEventCom2.windowMoved: "+e));
+ e.setAttachment("WindowEventCom2.windowMoved: "+e);
}
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
index a1e2b19d3..c2b309cd7 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
@@ -273,7 +273,7 @@ public abstract class UITestCase {
System.err.println(preMessage+"> Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (final IOException e) { }
+ } catch (final IOException e) { e.printStackTrace(); }
}
static final String unsupportedTestMsg = "Test not supported on this platform.";