Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
tools: Add more type arguments to locals in PluginLoader, getting rid…
Browse files Browse the repository at this point in the history
… of some compiler warnings
  • Loading branch information
tombentley committed Aug 24, 2012
1 parent ad5bb67 commit d194b64
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions common/src/com/redhat/ceylon/common/tool/PluginLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ private <T extends Plugin, A> void addMethod(Class<T> cls, PluginModel<T> model,
model.setRest(method);
}

OptionModel optionModel = buildOption(method);
OptionModel optionArgumentModel = buildOptionArgument(method);
OptionModel<Boolean> optionModel = buildOption(method);
OptionModel<A> optionArgumentModel = buildOptionArgument(method);
ArgumentModel<A> argumentModel = buildArgument(method, argumentModels);
if (optionModel!= null) {
if (argumentModel != null) {
Expand All @@ -182,7 +182,7 @@ private <T extends Plugin, A> void addMethod(Class<T> cls, PluginModel<T> model,
}

private <T extends Plugin> void checkDuplicateOption(Class<T> cls,
PluginModel<T> model, OptionModel optionModel) {
PluginModel<T> model, OptionModel<?> optionModel) {
if (model.getOption(optionModel.getLongName()) != null) {
throw new ModelException(cls + " has more than one binding for option " + optionModel.getLongName());
}
Expand Down Expand Up @@ -268,15 +268,15 @@ private String getOptionName(String name, Method setter) {
return name;
}

private OptionModel buildOption(final Method setter) {
private OptionModel<Boolean> buildOption(final Method setter) {
Option option = setter.getAnnotation(Option.class);
if (option == null) {
return null;
}
if (!isSetter(setter)) {
throw new ModelException("Method" + setter + " is annotated with @Option but is not a setter");
}
OptionModel optionModel = new OptionModel();
OptionModel<Boolean> optionModel = new OptionModel<Boolean>();
optionModel.setLongName(getOptionName(option.longName(), setter));
char shortName = option.shortName();
if (shortName != Option.NO_SHORT) {
Expand All @@ -288,15 +288,15 @@ private OptionModel buildOption(final Method setter) {
return optionModel;
}

private <A> OptionModel buildOptionArgument(final Method setter) {
private <A> OptionModel<A> buildOptionArgument(final Method setter) {
OptionArgument option = setter.getAnnotation(OptionArgument.class);
if (option == null) {
return null;
}
if (!isSetter(setter)) {
throw new ModelException("Method " + setter + " is annotated with @OptionArgument but is not a setter");
}
OptionModel optionModel = new OptionModel();
OptionModel<A> optionModel = new OptionModel<A>();
optionModel.setLongName(getOptionName(option.longName(), setter));
char shortName = option.shortName();
if (shortName != OptionArgument.NO_SHORT) {
Expand Down

0 comments on commit d194b64

Please sign in to comment.