Skip to content

Commit

Permalink
Apply code suggestions from bot
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek authored and vudayani committed Oct 3, 2024
1 parent a29b0b0 commit c393fc0
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void dependenciesFromResources(@TempDir Path temp) throws Exception {
.matches(Files::exists, "File extracted from classpath resources exists on disk")
.matches(path -> path.endsWith("guava-31.0-jre.jar"),
"classpathFromResources should return guava-31.0-jre.jar from resources, even when the target " +
"directory contains guava-30.0-jre.jar which has the same prefix");
"directory contains guava-30.0-jre.jar which has the same prefix");
}

@Test
Expand Down Expand Up @@ -168,59 +168,60 @@ void moduleInfo() {
}

@ParameterizedTest
//language=java
@ValueSource(strings = {
"""
package com.example.demo;
class FooBar {
public void test() {
ownerR
}
}
package com.example.demo;
class FooBar {
public void test() {
ownerR
}
}
""",
"""
package com.example.demo;
class FooBar {
public void test(int num string msg) {
String a; this.ownerR
System.out.println();
}
}
package com.example.demo;
class FooBar {
public void test(int num string msg) {
String a; this.ownerR
System.out.println();
}
}
""",
"""
package com.example.demo;
class FooBar {
public void test(int num string s, int b) {
String a; this.ownerR
System.out.println();
}
}
package com.example.demo;
class FooBar {
public void test(int num string s, int b) {
String a; this.ownerR
System.out.println();
}
}
""",
"""
package com.example.demo;
class FooBar {
public void test(int num) {
String a; this.ownerR // comment
System.out.println();
}
}
package com.example.demo;
class FooBar {
public void test(int num) {
String a; this.ownerR // comment
System.out.println();
}
}
""",
"""
package com.example.demo;
class FooBar {
public void test(int num) {
// comment
this.ownerR
}
}
package com.example.demo;
class FooBar {
public void test(int num) {
// comment
this.ownerR
}
}
""",
"""
package com.example.demo;
class FooBar {
public void test(int param ) {
this.ownerR
// comment
}
}
package com.example.demo;
class FooBar {
public void test(int param ) {
this.ownerR
// comment
}
}
"""
})
void erroneousExpressionStatements(@Language("java") String source) {
Expand All @@ -235,40 +236,40 @@ void erroneousVariableDeclarations() {
spec -> spec.recipe(new FindCompileErrors()),
java(
"""
package com.example.demo;
class Foo {
/pet
public void test() {
}
}
package com.example.demo;
class Foo {
/pet
public void test() {
}
}
""",
"""
package com.example.demo;
class Foo {
/*~~>*///*~~>*/pet
public void test() {
}
}
package com.example.demo;
class Foo {
/*~~>*///*~~>*/pet
public void test() {
}
}
"""
),
java(
"""
package com.example.demo;
class Bar {
pet
public void test() {
}
}
package com.example.demo;
class Bar {
pet
public void test() {
}
}
""",
"""
package com.example.demo;
class Bar {
/*~~>*/pet
public void test() {
}
}
package com.example.demo;
class Bar {
/*~~>*/pet
public void test() {
}
}
"""
)
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ public J.Erroneous visitErroneous(J.Erroneous erroneous, ExecutionContext ctx) {
}
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public static class Row {
description = "The source code of the type use.")
String code;
}
}
}

0 comments on commit c393fc0

Please sign in to comment.