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

fix: Invalid column of the element, positioned before the first line separator #2409

Merged
merged 4 commits into from
Aug 28, 2018

Conversation

Egor18
Copy link
Contributor

@Egor18 Egor18 commented Aug 24, 2018

Hi! I've found that spoon gives incorrect column number for the element, positioned before the first line separator in file.

Consider the following file (TestSimpleClass.java):

public class TestSimpleClass {
    public int x;
    public int y;
    public int z;
}

If you try to get column from postion of this class, you will get -69, which is incorrect.
So, this PR is intended to fix that.

@Egor18
Copy link
Contributor Author

Egor18 commented Aug 24, 2018

It seems like Travis CI build failed with timeout. Could you please run it again?

@pvojtechovsky
Copy link
Collaborator

I cannot personally run CI again, but there is an easy way. To commit a minor change - e.g to add a dot at the end of some comment sentence and push it.

@Egor18 Egor18 closed this Aug 24, 2018
@Egor18 Egor18 reopened this Aug 24, 2018
@@ -77,6 +77,9 @@ protected int searchColumnNumber(int position) {
if (length == 0) {
return -1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to put there 'return position' too. It is probably the case when source contains only one line without EOL.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Egor18, ping?

@surli surli merged commit 160a522 into INRIA:master Aug 28, 2018
@monperrus monperrus mentioned this pull request Sep 20, 2018
4 tasks
@Egor18 Egor18 deleted the fixPosition branch October 5, 2018 09:30
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

Successfully merging this pull request may close these issues.

4 participants