Skip to content

Commit

Permalink
rename function for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Dec 19, 2024
1 parent 78caf64 commit 329fec6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ public List<EnvOption> getCompileOptions() {
return List.of(
EnvOption.declarations(
Decls.newFunction(
"eventTypeIds",
"jfrEventTypeIds",
Decls.newOverload(
"eventTypeIds_void",
"jfrEventTypeIds_void",
List.of(
Decls.newObjectType(
SimplifiedTarget.class.getName())),
Expand All @@ -288,14 +288,14 @@ public List<ProgramOption> getProgramOptions() {
return List.of(
ProgramOption.functions(
Overload.unary(
"eventTypeIds",
"jfrEventTypeIds",
(arg) ->
ListT.newStringArrayList(
getEventTypeIds(
getJfrEventTypeIds(
(SimplifiedTarget) arg.value())))));
}

private String[] getEventTypeIds(SimplifiedTarget st) {
private String[] getJfrEventTypeIds(SimplifiedTarget st) {
Target target = Target.find("id", st.id()).singleResult();
try {
return connectionManager.executeConnectedTask(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public void testPostWithoutTargets() {
"this is garbage | 400 | false",
"target.alias == 'selftest' | 200 | true",
"target.alias == '' | 200 | false",
"eventTypeIds(target).exists(x, x.contains('jdk')) | 200 | true",
"eventTypeIds(target).exists(t, t.contains('nonsense')) | 200 | false",
"eventTypeIds(target).exists(x, t.contains('wrong binding')) | 400 | false",
"jfrEventTypeIds(target).exists(x, x.contains('jdk')) | 200 | true",
"jfrEventTypeIds(target).exists(t, t.contains('nonsense')) | 200 | false",
"jfrEventTypeIds(target).exists(x, t.contains('wrong binding')) | 400 | false",
})
public void testExpressionTest(String expr, int status, boolean expectTargets) {
int id = defineSelfCustomTarget();
Expand Down

0 comments on commit 329fec6

Please sign in to comment.