Index: src/java/org/apache/lucene/document/Field.java =================================================================== --- src/java/org/apache/lucene/document/Field.java (revision 178062) +++ src/java/org/apache/lucene/document/Field.java (working copy) @@ -254,17 +254,17 @@ /** The value of the field as a String, or null. If null, the Reader value * or binary value is used. Exactly one of stringValue(), readerValue(), and * binaryValue() must be set. */ - public String stringValue() { try { return (String)fieldsData; } catch (ClassCastException ignore) { return null; } } + public String stringValue() { if(fieldsData instanceof String) {return (String)fieldsData;}else return null;} /** The value of the field as a Reader, or null. If null, the String value * or binary value is used. Exactly one of stringValue(), readerValue(), * and binaryValue() must be set. */ - public Reader readerValue() { try { return (Reader)fieldsData; } catch (ClassCastException ignore) { return null; } } + public Reader readerValue() { if(fieldsData instanceof Reader) {return (Reader)fieldsData;}else return null;} /** The value of the field in Binary, or null. If null, the Reader or * String value is used. Exactly one of stringValue(), readerValue() and * binaryValue() must be set. */ - public byte[] binaryValue() { try { return (byte[])fieldsData; } catch (ClassCastException ignore) { return null; } } + public byte[] binaryValue() { if(fieldsData instanceof byte[]) {return (byte[])fieldsData;}else return null;} /** * Create a field by specifying its name, value and how it will