|
23 | 23 | import org.openrewrite.csharp.CSharpPrinter; |
24 | 24 | import org.openrewrite.csharp.CSharpVisitor; |
25 | 25 | import org.openrewrite.java.JavaPrinter; |
26 | | -import org.openrewrite.java.JavaTypeVisitor; |
27 | | -import org.openrewrite.java.JavaVisitor; |
28 | | -import org.openrewrite.java.JavadocVisitor; |
29 | 26 | import org.openrewrite.java.internal.TypesInUse; |
30 | 27 | import org.openrewrite.java.tree.*; |
31 | 28 | import org.openrewrite.marker.Markers; |
|
40 | 37 | import java.util.Collections; |
41 | 38 | import java.util.List; |
42 | 39 | import java.util.UUID; |
43 | | -import java.util.concurrent.atomic.AtomicInteger; |
44 | | -import java.util.function.Predicate; |
45 | 40 | import java.util.stream.Collectors; |
46 | 41 |
|
47 | 42 | import static java.util.Collections.singletonList; |
@@ -221,37 +216,6 @@ public TypesInUse getTypesInUse() { |
221 | 216 | return cache; |
222 | 217 | } |
223 | 218 |
|
224 | | - @Transient |
225 | | - @Override |
226 | | - public long getWeight(Predicate<Object> uniqueIdentity) { |
227 | | - AtomicInteger n = new AtomicInteger(); |
228 | | - new CSharpVisitor<AtomicInteger>() { |
229 | | - final JavaTypeVisitor<AtomicInteger> typeVisitor = new JavaTypeVisitor<AtomicInteger>() { |
230 | | - @Override |
231 | | - public JavaType visit(@Nullable JavaType javaType, AtomicInteger n) { |
232 | | - if (javaType != null && uniqueIdentity.test(javaType)) { |
233 | | - n.incrementAndGet(); |
234 | | - return super.visit(javaType, n); |
235 | | - } |
236 | | - //noinspection ConstantConditions |
237 | | - return javaType; |
238 | | - } |
239 | | - }; |
240 | | - |
241 | | - @Override |
242 | | - public J preVisit(J tree, AtomicInteger n) { |
243 | | - n.incrementAndGet(); |
244 | | - return tree; |
245 | | - } |
246 | | - |
247 | | - @Override |
248 | | - public JavaType visitType(@Nullable JavaType javaType, AtomicInteger n) { |
249 | | - return typeVisitor.visit(javaType, n); |
250 | | - } |
251 | | - }.visit(this, n); |
252 | | - return n.get(); |
253 | | - } |
254 | | - |
255 | 219 | @Override |
256 | 220 | public Padding getPadding() { |
257 | 221 | Padding p; |
|
0 commit comments