a patch for the libraries
Aaron Place
beavis at ihug.co.nz
Tue Mar 9 22:15:20 PST 1999
A patch to make a few changes to various classes.
* libraries/javalib/java/beans/{FeatureDescriptor,GenericBeanInfo}.java,
libraries/javalib/java/io/FileDescriptor.java,
libraries/javalib/java/lang/Math.java,
libraries/javalib/java/net/{InetAddressImpl,Socket,SocketOptions}.java,
libraries/javalib/java/text/RuleBasedCollator.java,
libraries/javalib/java/util/Date,Stack.java: fixed access modifiers and
checked exceptions
* libraries/javalib/java/beans/Introspector.java,
libraries/javalib/java/net/URLEncoder.java,
libraries/javalib/java/sql/{DriverManager,Types}.java,
libraries/javalib/java/text/{CollationElementIterator,CollationKey}.java: add
a private constructor.
* libraries/javalib/java/lang/Character.java: changed most public fields
to type byte
* libraries/javalib/java/text/CharacterIterator.java,
libraries/javalib/java/text/CollationElementIterator.java: type changes
* libraries/javalib/java/beans/SimpleBeanInfo.java: add entry for
loadImage(String) (not a complete implementation though)
* libraries/javalib/java/text/Collator.java: update getInstance(Locale)
* libraries/javalib/java/text/StringCharacterIterator.java: update
setText(int)
* libraries/javalib/java/text/{DecimalFormat,DecimalFormatSymbols,
MessageFormat,NumberFormat,SimpleDateFormat}.java: method name and
spelling corrections
--
Aaron.
-------------- next part --------------
diff -ur kaffe/libraries/javalib/java/beans/FeatureDescriptor.java kaffe/libraries/javalib/java/beans/FeatureDescriptor.java
--- kaffe/libraries/javalib/java/beans/FeatureDescriptor.java Thu Mar 4 12:09:37 1999
+++ kaffe/libraries/javalib/java/beans/FeatureDescriptor.java Fri Mar 5 16:20:56 1999
@@ -103,7 +103,7 @@
return (table.elements());
}
- static protected String capitalize(String name)
+ static String capitalize(String name)
{
if (name.length() > 2 && Character.isUpperCase(name.charAt(0)) && Character.isUpperCase(name.charAt(1))) {
return (name);
diff -ur kaffe/libraries/javalib/java/beans/GenericBeanInfo.java kaffe/libraries/javalib/java/beans/GenericBeanInfo.java
--- kaffe/libraries/javalib/java/beans/GenericBeanInfo.java Thu Mar 4 12:09:37 1999
+++ kaffe/libraries/javalib/java/beans/GenericBeanInfo.java Fri Mar 5 16:22:53 1999
@@ -10,7 +10,7 @@
package java.beans;
-public class GenericBeanInfo extends SimpleBeanInfo {
+class GenericBeanInfo extends SimpleBeanInfo {
public GenericBeanInfo(BeanDescriptor bean, PropertyDescriptor[] properties, MethodDescriptor[] methods, EventSetDescriptor[] events)
{
diff -ur kaffe/libraries/javalib/java/beans/Introspector.java kaffe/libraries/javalib/java/beans/Introspector.java
--- kaffe/libraries/javalib/java/beans/Introspector.java Thu Mar 4 12:09:37 1999
+++ kaffe/libraries/javalib/java/beans/Introspector.java Fri Mar 5 16:24:38 1999
@@ -19,6 +19,8 @@
{
private static String[] beansearch = { "kaffe.beans.infos" };
+private Introspector() {}
+
public static String decapitalize(String name)
{
if (name.length() > 2 && Character.isUpperCase(name.charAt(0)) && Character.isUpperCase(name.charAt(1))) {
diff -ur kaffe/libraries/javalib/java/beans/SimpleBeanInfo.java kaffe/libraries/javalib/java/beans/SimpleBeanInfo.java
--- kaffe/libraries/javalib/java/beans/SimpleBeanInfo.java Thu Mar 4 12:09:37 1999
+++ kaffe/libraries/javalib/java/beans/SimpleBeanInfo.java Fri Mar 5 16:10:47 1999
@@ -59,4 +59,10 @@
return (null);
}
+ public Image loadImage(String resourceName)
+ {
+ //NOT YET IMPLEMENTED
+ return (null);
+ }
+
}
diff -ur kaffe/libraries/javalib/java/io/FileDescriptor.java kaffe/libraries/javalib/java/io/FileDescriptor.java
--- kaffe/libraries/javalib/java/io/FileDescriptor.java Thu Mar 4 12:09:37 1999
+++ kaffe/libraries/javalib/java/io/FileDescriptor.java Fri Mar 5 22:17:33 1999
@@ -12,9 +12,9 @@
public final class FileDescriptor {
- public static FileDescriptor in=initSystemFD(new FileDescriptor(), 0);
- public static FileDescriptor out=initSystemFD(new FileDescriptor(), 1);
- public static FileDescriptor err=initSystemFD(new FileDescriptor(), 2);
+ public static final FileDescriptor in=initSystemFD(new FileDescriptor(), 0);
+ public static final FileDescriptor out=initSystemFD(new FileDescriptor(), 1);
+ public static final FileDescriptor err=initSystemFD(new FileDescriptor(), 2);
private int fd;
diff -ur kaffe/libraries/javalib/java/lang/Character.java kaffe/libraries/javalib/java/lang/Character.java
--- kaffe/libraries/javalib/java/lang/Character.java Thu Mar 4 12:09:46 1999
+++ kaffe/libraries/javalib/java/lang/Character.java Mon Mar 8 22:36:33 1999
@@ -20,34 +20,34 @@
public static final int MAX_RADIX = 36;
public static final char MIN_VALUE = 0x0000;
public static final char MAX_VALUE = 0xffff;
- public static final int UNASSIGNED = 0;
- public static final int UPPERCASE_LETTER = 1;
- public static final int LOWERCASE_LETTER = 2;
- public static final int TITLECASE_LETTER = 3;
- public static final int MODIFIER_LETTER = 4;
- public static final int OTHER_LETTER = 5;
- public static final int NON_SPACING_MARK = 6;
- public static final int ENCLOSING_MARK = 7;
- public static final int COMBINING_SPACING_MARK = 8;
- public static final int DECIMAL_DIGIT_NUMBER = 9;
- public static final int LETTER_NUMBER = 10;
- public static final int OTHER_NUMBER = 11;
- public static final int SPACE_SEPARATOR = 12;
- public static final int LINE_SEPARATOR = 13;
- public static final int PARAGRAPH_SEPARATOR = 14;
- public static final int CONTROL = 15;
- public static final int FORMAT = 16;
- public static final int PRIVATE_USE = 18;
- public static final int SURROGATE = 19;
- public static final int DASH_PUNCTUATION = 20;
- public static final int START_PUNCTUATION = 21;
- public static final int END_PUNCTUATION = 22;
- public static final int CONNECTOR_PUNCTUATION = 23;
- public static final int OTHER_PUNCTUATION = 24;
- public static final int MATH_SYMBOL = 25;
- public static final int CURRENCY_SYMBOL = 26;
- public static final int MODIFIER_SYMBOL = 27;
- public static final int OTHER_SYMBOL = 28;
+ public static final byte UNASSIGNED = 0;
+ public static final byte UPPERCASE_LETTER = 1;
+ public static final byte LOWERCASE_LETTER = 2;
+ public static final byte TITLECASE_LETTER = 3;
+ public static final byte MODIFIER_LETTER = 4;
+ public static final byte OTHER_LETTER = 5;
+ public static final byte NON_SPACING_MARK = 6;
+ public static final byte ENCLOSING_MARK = 7;
+ public static final byte COMBINING_SPACING_MARK = 8;
+ public static final byte DECIMAL_DIGIT_NUMBER = 9;
+ public static final byte LETTER_NUMBER = 10;
+ public static final byte OTHER_NUMBER = 11;
+ public static final byte SPACE_SEPARATOR = 12;
+ public static final byte LINE_SEPARATOR = 13;
+ public static final byte PARAGRAPH_SEPARATOR = 14;
+ public static final byte CONTROL = 15;
+ public static final byte FORMAT = 16;
+ public static final byte PRIVATE_USE = 18;
+ public static final byte SURROGATE = 19;
+ public static final byte DASH_PUNCTUATION = 20;
+ public static final byte START_PUNCTUATION = 21;
+ public static final byte END_PUNCTUATION = 22;
+ public static final byte CONNECTOR_PUNCTUATION = 23;
+ public static final byte OTHER_PUNCTUATION = 24;
+ public static final byte MATH_SYMBOL = 25;
+ public static final byte CURRENCY_SYMBOL = 26;
+ public static final byte MODIFIER_SYMBOL = 27;
+ public static final byte OTHER_SYMBOL = 28;
public static final Class TYPE = Class.getPrimitiveClass("char");
diff -ur kaffe/libraries/javalib/java/lang/Math.java kaffe/libraries/javalib/java/lang/Math.java
--- kaffe/libraries/javalib/java/lang/Math.java Thu Mar 4 12:09:49 1999
+++ kaffe/libraries/javalib/java/lang/Math.java Mon Mar 8 22:56:20 1999
@@ -15,7 +15,7 @@
{
final public static double E = 2.7182818284590452354;
final public static double PI = 3.14159265358979323846;
- public static Random randomGenerator = new Random();
+ private static Random randomGenerator = new Random();
private Math() { /* this class is not instantiable by the general public */ }
diff -ur kaffe/libraries/javalib/java/net/InetAddressImpl.java kaffe/libraries/javalib/java/net/InetAddressImpl.java
--- kaffe/libraries/javalib/java/net/InetAddressImpl.java Thu Mar 4 12:09:54 1999
+++ kaffe/libraries/javalib/java/net/InetAddressImpl.java Fri Mar 5 16:27:41 1999
@@ -12,7 +12,7 @@
import java.lang.String;
-public class InetAddressImpl {
+class InetAddressImpl {
static {
System.loadLibrary("net");
diff -ur kaffe/libraries/javalib/java/net/Socket.java kaffe/libraries/javalib/java/net/Socket.java
--- kaffe/libraries/javalib/java/net/Socket.java Thu Mar 4 12:09:54 1999
+++ kaffe/libraries/javalib/java/net/Socket.java Fri Mar 5 23:03:34 1999
@@ -27,7 +27,7 @@
this(address, port, true);
}
-public Socket(String host, int port) throws IOException {
+public Socket(String host, int port) throws UnknownHostException, IOException {
this(InetAddress.getByName(host), port, true);
}
diff -ur kaffe/libraries/javalib/java/net/SocketOptions.java kaffe/libraries/javalib/java/net/SocketOptions.java
--- kaffe/libraries/javalib/java/net/SocketOptions.java Thu Mar 4 12:09:54 1999
+++ kaffe/libraries/javalib/java/net/SocketOptions.java Fri Mar 5 16:31:38 1999
@@ -10,7 +10,7 @@
package java.net;
-public interface SocketOptions {
+interface SocketOptions {
/*
* Various options. Note that these constants match those used by Sun.
diff -ur kaffe/libraries/javalib/java/net/URLEncoder.java kaffe/libraries/javalib/java/net/URLEncoder.java
--- kaffe/libraries/javalib/java/net/URLEncoder.java Thu Mar 4 12:09:54 1999
+++ kaffe/libraries/javalib/java/net/URLEncoder.java Fri Mar 5 22:27:46 1999
@@ -14,6 +14,8 @@
public class URLEncoder
{
+private URLEncoder() {}
+
public static String encode(String s) {
StringBuffer result = new StringBuffer();
diff -ur kaffe/libraries/javalib/java/sql/DriverManager.java kaffe/libraries/javalib/java/sql/DriverManager.java
--- kaffe/libraries/javalib/java/sql/DriverManager.java Thu Mar 4 12:09:54 1999
+++ kaffe/libraries/javalib/java/sql/DriverManager.java Fri Mar 5 22:29:02 1999
@@ -40,6 +40,8 @@
}
}
+private DriverManager() {}
+
public static synchronized Connection getConnection(String url, String user, String password) throws SQLException {
Properties p = new Properties();
p.put("user", user);
diff -ur kaffe/libraries/javalib/java/sql/Types.java kaffe/libraries/javalib/java/sql/Types.java
--- kaffe/libraries/javalib/java/sql/Types.java Thu Mar 4 12:09:54 1999
+++ kaffe/libraries/javalib/java/sql/Types.java Tue Mar 9 17:25:20 1999
@@ -12,8 +12,10 @@
public class Types {
-// Values to match Sun's version.
+private Types() {}
+// Values to match Sun's version.
+
public static final int BIT = -7;
public static final int TINYINT = -6;
public static final int BIGINT = -5;
diff -ur kaffe/libraries/javalib/java/text/CharacterIterator.java kaffe/libraries/javalib/java/text/CharacterIterator.java
--- kaffe/libraries/javalib/java/text/CharacterIterator.java Thu Mar 4 12:09:54 1999
+++ kaffe/libraries/javalib/java/text/CharacterIterator.java Sun Mar 7 18:27:59 1999
@@ -19,7 +19,7 @@
public abstract char current();
public abstract char next();
public abstract char previous();
-public abstract void setIndex(int pos);
+public abstract char setIndex(int pos);
public abstract int getBeginIndex();
public abstract int getEndIndex();
public abstract int getIndex();
diff -ur kaffe/libraries/javalib/java/text/CollationElementIterator.java kaffe/libraries/javalib/java/text/CollationElementIterator.java
--- kaffe/libraries/javalib/java/text/CollationElementIterator.java Thu Mar 4 12:09:54 1999
+++ kaffe/libraries/javalib/java/text/CollationElementIterator.java Sun Mar 7 18:52:51 1999
@@ -16,6 +16,8 @@
public final static int NULLORDER = 0xffffffff;
+private CollationElementIterator() {}
+
public int next() {
throw new NotImplemented();
}
@@ -28,11 +30,11 @@
throw new NotImplemented();
}
-public final static int secondaryOrder(int order) {
+public final static short secondaryOrder(int order) {
throw new NotImplemented();
}
-public final static int tertiaryOrder(int order) {
+public final static short tertiaryOrder(int order) {
throw new NotImplemented();
}
diff -ur kaffe/libraries/javalib/java/text/CollationKey.java kaffe/libraries/javalib/java/text/CollationKey.java
--- kaffe/libraries/javalib/java/text/CollationKey.java Thu Mar 4 12:09:54 1999
+++ kaffe/libraries/javalib/java/text/CollationKey.java Fri Mar 5 22:34:50 1999
@@ -17,6 +17,8 @@
private String str;
private Collator target;
+private CollationKey() {}
+
public int compareTo(CollationKey other) {
if (target != other.target) {
return (-1);
diff -ur kaffe/libraries/javalib/java/text/Collator.java kaffe/libraries/javalib/java/text/Collator.java
--- kaffe/libraries/javalib/java/text/Collator.java Thu Mar 4 12:09:54 1999
+++ kaffe/libraries/javalib/java/text/Collator.java Mon Mar 8 14:05:13 1999
@@ -76,7 +76,13 @@
public static synchronized Collator getInstance(Locale loc) {
ResourceBundle bundle = Format.getResources("collator", loc);
- return (new RuleBasedCollator(bundle.getString("rule")));
+ try {
+ return (new RuleBasedCollator(bundle.getString("rule")));
+ }
+ catch (ParseException _) {
+ //is this the right thing to do?
+ return null;
+ }
}
public synchronized int getStrength() {
diff -ur kaffe/libraries/javalib/java/text/DecimalFormat.java kaffe/libraries/javalib/java/text/DecimalFormat.java
--- kaffe/libraries/javalib/java/text/DecimalFormat.java Thu Mar 4 12:09:54 1999
+++ kaffe/libraries/javalib/java/text/DecimalFormat.java Sun Mar 7 20:40:15 1999
@@ -38,7 +38,7 @@
applyPattern(pattern);
}
-public DecimalFormat(String pattern, Locale loc) {
+DecimalFormat(String pattern, Locale loc) {
this(pattern, new DecimalFormatSymbols(loc));
}
@@ -49,16 +49,16 @@
if (patt[i] == syms.digit) {
patt[i] = '#';
}
- else if (patt[i] == syms.patternSeperator) {
+ else if (patt[i] == syms.patternSeparator) {
patt[i] = ';';
}
else if (patt[i] == syms.zeroDigit) {
patt[i] = '0';
}
- else if (patt[i] == syms.groupSeperator) {
+ else if (patt[i] == syms.groupSeparator) {
patt[i] = ',';
}
- else if (patt[i] == syms.decimalSeperator) {
+ else if (patt[i] == syms.decimalSeparator) {
patt[i] = '.';
}
else if (patt[i] == syms.percentSign) {
@@ -261,13 +261,13 @@
int count = 0;
for (int i = endpos - 1; i >= startpos && count < maxint; i--, count++) {
if (grouping == true && count % groupsize == 0 && count > 0) {
- buf.append(syms.groupSeperator);
+ buf.append(syms.groupSeparator);
}
buf.append((char)(val[i] - '0' + syms.zeroDigit));
}
for (; count < minint; count++) {
if (grouping == true && count % groupsize == 0) {
- buf.append(syms.groupSeperator);
+ buf.append(syms.groupSeparator);
}
buf.append(syms.zeroDigit);
}
@@ -319,7 +319,7 @@
}
if (decsepshown == true || (intonly == false && (decpos != -1 || minfrac > 0))) {
- app.append(syms.decimalSeperator);
+ app.append(syms.decimalSeparator);
}
if (pos.field == FRACTION_FIELD) {
@@ -347,7 +347,7 @@
return (syms);
}
-public int getGroupSize() {
+public int getGroupingSize() {
return (groupsize);
}
@@ -375,7 +375,7 @@
return (super.hashCode());
}
-public boolean isDecimalSeperatorAlwaysShown() {
+public boolean isDecimalSeparatorAlwaysShown() {
return (decsepshown);
}
@@ -412,7 +412,7 @@
if ( Character.isDigit( c) ) {
can[cl++] = c;
}
- else if ( c == syms.decimalSeperator) {
+ else if ( c == syms.decimalSeparator) {
can[cl++] = '.';
}
}
@@ -452,7 +452,7 @@
positivesuffix = val;
}
-public String toLocalizePattern() {
+public String toLocalizedPattern() {
throw new NotImplemented();
}
diff -ur kaffe/libraries/javalib/java/text/DecimalFormatSymbols.java kaffe/libraries/javalib/java/text/DecimalFormatSymbols.java
--- kaffe/libraries/javalib/java/text/DecimalFormatSymbols.java Thu Mar 4 12:09:55 1999
+++ kaffe/libraries/javalib/java/text/DecimalFormatSymbols.java Sun Mar 7 20:29:32 1999
@@ -18,10 +18,10 @@
public class DecimalFormatSymbols implements Serializable, Cloneable {
char digit;
-char patternSeperator;
+char patternSeparator;
char zeroDigit;
-char groupSeperator;
-char decimalSeperator;
+char groupSeparator;
+char decimalSeparator;
char percentSign;
char permillSign;
char minusSign;
@@ -37,10 +37,10 @@
ResourceBundle bundle = Format.getResources("numberformat", loc);
digit = bundle.getString("#").charAt(0);
- patternSeperator = bundle.getString(";").charAt(0);
+ patternSeparator = bundle.getString(";").charAt(0);
zeroDigit = bundle.getString("0").charAt(0);
- groupSeperator = bundle.getString(",").charAt(0);
- decimalSeperator = bundle.getString(".").charAt(0);
+ groupSeparator = bundle.getString(",").charAt(0);
+ decimalSeparator = bundle.getString(".").charAt(0);
percentSign = bundle.getString("%").charAt(0);
permillSign = bundle.getString("\u2030").charAt(0);
minusSign = bundle.getString("-").charAt(0);
@@ -62,10 +62,10 @@
try {
DecimalFormatSymbols other = (DecimalFormatSymbols)obj;
if (digit == other.digit &&
- patternSeperator == other.patternSeperator &&
+ patternSeparator == other.patternSeparator &&
zeroDigit == other.zeroDigit &&
- groupSeperator == other.groupSeperator &&
- decimalSeperator == other.decimalSeperator &&
+ groupSeparator == other.groupSeparator &&
+ decimalSeparator == other.decimalSeparator &&
percentSign == other.percentSign &&
permillSign == other.permillSign &&
minusSign == other.minusSign &&
@@ -80,15 +80,15 @@
}
public char getDecimalSeparator() {
- return (decimalSeperator);
+ return (decimalSeparator);
}
public char getDigit() {
return (digit);
}
-public char getGroupingSeperator() {
- return (groupSeperator);
+public char getGroupingSeparator() {
+ return (groupSeparator);
}
public String getInfinity() {
@@ -99,12 +99,12 @@
return (minusSign);
}
-public String getNan() {
+public String getNaN() {
return (nan);
}
-public char getPatternSeperator() {
- return (patternSeperator);
+public char getPatternSeparator() {
+ return (patternSeparator);
}
public char getPercent() {
@@ -124,15 +124,15 @@
}
public void setDecimalSeparator(char val) {
- decimalSeperator = val;
+ decimalSeparator = val;
}
public void setDigit(char val) {
digit = val;
}
-public void setGroupingSeperator(char val) {
- groupSeperator = val;
+public void setGroupingSeparator(char val) {
+ groupSeparator = val;
}
public void setInfinity(String val) {
@@ -143,12 +143,12 @@
minusSign = val;
}
-public void setNan(String val) {
+public void setNaN(String val) {
nan = val;
}
-public void setPatternSeperator(char val) {
- patternSeperator = val;
+public void setPatternSeparator(char val) {
+ patternSeparator = val;
}
public void setPercent(char val) {
diff -ur kaffe/libraries/javalib/java/text/MessageFormat.java kaffe/libraries/javalib/java/text/MessageFormat.java
--- kaffe/libraries/javalib/java/text/MessageFormat.java Thu Mar 4 12:09:55 1999
+++ kaffe/libraries/javalib/java/text/MessageFormat.java Mon Mar 8 13:25:18 1999
@@ -133,7 +133,7 @@
forms[argcount] = NumberFormat.getCurrencyInstance(loc);
}
else if (astyle.equals("percent")) {
- forms[argcount] = NumberFormat.getPercentageInstance(loc);
+ forms[argcount] = NumberFormat.getPercentInstance(loc);
}
else if (astyle.equals("integer")) {
forms[argcount] = NumberFormat.getNumberInstance(loc);
diff -ur kaffe/libraries/javalib/java/text/NumberFormat.java kaffe/libraries/javalib/java/text/NumberFormat.java
--- kaffe/libraries/javalib/java/text/NumberFormat.java Thu Mar 4 12:09:55 1999
+++ kaffe/libraries/javalib/java/text/NumberFormat.java Mon Mar 8 13:24:42 1999
@@ -123,11 +123,11 @@
return (new DecimalFormat("#,##0.###;-#,##0.###", loc));
}
-final public static NumberFormat getPercentageInstance() {
- return (getPercentageInstance(Locale.getDefault()));
+final public static NumberFormat getPercentInstance() {
+ return (getPercentInstance(Locale.getDefault()));
}
-public static NumberFormat getPercentageInstance(Locale loc) {
+public static NumberFormat getPercentInstance(Locale loc) {
ResourceBundle bundle = getResources("numberformat", loc);
String cs = bundle.getString("%");
return (new DecimalFormat("#,##0" + cs, loc));
diff -ur kaffe/libraries/javalib/java/text/RuleBasedCollator.java kaffe/libraries/javalib/java/text/RuleBasedCollator.java
--- kaffe/libraries/javalib/java/text/RuleBasedCollator.java Thu Mar 4 12:09:55 1999
+++ kaffe/libraries/javalib/java/text/RuleBasedCollator.java Sun Mar 7 21:52:09 1999
@@ -15,7 +15,7 @@
public class RuleBasedCollator extends Collator {
-public RuleBasedCollator(String rules) {
+public RuleBasedCollator(String rules) throws ParseException {
/* NotImplemented */
}
diff -ur kaffe/libraries/javalib/java/text/SimpleDateFormat.java kaffe/libraries/javalib/java/text/SimpleDateFormat.java
--- kaffe/libraries/javalib/java/text/SimpleDateFormat.java Thu Mar 4 12:09:55 1999
+++ kaffe/libraries/javalib/java/text/SimpleDateFormat.java Sun Mar 7 21:53:28 1999
@@ -366,7 +366,7 @@
this.syms = syms;
}
-public String toLocalizePattern() {
+public String toLocalizedPattern() {
StringBuffer buf = new StringBuffer();
String locals = syms.getLocalPatternChars();
diff -ur kaffe/libraries/javalib/java/text/StringCharacterIterator.java kaffe/libraries/javalib/java/text/StringCharacterIterator.java
--- kaffe/libraries/javalib/java/text/StringCharacterIterator.java Thu Mar 4 12:09:55 1999
+++ kaffe/libraries/javalib/java/text/StringCharacterIterator.java Sun Mar 7 18:46:59 1999
@@ -102,7 +102,16 @@
return (DONE);
}
-public void setIndex(int pos) {
+public char setIndex(int pos) {
+ if ( pos < getBeginIndex() || pos > getEndIndex() ) {
+ throw new IllegalArgumentException("Invalid index: "+pos);
+ }
+
this.pos = pos;
+
+ if ( pos == getEndIndex() )
+ return this.DONE;
+ else
+ return text.charAt(pos);
}
}
diff -ur kaffe/libraries/javalib/java/util/Date.java kaffe/libraries/javalib/java/util/Date.java
--- kaffe/libraries/javalib/java/util/Date.java Thu Mar 4 12:09:55 1999
+++ kaffe/libraries/javalib/java/util/Date.java Tue Mar 9 14:29:52 1999
@@ -1,5 +1,6 @@
package java.util;
+import java.io.Serializable;
import java.lang.String;
import java.lang.System;
import java.text.DateFormat;
@@ -14,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file.
*/
-public class Date
+public class Date implements Serializable, Cloneable
{
private long time = 0;
diff -ur kaffe/libraries/javalib/java/util/Stack.java kaffe/libraries/javalib/java/util/Stack.java
--- kaffe/libraries/javalib/java/util/Stack.java Thu Mar 4 12:09:55 1999
+++ kaffe/libraries/javalib/java/util/Stack.java Mon Mar 8 20:26:26 1999
@@ -20,7 +20,7 @@
return isEmpty();
}
-public synchronized Object peek() throws EmptyStackException {
+public synchronized Object peek() {
try {
return elementAt(size() - 1);
} catch (ArrayIndexOutOfBoundsException _) {
@@ -28,7 +28,7 @@
}
}
-public synchronized Object pop() throws EmptyStackException {
+public synchronized Object pop() {
Object peeked = peek();
removeElementAt(size() - 1);
More information about the kaffe
mailing list