dynamobi/dynamobi — Issue #602: [FRG-270] fix two problems reported by findbugs in DDL and JmiChangeSet
Author: dynamobi-build
Created: 2011-12-30 03:37:55+00:00
State: open
Labels: DDL, FRG

[reporter="jvs", created="Fri, 18 May 2007 17:14:41 -0500 (GMT-05:00)"]
This one hurts efficiency but not correctness.

//open/lu/dev/farrago/src/org/eigenbase/jmi/JmiChangeSet.java

// Avoid unnecessary updates in the case where ordinals

// are already correct.

if (oldOrdinal != newOrdinal) {

target.refSetValue("ordinal", newOrdinal);

}

}

}

}

This one isn't a problem, but using an enum instead of the pre-JDK 1.5 Integer pattern would be an improvement, and would make findbugs happy.

//open/lu/dev/farrago/src/net/sf/farrago/ddl/DdlValidator.java

{

stmtValidator.setParserPosition(null);

if (action == VALIDATE_CREATION) {

return invokeHandler(modelElement, "validateDefinition");

} else if (action == VALIDATE_MODIFICATION) {

return invokeHandler(modelElement, "validateModification");

} else if (action == VALIDATE_DELETION) {

return invokeHandler(modelElement, "validateDrop");

} else if (action == VALIDATE_TRUNCATION) {

return invokeHandler(modelElement, "validateTruncation");

} else {

throw new AssertionError();

}