Skip to content

Commit

Permalink
Make it possible for FormatStd to be cloned.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed May 1, 2024
1 parent e9b7762 commit 75572bd
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @author Fabio
*/
public class FormatStd {
public class FormatStd implements Cloneable {

public enum FormatterEnum {
PYDEVF, AUTOPEP8, BLACK, RUFF
Expand All @@ -17,7 +17,7 @@ public enum FormatterEnum {
public static final String RUFF = "RUFF";

public static FormatterEnum getFormatterEnumFromStr(String formatterStyleStr) {
switch (formatterStyleStr) {
switch (formatterStyleStr.toUpperCase()) {
case AUTOPEP8:
return FormatterEnum.AUTOPEP8;
case BLACK:
Expand Down Expand Up @@ -131,4 +131,13 @@ public void updateFormatterStyle() {
}
}

@Override
public FormatStd clone() {
try {
return (FormatStd) super.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
}

}

0 comments on commit 75572bd

Please sign in to comment.