Bug fixes

-- Sorting of ArgumentSources now done in GATKDoclet, not in the ParsingEngine, as the system depends on the LinkedTreeMap
-- Fixed broken exception throwing in the case where a file's type could not be determined
This commit is contained in:
Mark DePristo 2011-08-18 21:58:36 -04:00
parent c5efb6f40e
commit d1892cd0d7
3 changed files with 8 additions and 7 deletions

View File

@ -375,13 +375,14 @@ class RodBindingArgumentTypeDescriptor extends ArgumentTypeDescriptor {
if ( featureDescriptor != null ) {
tribbleType = featureDescriptor.getName();
logger.warn("Dynamically determined type of " + file + " to be " + tribbleType);
} else {
throw new UserException.CommandLineException(
String.format("No tribble type was provided on the command line and the type of the file could not be determined dynamically. " +
"Please add an explicit type tag :NAME listing the correct type from among the supported types:%n%s",
manager.userFriendlyListOfAvailableFeatures(parameterType)));
}
}
if ( tribbleType == null )
throw new UserException.CommandLineException(
String.format("No tribble type was provided on the command line and the type of the file could not be determined dynamically. " +
"Please add an explicit type tag :NAME listing the correct type from among the supported types:%n%s",
manager.userFriendlyListOfAvailableFeatures(parameterType)));
}
}

View File

@ -451,7 +451,7 @@ public class ParsingEngine {
* @return A map of sources associated with this object and its aggregated objects and bindings to their bindings values
*/
private Map<ArgumentSource, Object> extractArgumentBindings(Object obj, Class sourceClass, Field[] parentFields) {
Map<ArgumentSource, Object> bindings = new TreeMap<ArgumentSource, Object>();
Map<ArgumentSource, Object> bindings = new LinkedHashMap<ArgumentSource, Object>();
while( sourceClass != null ) {
Field[] fields = sourceClass.getDeclaredFields();

View File

@ -120,7 +120,7 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler {
args.put("hidden", new ArrayList<Object>());
args.put("depreciated", new ArrayList<Object>());
try {
for ( ArgumentSource argumentSource : parsingEngine.extractArgumentSources(HelpUtils.getClassForDoc(classdoc)) ) {
for ( ArgumentSource argumentSource : new TreeSet<ArgumentSource>(parsingEngine.extractArgumentSources(HelpUtils.getClassForDoc(classdoc))) ) {
ArgumentDefinition argDef = argumentSource.createArgumentDefinitions().get(0);
FieldDoc fieldDoc = getFieldDoc(classdoc, argumentSource.field.getName());
Map<String, Object> argBindings = docForArgument(fieldDoc, argumentSource, argDef); // todo -- why can you have multiple ones?