Skip to content

Commit

Permalink
clean up some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kunli2 committed Nov 8, 2023
1 parent 1cdda16 commit 3874571
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 23 deletions.
8 changes: 3 additions & 5 deletions src/test/java/org/openrewrite/kotlin/tree/AnnotationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.openrewrite.kotlin.Assertions.kotlin;

@SuppressWarnings({"RedundantSuppression", "RedundantNullableReturnType", "RedundantVisibilityModifier", "UnusedReceiverParameter", "SortModifiers"})
@SuppressWarnings({"RedundantSuppression", "RedundantNullableReturnType", "RedundantVisibilityModifier", "UnusedReceiverParameter", "SortModifiers", "TrailingComma"})
class AnnotationTest implements RewriteTest {

@Language("kotlin")
Expand Down Expand Up @@ -158,8 +158,7 @@ void fullyQualifiedAnnotation() {
kotlin(
"""
@java.lang.Deprecated
class A {
}
class A
"""
)
);
Expand Down Expand Up @@ -504,8 +503,7 @@ void collectionLiteralExpression() {
@JsonSubTypes(value = [
JsonSubTypes . Type(value = Employee::class, name = "Employee")
])
public sealed interface Person {
}
public sealed interface Person
"""
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@

class AnonymousFunctionTest implements RewriteTest {

// @Override
// public void defaults(RecipeSpec spec) {
// spec
// .recipe(Recipe.noop())
// .allSources(spaceConscious());
// }

@Test
@Issue("https://github.com/openrewrite/rewrite-kotlin/issues/287")
void noArgs() {
Expand All @@ -38,7 +31,6 @@ void noArgs() {
"""
val alwaysTrue = fun ( ) = true
"""
// , spec -> spec.afterRecipe(spaceConscious(spec))
)
);
}
Expand Down Expand Up @@ -68,5 +60,4 @@ void nestedWithWhitespace() {
)
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import static org.openrewrite.kotlin.Assertions.kotlin;

@SuppressWarnings("unused")
class FunctionTypeTest implements RewriteTest {

@Issue("https://github.com/openrewrite/rewrite-kotlin/issues/326")
Expand All @@ -32,9 +33,8 @@ void functionWithFunctionTypeParameter() {
"""
class GradleSpigotDependencyLoaderTestBuilder(
var init: TestInitializer.() -> Unit = {}
) {
}
)
class TestInitializer(
val resourcesDir: String
)
Expand Down Expand Up @@ -94,6 +94,7 @@ void parenthesizedNullableType() {
);
}

@SuppressWarnings("UNUSED_PARAMETER")
@ExpectedToFail
@Test
@Issue("https://github.com/openrewrite/rewrite-kotlin/issues/292")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,12 @@ void genericTypeParameters() {
@Test
void receiverType() {
rewriteRun(
kotlin("class Test"),
kotlin("fun Test . method ( ) { }")
kotlin(
"""
class Test
fun Test . method ( ) { }
"""
)
);
}

Expand All @@ -180,10 +184,7 @@ class Test {
fun build ( s : ( ) -> String ) {
}
}
"""
),
kotlin(
"""
fun Test . method ( ) = build {
"42"
}
Expand All @@ -198,6 +199,7 @@ void nullableReturnType() {
kotlin(
"""
fun method ( ) : Array < Int > ? {
return null
}
"""
)
Expand Down

0 comments on commit 3874571

Please sign in to comment.