Skip to content
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

Proper handling of newlines when parsing comments #725

Closed
koppor opened this issue May 27, 2024 · 7 comments
Closed

Proper handling of newlines when parsing comments #725

koppor opened this issue May 27, 2024 · 7 comments

Comments

@koppor
Copy link

koppor commented May 27, 2024

I am investigating another "interesting" PR (JabRef/jabref-koppor#687)

I noticed that comments are now handled. Thank you for that!

It would be great if RefactoringMinor could handle newlines. Currently, if "only" line breaks change, it is determined as deleted/new - not as moved:

grafik

@tsantalis
Copy link
Owner

Move code from main to initLogging

Screenshot from 2024-05-27 15-21-00

@tsantalis
Copy link
Owner

@koppor

It's really cool the tool finds that routeLoggingToSlf4J and addLogToDisk have been merged to initLogging
On top of that initializeLogger has been inlined to initLogging.

This is a challenging case, but our tool did pretty well !!

tsantalis added a commit that referenced this issue May 27, 2024
Merge Method	[private routeLoggingToSlf4J() : void, private addLogToDisk() : void] to private initLogging(args String[]) : void in class org.jabref.Launcher

Inline Method	private initializeLogger() : void inlined to private initLogging(args String[]) : void in class org.jabref.Launcher
@tsantalis
Copy link
Owner

tsantalis commented May 28, 2024

Diff after supporting move code from main to initLogging

Screenshot from 2024-05-28 05-54-05

@koppor
Copy link
Author

koppor commented May 28, 2024

Thank you for continuosly improving the tool! - (I still miss the connecting lines (#703 (comment)) to see which block went where). I am still used to the IntelliJ "Resolve Conflicts" dialog ^^)

@tsantalis
Copy link
Owner

@koppor @pouryafard75
The javadoc is matched as follows:

Screenshot from 2024-05-28 20-03-14

Screenshot from 2024-05-28 20-05-56

@tsantalis
Copy link
Owner

tsantalis commented May 29, 2024

@pouryafard75

4 of our tests failed after this update.
I checked them and all of them have reformatted Javadoc.
So, the change is positive. I will check if the Javadoc mappings can be further improved.

org.opentest4j.AssertionFailedError: Failed for belaban/JGroups@f153375 , srcFileName: src/org/jgroups/auth/FixedMembershipToken.java ==> expected: <112842> but was: <113219>

org.opentest4j.AssertionFailedError: Failed for spring-projects/spring-security@fcc9a34 , srcFileName: web/src/main/java/org/springframework/security/web/context/SaveContextOnUpdateOrErrorResponseWrapper.java ==> expected: <442150> but was: <443825>

org.opentest4j.AssertionFailedError: Failed for addthis/hydra@7fea4c9 , srcFileName: hydra-main/src/main/java/com/addthis/hydra/job/spawn/SpawnBalancer.java ==> expected: <2844989> but was: <2846125>

org.opentest4j.AssertionFailedError: Failed for AsyncHttpClient/async-http-client@f01d861 , srcFileName: api/src/test/java/org/asynchttpclient/oauth/OAuthSignatureCalculatorTest.java ==> expected: <219056> but was: <221438>

org.opentest4j.AssertionFailedError: Failed for nutzam/nutz@de7efe4 , srcFileName: src/org/nutz/dao/util/Daos.java ==> expected: <1103701> but was: <1103968>

@tsantalis
Copy link
Owner

@koppor @pouryafard75

image

This issue has been fixed to perfection!
Thanks Pouria for your nice implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants