Skip to content

Commit

Permalink
feat(matching_handlers): Use class like comparators for enum declarat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
jpedroh committed Mar 13, 2024
1 parent c3bcede commit 209df73
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 1 deletion.
21 changes: 21 additions & 0 deletions bin/tests/scenarios/enums_inside_classes/base.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package de.fosd.jdime.stats;

public final class KeyEnums {
private KeyEnums() {}

public enum Type {
FILE,
DIRECTORY,
LINE,
NODE,
CLASS,
METHOD
}

public enum Level {
NONE,
TOP,
CLASS,
METHOD
}
}
22 changes: 22 additions & 0 deletions bin/tests/scenarios/enums_inside_classes/left.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package de.fosd.jdime.stats;

public final class KeyEnums {
private KeyEnums() {}

public enum Type {
FILE,
DIRECTORY,
LINE,
NODE,
CLASS,
METHOD,
TRY
}

public enum Level {
NONE,
TOP,
CLASS,
METHOD
}
}
1 change: 1 addition & 0 deletions bin/tests/scenarios/enums_inside_classes/merge.java
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package de . fosd . jdime . stats ; public final class KeyEnums { private KeyEnums ( ) { } public enum Type { FILE , DIRECTORY , LINE , NODE , CLASS , METHOD , TRY } public enum Level { NONE , TOP , CLASS , METHOD } }
22 changes: 22 additions & 0 deletions bin/tests/scenarios/enums_inside_classes/right.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package de.fosd.jdime.stats;

public final class KeyEnums {
private KeyEnums() {}

public enum Type {
FILE,
DIRECTORY,
LINE,
NODE,
CLASS,
METHOD,
TRY
}

public enum Level {
NONE,
TOP,
CLASS,
METHOD
}
}
2 changes: 1 addition & 1 deletion matching_handlers/src/java/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn get_default_java_matching_handlers<'a>() -> MatchingHandlers<'a> {
compute_matching_score_for_class_like_declaration,
);
matching_handlers.register(
"interface_declaration",
"enum_declaration",
compute_matching_score_for_class_like_declaration,
);
matching_handlers
Expand Down

0 comments on commit 209df73

Please sign in to comment.