-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not change package when non-recursive #4447
base: main
Are you sure you want to change the base?
Conversation
Hey Tim, Below is the test case where changes to @Test
void excludePackageTest() {
//language=java
rewriteRun(
spec -> spec.recipe(new ChangePackage(
"com.sun.net.ssl",
"javax.net.ssl",
false
)),
java(
"""
package com.test;
import com.sun.net.ssl.internal.*;
import com.sun.net.ssl.HostnameVerifier;
class Test {
public com.sun.net.ssl.HostnameVerifier hv;
void exampleMethod() {
}
}
""",
"""
package com.test;
import com.sun.net.ssl.internal.*;
import javax.net.ssl.HostnameVerifier;
class Test {
public javax.net.ssl.HostnameVerifier hv;
void exampleMethod() {
}
}
"""
)
);
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- rewrite-java/src/test/java/org/openrewrite/java/internal/parser/TypeTableTest.java
- lines 51-51
- lines 67-68
- lines 92-93
- lines 140-140
Capturing the diff --git a/Foo.java b/Foo.java
index 562edaa..d960c46 100644
--- a/Foo.java
+++ b/Foo.java
@@ -1,4 +1,4 @@
-import com.sun.net.ssl.internal.*;
+import javax.net.ssl.internal.*;
import javax.net.ssl.HostnameVerifier;
class Foo {
javax.net.ssl.HostnameVerifier hv; |
This is an interesting case: we first and separate evaluate a precondition to determine if we need further changes; that precondition resolves to true due to the presence of |
Maybe fixed by #4942? Not sure, as the work I did was for YAML. |
Add unit test as reported via Slack by @BhavanaPidapa; update precondition to evaluate recursive boolean for package declaration too.