OpenMRS

Move refactoring

In SwaggerSpecificationCreator.java you'll see two static methods:

//FIXME: move to separate util calls
// see: https://stackoverflow.com/q/13783295/3647002
public static String[] getEnums(Class<? extends Enum<?>> e) {
    return Arrays.toString(e.getEnumConstants())
             .replaceAll("^.|.$", "").split(", ");
}

public static List<String> getEnumsAsList(Class<? extends Enum<?>> e) {
    return Arrays.asList(getEnums(e));
}

Move these two methods to EnumProperty class as they better belong in there. If you're using IntelliJ IDEA please refer to Performing a Move refactoring. Once done make sure you also remove these two lines:

//FIXME: move to separate util calls
// see: https://stackoverflow.com/q/13783295/3647002

Task tags

  • coding
  • easy

Students who completed this task

Bartłomiej Rasztabiga

Task type

  • code Code
close

2017