You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "maedhroz (via GitHub)" <gi...@apache.org> on 2024/04/13 04:48:49 UTC
Re: [PR] CASSANDRA-19493 Optionally fail writes when SAI refuses to index a term value exceeding a configured maximum size [cassandra]
maedhroz commented on code in PR #3241:
URL: https://github.com/apache/cassandra/pull/3241#discussion_r1563691881
##########
test/anttasks/org/apache/cassandra/anttasks/TestNameCheckTask.java:
##########
@@ -158,14 +161,21 @@ private Class<?> normalize(Class<?> klass)
*/
private Stream<? extends Class<?>> expand(Class<?> klass, Reflections reflections)
{
- Set<? extends Class<?>> subTypes = reflections.getSubTypesOf(klass);
- if (subTypes == null || subTypes.isEmpty())
- return Stream.of(klass);
- Stream<? extends Class<?>> subs = subTypes.stream();
- // assume we include if not abstract
- if (!Modifier.isAbstract(klass.getModifiers()))
- subs = Stream.concat(Stream.of(klass), subs);
- return subs;
+ Set<Class<?>> concreteTypes = new HashSet<>();
+ Deque<Class<?>> typeStack = new ArrayDeque<>();
+ typeStack.push(klass);
+
+ while (!typeStack.isEmpty())
+ {
+ Class<?> type = typeStack.pop();
+
+ if (!Modifier.isAbstract(type.getModifiers()))
+ concreteTypes.add(type);
+
+ reflections.getSubTypesOf(type).forEach(typeStack::push);
+ }
+
+ return concreteTypes.stream();
Review Comment:
@jacek-lewandowski @smiklosovic This was causing issues for `ValueThresholdTester`, which is a subclass of `ThresholdTester` but is also `abstract`. Basically we can handle more than one level of inheritance now. WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org