Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
hooah
Feb 6, 2006
WTF?

fletcher posted:

What's a good way of identifying 3rd party Java dependencies that are no longer actively maintained?

It's pretty straightforward with maven to find out which dependencies are out of date, meaning there is a newer version available.

What about for the case when you are on the latest version of a dependency, but there hasn't been a new version in a while and the project is no longer maintained?

I go to the source (e.g. GitHub or GitLab) if it's a public project. It'd be nice to know if there's a better way, though!

Adbot
ADBOT LOVES YOU

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

hooah posted:

I go to the source (e.g. GitHub or GitLab) if it's a public project. It'd be nice to know if there's a better way, though!

Yup, same here. The release dates are on maven central as well (if the dependency is there, of course). But with dozens of projects and hundreds of dependencies, a big manual tedious recurring effort is tough to deal with.

It would come up in a security scan if there's a CVE, but of course at that point you are scrambling to rip out a library in a very short amount of time...

Ocean of Milk
Jun 25, 2018

oh yeah
Do you have dozens of projects that each have different versions of the same dozen dependencies, or do you actually have hundreds of differents deps, i.e. each of the dozen projects does a wildly different thing from the other and therefore doesn't need the same deps? Or are you talking about transitive deps, i.e. the dependencies of your dependencies?
I think that if you want it automated (which you should because you should be able to do this check in regular interval), you want to measure some kind of proxy related to activity and try to reason about frequency and recency. How many commits, how many released versions how many responses to github issues, how many mailing list posts by the maintainer... have been made in the last year relative to last year. Ofc some of these are gonna be easier to measure than others.
Though I think that there's a few catches. Generally one would expect better and more mature libs to require less maintenance work. Though perhaps there's maintenance work that has to happen regardless, like making use of new language features and whatnot.

imnotinsane
Jul 19, 2006
I can't seem to wrap my head around how I am meant to solve this issue, I think I am coming from the wrong angle.

If I have an class object that contains 3 values, for example Student() and it holds firstName, lastName, studentId.

I have then created an array of Student[] objects, so now i am holding something like
code:
Student[] list = new Student("John", "Smith", 123), new Student("George", "Citizen", 567), new Student("Alan", "Bates", 789);
Now if i wanted to sort them by say student id i can't really loop through the array list because all three values are held in the same object. I was thinking maybe I am meant to use a 2d array of objects, so that i have list[0][1-3] but then that would still leave me with the same problem as I am not really storing the actual value just the object it self that contains those three associated variables.

The other way I was thinking was to make a method that returned the values explicitly as array, for example, Student.getArrayValues() and I guess create a new 2d array list on the fly and then manually sort that through a loop and print the results but it feels like I'm doubling up my work for nothing and there should be a simpler method.

Any help would be appreciated

ivantod
Mar 27, 2010

Mahalo, fuckers.

imnotinsane posted:

I can't seem to wrap my head around how I am meant to solve this issue, I think I am coming from the wrong angle.

If I have an class object that contains 3 values, for example Student() and it holds firstName, lastName, studentId.

I have then created an array of Student[] objects, so now i am holding something like
code:
Student[] list = new Student("John", "Smith", 123), new Student("George", "Citizen", 567), new Student("Alan", "Bates", 789);
Now if i wanted to sort them by say student id i can't really loop through the array list because all three values are held in the same object. I was thinking maybe I am meant to use a 2d array of objects, so that i have list[0][1-3] but then that would still leave me with the same problem as I am not really storing the actual value just the object it self that contains those three associated variables.

The other way I was thinking was to make a method that returned the values explicitly as array, for example, Student.getArrayValues() and I guess create a new 2d array list on the fly and then manually sort that through a loop and print the results but it feels like I'm doubling up my work for nothing and there should be a simpler method.

Any help would be appreciated

Maybe this will help you: https://www.baeldung.com/java-8-comparator-comparing.

By using the Arrays.sort(...) method you can give it a lambda function telling it how to compare the objects. This allows you to compare by one (or more) chosen fields (e.g. in your case student id).

Adbot
ADBOT LOVES YOU

imnotinsane
Jul 19, 2006

ivantod posted:

Maybe this will help you: https://www.baeldung.com/java-8-comparator-comparing.

By using the Arrays.sort(...) method you can give it a lambda function telling it how to compare the objects. This allows you to compare by one (or more) chosen fields (e.g. in your case student id).

Ahh that is exactly what I was looking for, thanks

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply