diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java index cd39fb7b6e8..781661a427f 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java @@ -144,7 +144,7 @@ final class QueryResolver { field.aggregator = expression.aggregator(); FieldBuilder.configureAggregator(field); expression.alias().ifPresent(alias -> fieldAliases.put(alias, field)); - if (field.name.equals("*") && field.aggregator != Aggregator.COUNT) { + if (expression.name().equals("*") && field.aggregator != Aggregator.COUNT) { throw new QuerySyntaxException("Wildcard ('*') can only be used with aggregator function COUNT"); } } @@ -259,7 +259,7 @@ final class QueryResolver { List fields = new ArrayList<>(); if (name.equals("*")) { - // Used with COUNT(*) and UNIQUE(*) + // Used with COUNT(*) // All events should have a start time name = "startTime"; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/query/view.ini b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/view.ini index b21b99e2dad..51dc2ca11bf 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/query/view.ini +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/view.ini @@ -178,7 +178,7 @@ table = "COLUMN 'StackTrace', 'Count', 'Avg.', 'Max.' [application.contention-by-address] label = "Contention by Monitor Address" table = "COLUMN 'Monitor Address', 'Class', 'Threads', 'Max Duration' - SELECT address, FIRST(monitorClass), UNIQUE(*), MAX(duration) AS M + SELECT address, FIRST(monitorClass), UNIQUE(eventThread), MAX(duration) AS M FROM JavaMonitorEnter GROUP BY monitorClass ORDER BY M"