Fix equals and enhance error checking
X-SVN-Rev: 917
This commit is contained in:
parent
1c55f1f997
commit
80a86736aa
@ -229,7 +229,7 @@ import java.text.*;
|
||||
* *Unsupported by Java (and hence unsupported by UnicodeSet).
|
||||
*
|
||||
* @author Alan Liu
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.12 $ $Date: 2000/02/29 01:19:02 $
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.13 $ $Date: 2000/03/08 21:56:41 $
|
||||
*/
|
||||
public class UnicodeSet implements UnicodeFilter {
|
||||
/**
|
||||
@ -635,7 +635,7 @@ public class UnicodeSet implements UnicodeFilter {
|
||||
*/
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof UnicodeSet &&
|
||||
pairs.equals(((UnicodeSet)o).pairs);
|
||||
pairs.toString().equals(((UnicodeSet)o).pairs.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -901,6 +901,11 @@ public class UnicodeSet implements UnicodeFilter {
|
||||
}
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
throw new IllegalArgumentException("Missing '[' in \"" +
|
||||
pattern.substring(start) + '"');
|
||||
}
|
||||
|
||||
// Handle unprocessed stuff preceding the closing ']'
|
||||
if (lastOp == '-') {
|
||||
// Trailing '-' is treated as literal
|
||||
|
@ -229,7 +229,7 @@ import java.text.*;
|
||||
* *Unsupported by Java (and hence unsupported by UnicodeSet).
|
||||
*
|
||||
* @author Alan Liu
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.12 $ $Date: 2000/02/29 01:19:02 $
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.13 $ $Date: 2000/03/08 21:56:41 $
|
||||
*/
|
||||
public class UnicodeSet implements UnicodeFilter {
|
||||
/**
|
||||
@ -635,7 +635,7 @@ public class UnicodeSet implements UnicodeFilter {
|
||||
*/
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof UnicodeSet &&
|
||||
pairs.equals(((UnicodeSet)o).pairs);
|
||||
pairs.toString().equals(((UnicodeSet)o).pairs.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -901,6 +901,11 @@ public class UnicodeSet implements UnicodeFilter {
|
||||
}
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
throw new IllegalArgumentException("Missing '[' in \"" +
|
||||
pattern.substring(start) + '"');
|
||||
}
|
||||
|
||||
// Handle unprocessed stuff preceding the closing ']'
|
||||
if (lastOp == '-') {
|
||||
// Trailing '-' is treated as literal
|
||||
|
Loading…
Reference in New Issue
Block a user