aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-09-03 15:42:37 +0200
committerSven Gothel <[email protected]>2014-09-03 15:42:37 +0200
commitffde09410fb78c43bd45d6c5e62606789dced6eb (patch)
tree66aed6741bb713f450039edf6819d5ffab7b483b /src
parent9b7ab72d9b098942ee599a106b142cac8c16fd9b (diff)
Bug 1059 _and_ version-compat breackage of commit c78ceb642d0ef5bb5bf27ff8ff1495175ee2e983
Commit c78ceb642d0ef5bb5bf27ff8ff1495175ee2e983 changed: - public static final String GL4 = "GL4"; + public static final String GL4 = "GL4".intern(); which is identified by semver as incompatible, due to Bug 1059 (no more inlining of interned string references).
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLProfile.java28
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java15
2 files changed, 28 insertions, 15 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index 674ecdabf..5836e4c81 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -513,46 +513,46 @@ public class GLProfile {
/** The desktop OpenGL compatibility profile 4.x, with x >= 0, ie GL2 plus GL4.<br>
<code>bc</code> stands for backward compatibility. */
- public static final String GL4bc = "GL4bc".intern();
+ public static final String GL4bc = "GL4bc"; // Implicitly intern(), see Bug 1059
/** The desktop OpenGL core profile 4.x, with x >= 0 */
- public static final String GL4 = "GL4".intern();
+ public static final String GL4 = "GL4"; // Implicitly intern(), see Bug 1059
/** The desktop OpenGL compatibility profile 3.x, with x >= 1, ie GL2 plus GL3.<br>
<code>bc</code> stands for backward compatibility. */
- public static final String GL3bc = "GL3bc".intern();
+ public static final String GL3bc = "GL3bc"; // Implicitly intern(), see Bug 1059
/** The desktop OpenGL core profile 3.x, with x >= 1 */
- public static final String GL3 = "GL3".intern();
+ public static final String GL3 = "GL3"; // Implicitly intern(), see Bug 1059
/** The desktop OpenGL profile 1.x up to 3.0 */
- public static final String GL2 = "GL2".intern();
+ public static final String GL2 = "GL2"; // Implicitly intern(), see Bug 1059
/** The embedded OpenGL profile ES 1.x, with x >= 0 */
- public static final String GLES1 = "GLES1".intern();
+ public static final String GLES1 = "GLES1"; // Implicitly intern(), see Bug 1059
/** The embedded OpenGL profile ES 2.x, with x >= 0 */
- public static final String GLES2 = "GLES2".intern();
+ public static final String GLES2 = "GLES2"; // Implicitly intern(), see Bug 1059
/** The embedded OpenGL profile ES 3.x, with x >= 0 */
- public static final String GLES3 = "GLES3".intern();
+ public static final String GLES3 = "GLES3"; // Implicitly intern(), see Bug 1059
/** The intersection of the desktop GL2 and embedded ES1 profile */
- public static final String GL2ES1 = "GL2ES1".intern();
+ public static final String GL2ES1 = "GL2ES1"; // Implicitly intern(), see Bug 1059
/** The intersection of the desktop GL3, GL2 and embedded ES2 profile */
- public static final String GL2ES2 = "GL2ES2".intern();
+ public static final String GL2ES2 = "GL2ES2"; // Implicitly intern(), see Bug 1059
/** The intersection of the desktop GL3 and GL2 profile */
- public static final String GL2GL3 = "GL2GL3".intern();
+ public static final String GL2GL3 = "GL2GL3"; // Implicitly intern(), see Bug 1059
/** The intersection of the desktop GL4 and ES3 profile, available only if either ES3 or GL4 w/ <code>GL_ARB_ES3_compatibility</code> is available. */
- public static final String GL4ES3 = "GL4ES3".intern();
+ public static final String GL4ES3 = "GL4ES3"; // Implicitly intern(), see Bug 1059
/** The default profile, used for the device default profile map */
- private static final String GL_DEFAULT = "GL_DEFAULT".intern();
+ private static final String GL_DEFAULT = "GL_DEFAULT"; // Implicitly intern(), see Bug 1059
/** The default profile, used for the device default profile map */
- private static final String GL_GL = "GL".intern();
+ private static final String GL_GL = "GL"; // Implicitly intern(), see Bug 1059
/**
* All GL Profiles in the order of default detection.
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java
index 5861d4233..dfa34be34 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java
@@ -30,6 +30,7 @@ package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.IOException;
+import org.junit.Assert;
import org.junit.Test;
import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
@@ -44,7 +45,19 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
public class TestGLProfile00NEWT extends UITestCase {
@Test
- public void testInitSingleton() throws InterruptedException {
+ public void test01InternedString() {
+ final String s1 = "GL2";
+ final String s2 = "GL2";
+ Assert.assertEquals(s1, s2);
+ Assert.assertTrue("s1-ref != s2-ref", s1 == s2);
+ Assert.assertTrue("s1-ref != 'GL2'-ref", s1 == "GL2");
+
+ Assert.assertEquals("GL2", GLProfile.GL2);
+ Assert.assertTrue("GLProfile-ref != 'GL2'-ref", GLProfile.GL2 == "GL2");
+ }
+
+ @Test
+ public void test02InitSingleton() throws InterruptedException {
GLProfile.initSingleton();
System.err.println("Desktop");
final GLDrawableFactory desktopFactory = GLDrawableFactory.getDesktopFactory();