-
Notifications
You must be signed in to change notification settings - Fork 27
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
Inner class wrong definition #601
Comments
Hi, @khaes-kth , I followed the link provided but it does not seem relevant as it doesn't even have the class Moreover, I don't understand how S2111 could bring about the above diff. Its processor just replaces the invocation which is not related to what's happening in the above diff. Did you mean some other sonar rule or am I misinterpreting it? |
You're right. The changes in that commit are not related to what Sorald does. But that link specifies the commit id (look at the URL) on which we ran Sorald.
Exactly, that's the problem. It shouldn't be done, but it is. I guess it has something to do with the Spoon printer. |
I ran the repair command, diff --git a/CollectionTest.java b/CollectionTest.java
index 91bb78c..74d7115 100644
--- a/CollectionTest.java
+++ b/CollectionTest.java
@@ -415,7 +415,7 @@ public class CollectionTest
task.setDescription("Complete that other task.");
task.setTags(tags);
task.setDateCreated(new Date(System.currentTimeMillis()));
- task.setBigDecimal(new BigDecimal(564654.234234d));
+ task.setBigDecimal(BigDecimal.valueOf(564654.234234));
task.setBigInteger(BigInteger.valueOf(System.currentTimeMillis()));
return task; Could you send me the link to the PR where the above diff was suggested? |
I believe the result should be different when you do it for the whole project. This is what get in my terminal when I repair all violations of 2111 in the whole project.
|
Yeah, I see the issue now. Seems really weird. EDIT: It is extremely weird because of the randomness of the |
When 2111 fixes are applied on this (commit: eb32eaabd397e7a90eb799ead13eda4d6ea8d1d0), the following change is made:
The text was updated successfully, but these errors were encountered: