Coder Social home page Coder Social logo

Show line number about sortpom HOT 11 CLOSED

ekryd avatar ekryd commented on August 30, 2024
Show line number

from sortpom.

Comments (11)

php-coder avatar php-coder commented on August 30, 2024 1

Why not keep this issue open to be able to fix it someday in the next major release?

from sortpom.

Ekryd avatar Ekryd commented on August 30, 2024

I use a library called Jdom to parse the XML, and I think that this library doesn't support the concept of line numbers. I look into this further, but the chances are slim.

from sortpom.

Ekryd avatar Ekryd commented on August 30, 2024

The plugin works like this for verification:

  1. The pom.xml is parsed by the JDOM library into an element structure. That library does not store the line numbers for the elements.
  2. The plugin sorts the element structure
  3. The plugin traverses both the original element structure and the sorted element structure. For each pair of elements the plugin checks if the elements and the content are the same.
  4. When the two elements differ, the plugin writes an error message.

The problem is that the element structure does not have access to the line number. I could try to locate the elements in the original file by using a line by line string comparison, but I cannot be certain that I get a unique match or even that I get a match at all (if element start or end is on separate lines).

Sometimes the line number indication would point to the wrong line and sometimes it would be missing.
Would it help you to get a line number that you could not trust?

from sortpom.

php-coder avatar php-coder commented on August 30, 2024

I'm surprised that library didn't have information about line numbers. Is it something JDOM-specific or all the libraries have the same behavior?

from sortpom.

Ekryd avatar Ekryd commented on August 30, 2024

It is JDOM specific. It is an old library (think Java 1.4) and I don't have the time to change xml parsing library. Some of the plugin functionality is now directly dependent on that version of that library.
Not very good design and I can only say that I would have done differently today than in 2009 :-/

from sortpom.

Ekryd avatar Ekryd commented on August 30, 2024

Sorry mate, it won't happen. I don't have time to rewrite the plugin from scratch. It is no idea to keep issues open if I can't fix them within reasonable time.

from sortpom.

khmarbaise avatar khmarbaise commented on August 30, 2024

But others could see what can be done and might offer a pull request...

from sortpom.

Ekryd avatar Ekryd commented on August 30, 2024

To rewrite the plugin from scratch :-D
I'm not even sure that I would like that (it's my baby!!).

How about if I create a wiki page that collects issues (epics) that can only be done sometime in the future?

from sortpom.

khmarbaise avatar khmarbaise commented on August 30, 2024

Sorry to say, but if you don't like it than do not make it open source ;-( But of course a wiki pages which collects issues like this would be another good idea...Or just assign the issues to an appropriate milestone like 3.0 ?

from sortpom.

php-coder avatar php-coder commented on August 30, 2024

Sorry to say, but if you don't like it than do not make it open source ;-(

@Ekryd did a good job by creating this plugin and it's ok that he doesn't want to accept some PRs because of some reason. Actually it's good that he said it as-is right now. It just means that if someone wants to implement it, he/she should fork this project instead of creating a PR here.

from sortpom.

khmarbaise avatar khmarbaise commented on August 30, 2024

Of course a fork is also a reasonable solution.

from sortpom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.