summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/javax
diff options
context:
space:
mode:
Diffstat (limited to 'src/nativewindow/classes/javax')
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java12
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java7
2 files changed, 15 insertions, 4 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java
index 585cd1f09..ed305d49e 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java
@@ -89,10 +89,16 @@ public interface AbstractGraphicsDevice extends Cloneable {
public int getUnitID();
/**
- * Returns a unique ID String of this device using {@link #getType() type},
- * {@link #getConnection() connection} and {@link #getUnitID() unitID}.<br>
- * The unique ID does not reflect the instance of the device, hence the handle is not included.<br>
+ * Returns a unique ID object of this device using {@link #getType() type},
+ * {@link #getConnection() connection} and {@link #getUnitID() unitID} as it's key components.
+ * <p>
+ * The unique ID does not reflect the instance of the device, hence the handle is not included.
* The unique ID may be used as a key for semantic device mapping.
+ * </p>
+ * <p>
+ * The returned string object reference is unique using {@link String#intern()}
+ * and hence can be used as a key itself.
+ * </p>
*/
public String getUniqueID();
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
index 66b81d7fa..0bf5c2937 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
@@ -253,7 +253,12 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
return toolkitLock;
}
+ /**
+ * Returns a unique String object using {@link String#intern()} for the given arguments,
+ * which object reference itself can be used as a key.
+ */
protected static String getUniqueID(String type, String connection, int unitID) {
- return (type + separator + connection + separator + unitID).intern();
+ final String r = (type + separator + connection + separator + unitID).intern();
+ return r.intern();
}
}