Skip to content

Commit 1770ea6

Browse files
committed
Revert "Implement Cs.CompilationUnit#getWeight()"
This reverts commit 6f63a96.
1 parent f07b4f1 commit 1770ea6

File tree

1 file changed

+0
-36
lines changed
  • rewrite-csharp/src/main/java/org/openrewrite/csharp/tree

1 file changed

+0
-36
lines changed

rewrite-csharp/src/main/java/org/openrewrite/csharp/tree/Cs.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
import org.openrewrite.csharp.CSharpPrinter;
2424
import org.openrewrite.csharp.CSharpVisitor;
2525
import org.openrewrite.java.JavaPrinter;
26-
import org.openrewrite.java.JavaTypeVisitor;
27-
import org.openrewrite.java.JavaVisitor;
28-
import org.openrewrite.java.JavadocVisitor;
2926
import org.openrewrite.java.internal.TypesInUse;
3027
import org.openrewrite.java.tree.*;
3128
import org.openrewrite.marker.Markers;
@@ -40,8 +37,6 @@
4037
import java.util.Collections;
4138
import java.util.List;
4239
import java.util.UUID;
43-
import java.util.concurrent.atomic.AtomicInteger;
44-
import java.util.function.Predicate;
4540
import java.util.stream.Collectors;
4641

4742
import static java.util.Collections.singletonList;
@@ -221,37 +216,6 @@ public TypesInUse getTypesInUse() {
221216
return cache;
222217
}
223218

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-
255219
@Override
256220
public Padding getPadding() {
257221
Padding p;

0 commit comments

Comments
 (0)