Skip to content

Commit

Permalink
Add generic type to Class usage (#2123)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 4769697c4b06ceb2004adf17a3ffec41ab45e577
  • Loading branch information
orcunc authored and actions-user committed May 31, 2024
1 parent 65b0419 commit a9eacf9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public enum GlobalMemoryAccessorType {
* as appropriate to the underlying platform's architecture.
* <p>
* If the underlying platform supports unaligned memory access, it will match the standard
* {@link GlobalMemoryAccessor} because there's no need for aligmnent checks.
* Otherwise it will match the alignment-aware {@link GlobalMemoryAccessor}.
* {@link GlobalMemoryAccessor} because there's no need for alignment checks.
* Otherwise, it will match the alignment-aware {@link GlobalMemoryAccessor}.
*/
PLATFORM_AWARE,
}
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public boolean equals(Object o) {
}

// since we already checked that the two descriptors have the same number
// of tags, we can safely compare them from only one side but we need
// of tags, we can safely compare them from only one side, but we need
// to compare pairs. The order of tags doesn't matter.
outer:
for (int i = 0; i < tagPtr; i += 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ class MetricsCollectionCycle {
private static final MetricValueCatcher NOOP_CATCHER = new NoOpMetricValueCatcher();

private final PoolingMetricDescriptorSupplier descriptorSupplier;
private final Function<Class, SourceMetadata> lookupMetadataFn;
private final Function<Class<?>, SourceMetadata> lookupMetadataFn;
private final Function<MetricDescriptor, MetricValueCatcher> lookupMetricValueCatcherFn;
private final MetricsCollector metricsCollector;
private final ProbeLevel minimumLevel;
private final MetricsContext metricsContext = new MetricsContext();
private final long collectionId = System.nanoTime();
private final ILogger logger = Logger.getLogger(MetricsCollectionCycle.class);

MetricsCollectionCycle(Function<Class, SourceMetadata> lookupMetadataFn,
MetricsCollectionCycle(Function<Class<?>, SourceMetadata> lookupMetadataFn,
Function<MetricDescriptor, MetricValueCatcher> lookupMetricValueCatcherFn,
MetricsCollector metricsCollector,
ProbeLevel minimumLevel, MetricDescriptorReusableData metricDescriptorReusableData) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ final class SourceMetadata {
private final List<MethodProbe> methods = new ArrayList<>();
private final Collection<MetricTarget> excludedTargetsClass;

SourceMetadata(Class clazz) {
SourceMetadata(Class<?> clazz) {
// we scan all the methods/fields of the class/interface hierarchy.
Collection<Class<?>> classList = new LinkedHashSet<>();
flatten(clazz, classList);

for (Class flattenedClass : classList) {
for (Class<?> flattenedClass : classList) {
scanFields(flattenedClass);
scanMethods(flattenedClass);
}
Expand All @@ -67,9 +67,9 @@ void register(MetricsRegistryImpl metricsRegistry, Object source, String namePre
}
}

private Collection<MetricTarget> getTypeExcludedTarget(Class clazz) {
private Collection<MetricTarget> getTypeExcludedTarget(Class<?> clazz) {
Collection<MetricTarget> typeExclusions;
ExcludedMetricTargets targetsAnnotation = (ExcludedMetricTargets) clazz.getAnnotation(ExcludedMetricTargets.class);
ExcludedMetricTargets targetsAnnotation = clazz.getAnnotation(ExcludedMetricTargets.class);
if (targetsAnnotation != null) {
typeExclusions = unmodifiableList(asList(targetsAnnotation.value()));
} else {
Expand Down

0 comments on commit a9eacf9

Please sign in to comment.