Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu
if (!isSystemOutMethod(m)) {
return m;
}
maybeAddImport("java.io.IO", false);
String methodName = m.getName().getSimpleName();
return m.getArguments().isEmpty() ?
JavaTemplate.apply( "IO.#{}()", getCursor(), m.getCoordinates().replace(), methodName ) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ void test() {
}
""",
"""
import java.io.IO;

class Example {
void test() {
IO.print("Hello");
Expand All @@ -77,8 +75,6 @@ void test() {
}
""",
"""
import java.io.IO;

class Example {
void test() {
IO.println("Hello");
Expand All @@ -103,8 +99,6 @@ void test() {
}
""",
"""
import java.io.IO;

class Example {
void test() {
IO.println("Hello");
Expand All @@ -128,8 +122,6 @@ void test() {
}
""",
"""
import java.io.IO;

class Example {
void test() {
String message = "Hello World";
Expand All @@ -153,8 +145,6 @@ void test() {
}
""",
"""
import java.io.IO;

class Example {
void test() {
IO.println();
Expand All @@ -180,8 +170,6 @@ void test() {
}
""",
"""
import java.io.IO;

class Example {
void test() {
IO.print("Hello");
Expand Down Expand Up @@ -210,8 +198,6 @@ void test() {
}
""",
"""
import java.io.IO;

class Example {
void test() {
String name = "John";
Expand Down Expand Up @@ -261,7 +247,7 @@ void test() {
}

@Test
void addsImportForRegularClassWithPackage() {
void doesNotAddImportForRegularClassWithPackage() {
rewriteRun(
java(
"""
Expand All @@ -276,8 +262,6 @@ public void greet() {
"""
package com.helloworld;

import java.io.IO;

public class Main {
public void greet() {
IO.println("hello");
Expand Down
Loading