summaryrefslogtreecommitdiffstats
path: root/libjava/java
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-11 17:49:47 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-11 17:49:47 +0000
commit656b493b23e4bb42c98f0bffb6e58f647514c13f (patch)
tree813e7e2d1e7466679c0eea1808578ad44322878e /libjava/java
parent8f87ecd58d4efd2ccc835fcd093158cad20d89af (diff)
downloadppe42-gcc-656b493b23e4bb42c98f0bffb6e58f647514c13f.tar.gz
ppe42-gcc-656b493b23e4bb42c98f0bffb6e58f647514c13f.zip
* java/awt/Cursor.java (Cursor(String)): Set type to custom.
(Cursor(int), getPredefinedCursor): Throw exception if argument invalid. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38911 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r--libjava/java/awt/Cursor.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/libjava/java/awt/Cursor.java b/libjava/java/awt/Cursor.java
index e964a12d15f..80f28e6ed73 100644
--- a/libjava/java/awt/Cursor.java
+++ b/libjava/java/awt/Cursor.java
@@ -36,6 +36,8 @@ public class Cursor implements java.io.Serializable
public Cursor(int type)
{
+ if (type < 0 || type >= PREDEFINED_COUNT)
+ throw new IllegalArgumentException ("invalid cursor " + type);
this.type = type;
// FIXME: lookup and set name?
}
@@ -46,13 +48,13 @@ public class Cursor implements java.io.Serializable
protected Cursor(String name)
{
this.name = name;
- // FIXME
+ this.type = CUSTOM_CURSOR;
}
public static Cursor getPredefinedCursor(int type)
{
- if (type >= PREDEFINED_COUNT)
- return null;
+ if (type < 0 || type >= PREDEFINED_COUNT)
+ throw new IllegalArgumentException ("invalid cursor " + type);
if (predefined[type] == null)
predefined[type] = new Cursor(type);
return predefined[type];
OpenPOWER on IntegriCloud