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

Wrong line numbers and constructor call order #1236

Open
esfomeado opened this issue Jan 23, 2024 · 0 comments
Open

Wrong line numbers and constructor call order #1236

esfomeado opened this issue Jan 23, 2024 · 0 comments

Comments

@esfomeado
Copy link

Code sample:

1: public class Sample {
2:    public List<Object> getValues() {
3:         return List.of(
4:             new Integer( 0 ),
5:             new Long( 0 )
6:        );
7:     }
8: }

Now if I check the constructor calls from self on the getValues()

Set<JavaConstructorCall> constructorCallsFromSelf = javaMethod.getConstructorCallsFromSelf();

I will get in this case 3 method calls (List, Integer, Long) in a "random" order and not the order of declaration plus the getSourceCodeLocation().getLineNumber() for all of them will be line 3 instead of 3, 4 and 5.

Thanks

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

1 participant