Dave added the @SuppressWarnings("unchecked") because his stricker warning system in Eclipse told
him (correctly) that some of the null checking there was not needed. If you have that setting off, however, Eclipse warns that the @SuppressWarnings itself is unneeded. So, instead of freaking out Eclipses of one persuasion or the other, lets just clean up the code and add an explanatory comment. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5285 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -52,7 +52,6 @@ public abstract class FieldMarshaller
|
||||
* Returns a field marshaller appropriate for the supplied field or null if no marshaller
|
||||
* exists for the type contained by the field in question.
|
||||
*/
|
||||
@SuppressWarnings("null")
|
||||
public static FieldMarshaller getFieldMarshaller (Field field)
|
||||
{
|
||||
if (_marshallers == null) {
|
||||
@@ -71,11 +70,12 @@ public abstract class FieldMarshaller
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
// no problem
|
||||
}
|
||||
if ((reader != null || writer != null) && (reader == null || writer == null)) {
|
||||
log.warning("Class contains one but not both custom field reader and writer " +
|
||||
"[class=" + field.getDeclaringClass().getName() +
|
||||
", field=" + field.getName() + ", reader=" + reader +
|
||||
", writer=" + writer + "].");
|
||||
// To get to this code path, either an exception was thrown when fetching reader or
|
||||
// when fetching writer... either way writer is guaranteed to be null.
|
||||
if (reader != null) {
|
||||
log.warning("Class contains a custom field reader, but not a writer",
|
||||
"class", field.getDeclaringClass().getName(), "field", field.getName(),
|
||||
"reader", reader);
|
||||
// fall through to using reflection on the fields...
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user